-
-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NodeRemover] Use return null after $this->removeNode() #3558
Conversation
All checks have passed 🎉 @TomasVotruba it is ready for review. |
There is already e2e test for it https://github.com/rectorphp/rector-src/blob/main/e2e/applied-rule-removed-node/expected-output.diff |
@@ -130,7 +130,7 @@ public function refactor(Node $node): ?Node | |||
|
|||
$this->removeNode($node); | |||
|
|||
return $node; | |||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part need to be rolled back as it change next func call before remove node, so it change next node data that need to be reconnected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted with add comment note for it a5944d3
All checks have passed 🎉 @TomasVotruba I am merging it ;) |
* [NodeRemover] Use return null after $this->removeNode() * return node if it try to change next node before remove * update warning message
The
removeNode()
method calls:which:
RectorWithLineChange
vianotifyNodeFileInfo()