Predis to v2.2.2

This commit is contained in:
the-djmaze 2024-04-02 20:15:23 +02:00
parent f6b440adef
commit 84ffe1e552
259 changed files with 2407 additions and 9937 deletions

View file

@ -3,7 +3,8 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
* (c) 2009-2020 Daniele Alessandri
* (c) 2021-2023 Till Krüss
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@ -11,7 +12,10 @@
namespace Predis\Response\Iterator;
use Countable;
use Iterator;
use Predis\Response\ResponseInterface;
use ReturnTypeWillChange;
/**
* Iterator that abstracts the access to multibulk responses allowing them to be
@ -22,42 +26,44 @@ use Predis\Response\ResponseInterface;
*
* Always make sure that the whole iteration is consumed (or dropped) to prevent
* protocol desynchronization issues.
*
* @author Daniele Alessandri <suppakilla@gmail.com>
*/
abstract class MultiBulkIterator implements \Iterator, \Countable, ResponseInterface
abstract class MultiBulkIterator implements Iterator, Countable, ResponseInterface
{
protected $current;
protected $position;
protected $size;
/**
* {@inheritdoc}
* @return void
*/
#[ReturnTypeWillChange]
public function rewind()
{
// NOOP
}
/**
* {@inheritdoc}
* @return mixed
*/
#[ReturnTypeWillChange]
public function current()
{
return $this->current;
}
/**
* {@inheritdoc}
* @return int|null
*/
#[ReturnTypeWillChange]
public function key()
{
return $this->position;
}
/**
* {@inheritdoc}
* @return void
*/
#[ReturnTypeWillChange]
public function next()
{
if (++$this->position < $this->size) {
@ -66,8 +72,9 @@ abstract class MultiBulkIterator implements \Iterator, \Countable, ResponseInter
}
/**
* {@inheritdoc}
* @return bool
*/
#[ReturnTypeWillChange]
public function valid()
{
return $this->position < $this->size;
@ -82,6 +89,7 @@ abstract class MultiBulkIterator implements \Iterator, \Countable, ResponseInter
*
* @return int
*/
#[ReturnTypeWillChange]
public function count()
{
return $this->size;