From 3e498e1592221f3a01527c10318424014d52f85d Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sat, 20 May 2023 18:56:29 +0200 Subject: [PATCH] Stub validator - PhpParser classes are known without extra stubs --- src/PhpDoc/StubSourceLocatorFactory.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/PhpDoc/StubSourceLocatorFactory.php b/src/PhpDoc/StubSourceLocatorFactory.php index 754d4f7792..27384f41b1 100644 --- a/src/PhpDoc/StubSourceLocatorFactory.php +++ b/src/PhpDoc/StubSourceLocatorFactory.php @@ -40,6 +40,11 @@ public function create(): SourceLocator 'PHPStan\\' => [dirname(__DIR__) . '/'], ]), ); + $locators[] = $this->optimizedPsrAutoloaderLocatorFactory->create( + Psr4Mapping::fromArrayMappings([ + 'PhpParser\\' => [dirname(__DIR__, 2) . '/vendor/nikic/php-parser/lib/PhpParser/'], + ]), + ); $locators[] = new PhpInternalSourceLocator($astPhp8Locator, $this->phpStormStubsSourceStubber);