Skip to content

Commit

Permalink
Move FunctionLike reindex under StmtsAwareInterface on NodeAttributeR…
Browse files Browse the repository at this point in the history
…eIndexer
  • Loading branch information
samsonasik committed Dec 18, 2024
1 parent 037cf65 commit a5c71b3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Application/NodeAttributeReIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit a5c71b3

Please sign in to comment.