mirror of
https://github.com/predis/predis.git
synced 2026-10-17 09:15:51 +00:00
iterate not iterable connections #552
This commit is contained in:
committed by
Peter Gribanov
parent
111d100ee3
commit
4363345f7c
+3
-1
@@ -535,7 +535,9 @@ class Client implements ClientInterface, \IteratorAggregate
|
||||
$connection = $this->getConnection();
|
||||
|
||||
if (!$connection instanceof \Traversable) {
|
||||
throw new ClientException('The underlying connection is not traversable');
|
||||
return new \ArrayIterator(array(
|
||||
(string) $connection => new static($connection, $this->getOptions())
|
||||
));
|
||||
}
|
||||
|
||||
foreach ($connection as $node) {
|
||||
|
||||
Reference in New Issue
Block a user