Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/Analyser/ResultCache/ResultCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
use PHPStan\Internal\ArrayHelper;
use PHPStan\Internal\ComposerHelper;
use PHPStan\PhpDoc\StubFilesProvider;
use PHPStan\Reflection\ReflectionProvider;
use PHPStan\ShouldNotHappenException;
use ReflectionClass;
use ReflectionException;
use Throwable;
use function array_diff;
use function array_fill_keys;
Expand Down Expand Up @@ -82,7 +83,6 @@ public function __construct(
private ExportedNodeFetcher $exportedNodeFetcher,
#[AutowiredParameter(ref: '@fileFinderScan')]
private FileFinder $scanFileFinder,
private ReflectionProvider $reflectionProvider,
private StubFilesProvider $stubFilesProvider,
private FileHelper $fileHelper,
#[AutowiredParameter(ref: '%resultCachePath%')]
Expand Down Expand Up @@ -936,13 +936,15 @@ private function getProjectExtensionFiles(?array $projectConfig, array $dependen

$classes = ProjectConfigHelper::getServiceClassNames($projectConfig);
foreach ($classes as $class) {
if (!$this->reflectionProvider->hasClass($class)) {
try {
// does not use static reflection to reduce file-parsing
$classReflection = new ReflectionClass($class); /** @phpstan-ignore argument.type */
} catch (ReflectionException) {
continue;
}

$classReflection = $this->reflectionProvider->getClass($class);
$fileName = $classReflection->getFileName();
if ($fileName === null) {
if ($fileName === false) {
continue;
}

Expand Down
Loading