This commit is contained in:
Yuri Kuznetsov
2022-10-16 23:08:07 +03:00
parent 74dbc64d5b
commit 537b921e87
2 changed files with 9 additions and 15 deletions
@@ -45,16 +45,10 @@ use SeekableIterator;
*/
class ArgumentList implements Evaluatable, Iterator, Countable, ArrayAccess, SeekableIterator
{
/**
* @var mixed[]
*/
/** @var mixed[] */
protected $dataList;
private int $position = 0;
/**
* @param mixed[] $dataList
*/
/** @param mixed[] $dataList */
public function __construct(array $dataList)
{
$this->dataList = $dataList;
@@ -97,6 +91,7 @@ class ArgumentList implements Evaluatable, Iterator, Countable, ArrayAccess, See
/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->getArgumentByIndex($this->position);
@@ -105,6 +100,7 @@ class ArgumentList implements Evaluatable, Iterator, Countable, ArrayAccess, See
/**
* @return mixed
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
@@ -142,6 +138,7 @@ class ArgumentList implements Evaluatable, Iterator, Countable, ArrayAccess, See
* @param mixed $offset
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!$this->offsetExists($offset)) {
+4 -7
View File
@@ -49,16 +49,10 @@ use InvalidArgumentException;
class EntityCollection implements Collection, Iterator, Countable, ArrayAccess, SeekableIterator
{
private ?EntityFactory $entityFactory = null;
private ?string $entityType;
private int $position = 0;
private bool $isFetched = false;
/**
* @var array<TEntity|array<string,mixed>>
*/
/** @var array<TEntity|array<string, mixed>> */
protected array $dataList = [];
/**
@@ -86,6 +80,7 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess,
/**
* @return TEntity
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->getEntityByOffset($this->position);
@@ -94,6 +89,7 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess,
/**
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
@@ -149,6 +145,7 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess,
* @param mixed $offset
* @return ?TEntity
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
if (!isset($this->dataList[$offset])) {