-
-
Notifications
You must be signed in to change notification settings - Fork 673
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
Incorrect behavior of DowngradeThrowExprRector #8671
Comments
Confirmed the error https://3v4l.org/koQgQ#v7.4.33 |
Thanks @samsonasik! Do you know which version this will be released in? |
This should be included in next release, you can use dev-main while wait for that. |
@samsonasik I don't think this should run any statements twice and should instead find a way to assign a variable to a returned value? For example, I am running database queries and throwing if something went wrong, which means my queries are being run twice once the code is downgraded. Should I open a new issue? |
That's out of scope of downgrade task, more and more we tweak language origin, that may cause unwanted bug, but feel free to create PR improvement for that on CallLike in ternary, or create your own custom rule for that :) |
@defunctl Rector 1.1.1 tagged https://github.com/rectorphp/rector/releases/tag/1.1.1 |
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/f00e4092-b508-48dc-a41a-ebe1139e81a7
Responsible rules
DowngradeReadonlyPropertyRector
DowngradeReadonlyClassRector
Expected Behavior
I believe the DowngradeThrowExprRector::refactorTernary() should have been used here?
The text was updated successfully, but these errors were encountered: