Skip to content

Commit a064b12

Browse files
committed
fix bug with resolving static method call names
1 parent 25de0c4 commit a064b12

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/Support/NameResolver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ public static function resolve($node)
3737
}
3838

3939
if ($node instanceof Node\Expr\StaticCall) {
40+
$name = $node->name->toString();
41+
$class = $node->class->getType();
4042
return [$class, "{$class}::{$name}"];
4143
}
4244

src/Visitors/StaticCallVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(FileSearchResults $results, array $names)
2424
public function enterNode(Node $node)
2525
{
2626
if ($node instanceof Node\Expr\StaticCall) {
27-
$name = $node->class->toString();
27+
$name = $node->class->getType();
2828
$methodName = $node->name->toString();
2929

3030
if (Arr::matches($name, $this->names, true) || Arr::matches("{$name}::{$methodName}", $this->names, true)) {

0 commit comments

Comments
 (0)