mirror of
https://github.com/predis/predis.git
synced 2026-08-24 13:09:31 +00:00
added annotations to suppress PHP 8.1 return type deprecation warning… (#810)
* added annotations to suppress PHP 8.1 return type deprecation warning for `IteratorAggregate::toIterator()` * move import Co-authored-by: Josh England <joshua.england@trinet.com> Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
This commit is contained in:
+8
-2
@@ -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<TKey, TValue>
|
||||
*
|
||||
* @author Daniele Alessandri <suppakilla@gmail.com>
|
||||
*/
|
||||
@@ -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<TKey, TValue>|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())
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user