Skip to content

Commit

Permalink
Improve LocalMethodCallFinder performance (#3651)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 22, 2023
1 parent d490fe5 commit 6374ccd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PhpParser/NodeFinder/LocalMethodCallFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6374ccd

Please sign in to comment.