Skip to content

Commit

Permalink
fix: ensure version check for PHPStan is not null before processing
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPunyapal committed Dec 27, 2024
1 parent 254aa8c commit ce132b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PHPStanAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public static function make(Container $container, array $rules, array $collector
$scopeFactory = TestCaseForTypeCoverage::createScopeFactory($reflectionProvider, $typeSpecifier); // @phpstan-ignore-line

$version = InstalledVersions::getPrettyVersion('phpstan/phpstan');
if (mb_strpos($version, '2.') === 0) {
$nodeScopeResolver = new NodeScopeResolver(
if ($version !== null && mb_strpos($version, '2.') === 0) {
$nodeScopeResolver = new NodeScopeResolver( // @phpstan-ignore-line
$reflectionProvider,
$container->getByType(InitializerExprTypeResolver::class),
$container->getService('betterReflectionReflector'), // @phpstan-ignore-line
Expand All @@ -74,10 +74,10 @@ public static function make(Container $container, array $rules, array $collector
$scopeFactory,
false,
true,
true,
[],
true, // @phpstan-ignore-line
[],
[],
[], // @phpstan-ignore-line
true,
true,
);
Expand Down

0 comments on commit ce132b6

Please sign in to comment.