-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
General pretty printing guidance #6146
Comments
Hi, thanks for reporting. The Could you provide minimal failing code snippet that is causing it? https://getrector.org/demo |
I'm not able to reproduce there but I should mention I'm using the prefixed build (RectorPrefix20210414). |
I tried reproducing with a fresh composer.json with the prefixed build and was again unable to reproduce so there must be something funny with my dependencies. Any ideas for troubleshooting? |
Hi, I would copy paste the latest patch version from your test repository to you main repository. E.g. -rector/rector:^0.10
+rector/rector:^0.10.5 for all other packages too |
I believe I'm able to reproduce now... composer.json
app/ThingTest.php
rector.php
Output:
|
I see, thanks for tests. I've added a test fixture to NormalizeNamespaceByPSR4ComposerAutoloadRector |
Fixed in #6159 👍 |
Thanks @TomasVotruba BTW would you happen to know of a fixer that will replace a fqn with a class name if it's imported? I.e. after rector process runs it seems like all class names are replaced with the FQN even if the class is imported. |
Try auto import parameter |
rectorphp/rector-src@a9ddf8f [Reflection] Clean up unnecessary loop parents on ReflectionResolver (#6146)
Question
I saw the part of the readme with a link to your ecs.php and tried it out, but it didn't fix most of the unwanted changes and added more. Do you know of a fixer that will remove leading slashes on global functions and things like parent, and true? Do you know of a fixer that will replace a fqn with a class name if it's imported? It would be really great to provide a minimal ecs config that fixes common things php parser changes, maybe that's impossible.
The text was updated successfully, but these errors were encountered: