diff --git a/src/Application/NodeAttributeReIndexer.php b/src/Application/NodeAttributeReIndexer.php index da9a6c3919..7fb2b42af6 100644 --- a/src/Application/NodeAttributeReIndexer.php +++ b/src/Application/NodeAttributeReIndexer.php @@ -24,6 +24,12 @@ final class NodeAttributeReIndexer { public static function reIndexNodeAttributes(Node $node): ?Node { + if ($node instanceof CallLike) { + /** @var FuncCall|MethodCall|New_|NullsafeMethodCall|StaticCall $node */ + $node->args = array_values($node->args); + return $node; + } + if ($node instanceof FunctionLike) { /** @var ClassMethod|Function_|Closure $node */ $node->params = array_values($node->params); @@ -35,12 +41,6 @@ public static function reIndexNodeAttributes(Node $node): ?Node return $node; } - if ($node instanceof CallLike) { - /** @var FuncCall|MethodCall|New_|NullsafeMethodCall|StaticCall $node */ - $node->args = array_values($node->args); - return $node; - } - if ($node instanceof If_) { $node->elseifs = array_values($node->elseifs); return $node;