We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a20a9f commit 032f7feCopy full SHA for 032f7fe
src/EnumDynamicReturnTypeExtension.php
@@ -3,6 +3,7 @@
3
namespace MabeEnumPHPStan;
4
5
use MabeEnum\Enum;
6
+use PhpParser\Node\Expr;
7
use PhpParser\Node\Expr\MethodCall;
8
use PhpParser\Node\Expr\StaticCall;
9
use PHPStan\Analyser\Scope;
@@ -81,6 +82,9 @@ public function getTypeFromStaticMethodCall(
81
82
StaticCall $staticCall,
83
Scope $scope
84
): Type {
85
+ if ($staticCall->class instanceof Expr) {
86
+ return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
87
+ }
88
$callClass = $staticCall->class->toString();
89
90
// Can't detect possible types on static::*()
0 commit comments