Skip to content

Commit

Permalink
Merge pull request #1448 from VincentLanglet/splObjectStorage
Browse files Browse the repository at this point in the history
Add fix for SplObjectStorage with next PHPStorm stubs
  • Loading branch information
Ocramius authored Sep 12, 2024
2 parents 7b7dc3b + bdc7592 commit 33da7cb
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 33da7cb

Please sign in to comment.