Skip to content

Commit 5436bf4

Browse files
authored
Bump to PHPStan ^2.1.32 with fix ClassConstFetchReturnTypeResolver (#16)
* Bump to PHPStan ^2.1.32 with fix ClassConstFetchReturnTypeResolver * rectify
1 parent 1af4897 commit 5436bf4

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "MIT",
66
"require": {
77
"php": ">=8.2",
8-
"phpstan/phpstan": "^2.1"
8+
"phpstan/phpstan": "^2.1.32"
99
},
1010
"require-dev": {
1111
"illuminate/container": "^11.0",

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
return RectorConfig::configure()
88
->withPaths([__DIR__ . '/src', __DIR__ . '/tests'])
9-
->withPreparedSets(codeQuality: true, deadCode: true, naming: true, privatization: true, earlyReturn: true, codingStyle: true)
9+
->withPreparedSets(deadCode: true, codeQuality: true, codingStyle: true, privatization: true, naming: true, earlyReturn: true)
1010
->withRootFiles()
1111
->withSkip([
1212
'*/Source/*',

src/TypeResolver/ClassConstFetchReturnTypeResolver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
use PHPStan\Type\MixedType;
1414
use PHPStan\Type\ObjectType;
1515
use PHPStan\Type\Type;
16-
use Symplify\PHPStanExtensions\Exception\ShouldNotHappenException;
1716

1817
final class ClassConstFetchReturnTypeResolver
1918
{
2019
public function resolve(MethodReflection $methodReflection, MethodCall $methodCall): ?Type
2120
{
2221
if (! isset($methodCall->args[0])) {
23-
throw new ShouldNotHappenException('Not supported without argument');
22+
return null;
2423
}
2524

2625
$firstArgOrVariadciPlaceholder = $methodCall->args[0];

0 commit comments

Comments
 (0)