Skip to content

Commit

Permalink
Fix MutatingScope::resolveName() must be an instance of `PhpParser\…
Browse files Browse the repository at this point in the history
…Node\Name`. (#3)
  • Loading branch information
terabytesoftw authored Oct 6, 2023
1 parent dd5eefa commit 4f0d69c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ public function isStaticMethodSupported(MethodReflection $methodReflection): boo

public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope): Type
{
/** @var Name $className */
$className = $methodCall->class;
$returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();

if (!$className instanceof Name) {
return $returnType;
}

$name = $scope->resolveName($className);

$returnType = ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType();
if ($returnType instanceof ThisType) {
return new ActiveRecordObjectType($name);
}
Expand Down

0 comments on commit 4f0d69c

Please sign in to comment.