-
-
Notifications
You must be signed in to change notification settings - Fork 356
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
Revert "[Printer] Remove AlwaysRememberedExpr check on BetterStandardPrinter" #6517
Conversation
…Printer …" This reverts commit bd59f6b.
This bug will return for sure if you don't do what I tell you:
This is PHPStan's Printer class: https://github.com/phpstan/phpstan-src/blob/2.0.x/src/Node/Printer/Printer.php |
@ondrejmirtes, @TomasVotruba don't want to extends PHPStan printer, see discussion of it #4305 (review) |
Also, as |
I could un-final it in PHPStan. I want to be free to add more virtual nodes in PHPStan. Rector will inevitably break in the future because of this. |
I will let @TomasVotruba decide, we have node visitor which unwrap
that called after rector-src/src/NodeTypeResolver/PHPStan/Scope/PHPStanNodeScopeResolver.php Lines 297 to 306 in 8d33d50
this works well, until on specific circumtance, it somehow overlapped with what PHPStan apply during scan process, so this failsafe check instanceof rector-src/src/PhpParser/Printer/BetterStandardPrinter.php Lines 117 to 119 in 8d33d50
that's can't be tested with unit test unfortunatelly. |
We can give it a try :) we'll choose whichever option causes less maintenance |
@ondrejmirtes I tried it, it seems after
see PR: |
Sorry for mystifying here, the Printer class from PHPStan isn't usable for you. Making it final again. |
Reverts #6484
Ref rectorphp/rector#8815 (comment)