Skip to content

Commit b84fe95

Browse files
authored
[Php56] Reduce origNode check on UndefinedVariableResolver (#4033)
1 parent 73c1ac4 commit b84fe95

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

rules/Php56/NodeAnalyzer/UndefinedVariableResolver.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,14 @@ public function resolve(ClassMethod | Function_ | Closure $node): array
5757
): ?int {
5858
// entering new scope - break!
5959
if ($node instanceof FunctionLike && ! $node instanceof ArrowFunction) {
60-
return NodeTraverser::STOP_TRAVERSAL;
60+
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
6161
}
6262

6363
if ($node instanceof Foreach_) {
6464
// handled above
6565
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
6666
}
6767

68-
/**
69-
* The Node that doesn't have origNode attribute yet
70-
* means the Node is a replacement below other changed node
71-
*/
72-
if (! $node->hasAttribute(AttributeKey::ORIGINAL_NODE)) {
73-
return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
74-
}
75-
7668
if (! $node instanceof Variable) {
7769
return null;
7870
}

0 commit comments

Comments
 (0)