diff --git a/src/Util/ArrayCollection.php b/src/Util/ArrayCollection.php index d20a614b26..c29ae9aa3b 100644 --- a/src/Util/ArrayCollection.php +++ b/src/Util/ArrayCollection.php @@ -72,6 +72,7 @@ public function last() * * @return \ArrayIterator */ + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayIterator($this->elements); @@ -251,6 +252,7 @@ public function offsetExists($offset): bool * * @phpstan-return TValue|null */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->elements[$offset] ?? null; @@ -267,6 +269,7 @@ public function offsetGet($offset) * @phpstan-param TKey|null $offset * @phpstan-param TValue $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if ($offset === null) { @@ -285,6 +288,7 @@ public function offsetSet($offset, $value) * * @phpstan-param TKey $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { if (!\array_key_exists($offset, $this->elements)) { diff --git a/src/Util/PrioritizedList.php b/src/Util/PrioritizedList.php index d90bcdc942..04676d0847 100644 --- a/src/Util/PrioritizedList.php +++ b/src/Util/PrioritizedList.php @@ -50,6 +50,7 @@ public function add($item, int $priority): void * * @phpstan-return iterable */ + #[\ReturnTypeWillChange] public function getIterator(): iterable { if ($this->optimized === null) {