Skip to content

Commit d8b4476

Browse files
committed
fix issues with array-related nodes
1 parent 77c4e59 commit d8b4476

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Searcher.php

+14
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,20 @@ protected function findReferences(array $ast, string $class, ?string $nodeNamePr
205205
return Arr::matches($name, $names, true);
206206
}
207207

208+
if ($node instanceof Node\Expr\Array_) {
209+
return false;
210+
}
211+
212+
if ($node instanceof Node\Expr\ArrayItem) {
213+
return false;
214+
}
215+
216+
if ($node instanceof Node\Expr\ArrayDimFetch) {
217+
$name = $node->var->name;
218+
219+
return Arr::matches($name, $names, true);
220+
}
221+
208222
// if ($node instanceof Node\Expr\New_) {
209223
// $name = $node->class->name->name;
210224
// }

0 commit comments

Comments
 (0)