Closed VincentLanglet closed 4 days ago
I feel like there should definitely be a test added. You can ask about the interfaces this class implements.
Otherwise you can run into a mutant: if $modifiedNames[] = new Node\Name\FullyQualified(Iterator::class);
would get removed, no tests would fail.
I feel like there should definitely be a test added. You can ask about the interfaces this class implements.
Otherwise you can run into a mutant: if
$modifiedNames[] = new Node\Name\FullyQualified(Iterator::class);
would get removed, no tests would fail.
Current tests will fail without this fix as soon as the PHPStorm stubs will be updated here The error will be https://github.com/Roave/BetterReflection/actions/runs/10706859215/job/29685555800?pr=1445
1) Roave\BetterReflectionTest\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest::testInternalClasses with data set #73 ('SplObjectStorage')
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
0 => 'ArrayAccess',
1 => 'Countable',
2 => 'Iterator',
- 3 => 'Serializable',
- 4 => 'Traversable',
+ 3 => 'SeekableIterator',
+ 4 => 'Serializable',
+ 5 => 'Traversable',
]
D:\a\BetterReflection\BetterReflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:[178](https://github.com/Roave/BetterReflection/actions/runs/10706859215/job/29685555800?pr=1445#step:6:179)
D:\a\BetterReflection\BetterReflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:186
D:\a\BetterReflection\BetterReflection\test\unit\SourceLocator\SourceStubber\PhpStormStubsSourceStubberTest.php:156
Thanks @VincentLanglet!
While working on https://github.com/Roave/BetterReflection/pull/1445
I discovered that in the next PHPStorm/stub tag you'll get an issue with SplObjectStorage because
Iterator
is changed toSeekableIterator
for PHP >= 8.4. https://github.com/JetBrains/phpstorm-stubs/blob/56f6b9e55f5885e651553843a1aaf9ec9c586c04/SPL/SPL_c1.php#L2061So I extracted the fix in a separate PR.