From a5c71b31025fe8c61fac76bc71d32bc239a9f503 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 18 Dec 2024 13:41:55 +0700 Subject: [PATCH] Move FunctionLike reindex under StmtsAwareInterface on NodeAttributeReIndexer --- src/Application/NodeAttributeReIndexer.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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;