diff --git a/src/Client.php b/src/Client.php index e6d731de..5f41318a 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,6 +11,8 @@ namespace Predis; +use Traversable; + use Predis\Command\CommandInterface; use Predis\Command\RawCommand; use Predis\Command\ScriptCommand; @@ -35,6 +37,9 @@ use Predis\Transaction\MultiExec as MultiExecTransaction; * one with its own responsibility and scope. * * {@inheritdoc} + * @template TKey + * @template TValue + * @template-implements Traversable * * @author Daniele Alessandri */ @@ -378,7 +383,7 @@ class Client implements ClientInterface, \IteratorAggregate : $this->$initializer(null, $argv[0]); case 2: - list($arg0, $arg1) = $argv; + [$arg0, $arg1] = $argv; return $this->$initializer($arg0, $arg1); @@ -512,6 +517,7 @@ class Client implements ClientInterface, \IteratorAggregate /** * {@inheritdoc} + * @return Traversable|TValue[] */ #[\ReturnTypeWillChange] public function getIterator() @@ -519,7 +525,7 @@ class Client implements ClientInterface, \IteratorAggregate $clients = array(); $connection = $this->getConnection(); - if (!$connection instanceof \Traversable) { + if (!$connection instanceof Traversable) { return new \ArrayIterator(array( (string) $connection => new static($connection, $this->getOptions()) ));