diff --git a/composer.json b/composer.json index 210c4c87..c2d49a20 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "php": ">=8.2", - "phpstan/phpstan": "^2.1" + "phpstan/phpstan": "^2.1.32" }, "require-dev": { "illuminate/container": "^11.0", diff --git a/rector.php b/rector.php index f1508dcd..79558778 100644 --- a/rector.php +++ b/rector.php @@ -6,7 +6,7 @@ return RectorConfig::configure() ->withPaths([__DIR__ . '/src', __DIR__ . '/tests']) - ->withPreparedSets(codeQuality: true, deadCode: true, naming: true, privatization: true, earlyReturn: true, codingStyle: true) + ->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, privatization: true, naming: true, earlyReturn: true) ->withRootFiles() ->withSkip([ '*/Source/*', diff --git a/src/TypeResolver/ClassConstFetchReturnTypeResolver.php b/src/TypeResolver/ClassConstFetchReturnTypeResolver.php index a17191ed..07276050 100644 --- a/src/TypeResolver/ClassConstFetchReturnTypeResolver.php +++ b/src/TypeResolver/ClassConstFetchReturnTypeResolver.php @@ -13,14 +13,13 @@ use PHPStan\Type\MixedType; use PHPStan\Type\ObjectType; use PHPStan\Type\Type; -use Symplify\PHPStanExtensions\Exception\ShouldNotHappenException; final class ClassConstFetchReturnTypeResolver { public function resolve(MethodReflection $methodReflection, MethodCall $methodCall): ?Type { if (! isset($methodCall->args[0])) { - throw new ShouldNotHappenException('Not supported without argument'); + return null; } $firstArgOrVariadciPlaceholder = $methodCall->args[0];