diff --git a/src/PHPStanAnalyser.php b/src/PHPStanAnalyser.php index 281574a..f6314ac 100644 --- a/src/PHPStanAnalyser.php +++ b/src/PHPStanAnalyser.php @@ -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 @@ -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, );