From 537b921e87660c9172ad5b70fc2edd5c7a0805fa Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Sun, 16 Oct 2022 23:08:07 +0300 Subject: [PATCH] fix --- application/Espo/Core/Formula/ArgumentList.php | 13 +++++-------- application/Espo/ORM/EntityCollection.php | 11 ++++------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/application/Espo/Core/Formula/ArgumentList.php b/application/Espo/Core/Formula/ArgumentList.php index 9e2673d870..8036603029 100644 --- a/application/Espo/Core/Formula/ArgumentList.php +++ b/application/Espo/Core/Formula/ArgumentList.php @@ -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)) { diff --git a/application/Espo/ORM/EntityCollection.php b/application/Espo/ORM/EntityCollection.php index 743fde6edd..df6dbe6e26 100644 --- a/application/Espo/ORM/EntityCollection.php +++ b/application/Espo/ORM/EntityCollection.php @@ -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> - */ + /** @var array> */ 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])) {