diff --git a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php index 03b6c9989..90a0bf941 100644 --- a/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php +++ b/src/SourceLocator/SourceStubber/PhpStormStubsSourceStubber.php @@ -29,8 +29,10 @@ use Roave\BetterReflection\SourceLocator\SourceStubber\Exception\CouldNotFindPhpStormStubs; use Roave\BetterReflection\SourceLocator\SourceStubber\PhpStormStubs\CachingVisitor; use Roave\BetterReflection\Util\ConstantNodeChecker; +use SeekableIterator; use SimpleXMLElement; use SplFixedArray; +use SplObjectStorage; use Traversable; use function array_change_key_case; @@ -493,6 +495,11 @@ private function replaceExtendsOrImplementsByPhpVersion(string $className, array $modifiedNames[] = new Node\Name\FullyQualified(Traversable::class); continue; } + } elseif ($className === SplObjectStorage::class) { + if ($name === SeekableIterator::class && $this->phpVersion < 80400) { + $modifiedNames[] = new Node\Name\FullyQualified(Iterator::class); + continue; + } } if ($this->getClassNodeData($name) === null) {