diff --git a/tests/PHPStan/Generics/data/bug2620-3.json b/tests/PHPStan/Generics/data/bug2620-3.json index 2906315156a..4af928d7087 100644 --- a/tests/PHPStan/Generics/data/bug2620-3.json +++ b/tests/PHPStan/Generics/data/bug2620-3.json @@ -1,7 +1,7 @@ [ { "message": "Return type (Traversable) of method Generics\\Bug2620\\SomeIterator::getIterator() should be compatible with return type (Traversable) of method IteratorAggregate::getIterator()", - "line": 17, + "line": 18, "ignorable": true } -] \ No newline at end of file +] diff --git a/tests/PHPStan/Generics/data/bug2620.php b/tests/PHPStan/Generics/data/bug2620.php index b2f0a6295da..d5021382597 100644 --- a/tests/PHPStan/Generics/data/bug2620.php +++ b/tests/PHPStan/Generics/data/bug2620.php @@ -14,6 +14,7 @@ class SomeIterator implements \IteratorAggregate { /** * @return \Traversable */ + #[\ReturnTypeWillChange] public function getIterator() { yield new Bar; } diff --git a/tests/PHPStan/Generics/data/bug2622.php b/tests/PHPStan/Generics/data/bug2622.php index f3aa3454435..c92e6faa212 100644 --- a/tests/PHPStan/Generics/data/bug2622.php +++ b/tests/PHPStan/Generics/data/bug2622.php @@ -14,6 +14,7 @@ public function __construct() { $this->values = []; } + #[\ReturnTypeWillChange] public function getIterator() { return new \ArrayObject($this->values); }