Skip to content

Commit

Permalink
[Core] No need reindex FileWithoutNamespace on beforeTraverse (#4043)
Browse files Browse the repository at this point in the history
Since reindex happen even on reprint PR:

- #4030

FileWithoutNamespace seems no longer need reindex. 

Left namespace part as it can have declare before it, or multi namespace.
  • Loading branch information
samsonasik committed Jun 2, 2023
1 parent 495900a commit 90b1f9f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Rector/AbstractRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,7 @@ public function beforeTraverse(array $nodes): ?array
if (! $childStmt instanceof FileWithoutNamespace) {
$childStmt->setAttribute(AttributeKey::STMT_KEY, $key);
continue;
}

foreach ($childStmt->stmts as $keyChildStmt => $childStmtStmt) {
$childStmtStmt->setAttribute(AttributeKey::STMT_KEY, $keyChildStmt);
}
}
}

return parent::beforeTraverse($nodes);
Expand Down

0 comments on commit 90b1f9f

Please sign in to comment.