Skip to content

Commit

Permalink
Add early return on NodeAttributeReIndexer
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 18, 2024
1 parent 9a8e59b commit ba2ca77
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Application/NodeAttributeReIndexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit ba2ca77

Please sign in to comment.