[internal] Remove duplicated enterNode() type check already handled in node traverser#7717
Merged
TomasVotruba merged 3 commits intomainfrom Dec 20, 2025
Merged
[internal] Remove duplicated enterNode() type check already handled in node traverser#7717TomasVotruba merged 3 commits intomainfrom
TomasVotruba merged 3 commits intomainfrom
Conversation
3de9554 to
aebf87d
Compare
0df59c0 to
5c6e366
Compare
5c6e366 to
0d19560
Compare
1ca80a3 to
0307acf
Compare
samsonasik
reviewed
Dec 20, 2025
samsonasik
reviewed
Dec 20, 2025
ee4c440 to
99998f1
Compare
Member
Author
|
Let's give this a go 👍 |
samsonasik
reviewed
Dec 21, 2025
samsonasik
reviewed
Dec 22, 2025
Comment on lines
+116
to
+117
| // stop traversing as node type changed and visitors won't work | ||
| return; |
Member
There was a problem hiding this comment.
I think this should continue 2; as well, as currentNodeVisitors is inside inner loop, so next subnode should also allow to be visited, to ensure nothing left behind, while keep the performance :)
Member
There was a problem hiding this comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When Rector traversers nodes, it only applies related rules. E.g. when a rule hooks into
Class_, its only run on aClass_node. This already happens in a node visitor since #6232Yet, we still have a duplicate check on every single node enter:
This is redundant and now removed 👍