-
-
Notifications
You must be signed in to change notification settings - Fork 364
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
[DeadCode] Add RemoveUselessReturnExprInConstructRector #5158
Conversation
All checks have passed 🎉 @TomasVotruba I think it is ready. |
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.
awesome
It seems it can cause a bug if it call a method call, eg:
which should be : -return parent::__construct();
+parent::__construct();
+return; so use its Expr to Expression for that case |
Looks good 👍 Feel free to merge when ready |
I added fixture for return dynamic Expr 1e79d54 |
Implemented, I added ability to -return parent::__construct();
+parent::__construct();
+return; with |
All checks have passed 🎉 @TomasVotruba I am merging it to have faster feedback to test ;) |
👏 |
@TomasVotruba @staabm here new rule to remove useless Return Expr in construct: