diff --git a/src/PhpParser/NodeFinder/LocalMethodCallFinder.php b/src/PhpParser/NodeFinder/LocalMethodCallFinder.php index 4c7af831a08..72b44c91313 100644 --- a/src/PhpParser/NodeFinder/LocalMethodCallFinder.php +++ b/src/PhpParser/NodeFinder/LocalMethodCallFinder.php @@ -44,16 +44,16 @@ public function match(ClassMethod $classMethod): array $matchingMethodCalls = []; foreach ($methodCalls as $methodCall) { - $callerType = $this->nodeTypeResolver->getType($methodCall->var); - if (! $callerType instanceof TypeWithClassName) { + if (! $this->nodeNameResolver->isName($methodCall->name, $classMethodName)) { continue; } - if ($callerType->getClassName() !== $className) { + $callerType = $this->nodeTypeResolver->getType($methodCall->var); + if (! $callerType instanceof TypeWithClassName) { continue; } - if (! $this->nodeNameResolver->isName($methodCall->name, $classMethodName)) { + if ($callerType->getClassName() !== $className) { continue; }