Skip to content

Commit 3c891f3

Browse files
committed
Add #[\ReturnTypeWillChange] to Iterator in tests
1 parent bb9911f commit 3c891f3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

test/Fixture/EntryIterator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ public function __construct(array $entries)
1313
$this->entries = $entries;
1414
}
1515

16+
#[\ReturnTypeWillChange]
1617
public function current()
1718
{
1819
[$key, $value] = \current($this->entries);
1920
return $value;
2021
}
2122

23+
#[\ReturnTypeWillChange]
2224
public function key()
2325
{
2426
[$key, $value] = \current($this->entries);

test/Fixture/HistoryIterator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public function __construct(array $values)
1111
parent::__construct(new \ArrayIterator($values));
1212
}
1313

14+
#[\ReturnTypeWillChange]
1415
public function current()
1516
{
1617
$this->history[] = __FUNCTION__;
@@ -23,6 +24,7 @@ public function next(): void
2324
parent::next();
2425
}
2526

27+
#[\ReturnTypeWillChange]
2628
public function key()
2729
{
2830
$this->history[] = __FUNCTION__;

test/Fixture/ThrowIterable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class ThrowIterable implements \IteratorAggregate
55
{
6-
public function getIterator()
6+
public function getIterator(): \Traversable
77
{
88
throw new \AssertionError("Failed to assert that iterable was not used");
99
}

0 commit comments

Comments
 (0)