diff --git a/src/Application/NodeAttributeReIndexer.php b/src/Application/NodeAttributeReIndexer.php index 21c70876fe..9149f9b4d9 100644 --- a/src/Application/NodeAttributeReIndexer.php +++ b/src/Application/NodeAttributeReIndexer.php @@ -40,6 +40,17 @@ public static function reIndexNodeAttributes(Node $node): ?Node return $node; } + if ($node instanceof FunctionLike) { + /** @var ClassMethod|Function_|Closure $node */ + $node->params = array_values($node->params); + + if ($node instanceof Closure) { + $node->uses = array_values($node->uses); + } + + return $node; + } + return $node; } @@ -49,17 +60,6 @@ public static function reIndexNodeAttributes(Node $node): ?Node return $node; } - if ($node instanceof FunctionLike) { - /** @var ClassMethod|Function_|Closure $node */ - $node->params = array_values($node->params); - - if ($node instanceof Closure) { - $node->uses = array_values($node->uses); - } - - return $node; - } - if ($node instanceof Switch_) { $node->cases = array_values($node->cases); return $node;