diff --git a/rules-tests/Php56/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector/Fixture/skip_variable_variable.php.inc b/rules-tests/Php56/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector/Fixture/skip_variable_variable.php.inc new file mode 100644 index 00000000000..4b6ec650d3b --- /dev/null +++ b/rules-tests/Php56/Rector/FunctionLike/AddDefaultValueForUndefinedVariableRector/Fixture/skip_variable_variable.php.inc @@ -0,0 +1,13 @@ +name instanceof Variable) { + return NodeTraverser::STOP_TRAVERSAL; + } + if ($node->getAttribute(AttributeKey::IS_BEING_ASSIGNED) === true) { return null; } @@ -215,11 +220,6 @@ private function shouldSkipVariable(Variable $variable, string $variableName, ar return true; } - $checkedVariables = array_filter( - $checkedVariables, - static fn (string $variableName): bool => $variableName !== '' - ); - return in_array($variableName, $checkedVariables, true); }