-
-
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
Remove buggy rules that depend on false condition of all class and calls analysis, to improve static reflection #5958
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TomasVotruba
force-pushed
the
no-zero
branch
4 times, most recently
from
March 23, 2021 19:35
b887783
to
6e798e8
Compare
cc @JanMikes This will make paralel much easier to implement :) |
TomasVotruba
force-pushed
the
no-zero
branch
3 times, most recently
from
March 23, 2021 20:08
18bf84e
to
2300f3e
Compare
TomasVotruba
changed the title
no zero
Remove buggy rules that depend on false condition of all class and calls analysis, to improve static reflection
Mar 23, 2021
TomasVotruba
commented
Mar 23, 2021
*/ | ||
interface ZeroCacheRectorInterface | ||
{ | ||
} |
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.
@mssimi Hey, we've finally cleanup the broken dead-code rules :) thanks for the interface, it's easier to find them now
…to process correctly
…e to resolve correctly
…ateClassConstantRector
TomasVotruba
force-pushed
the
no-zero
branch
3 times, most recently
from
March 23, 2021 21:57
4531059
to
3138e6c
Compare
Ref #2971 |
TomasVotruba
added a commit
that referenced
this pull request
Jun 10, 2024
rectorphp/rector-src@62fae6a [CodingStyle][Php80] Add join func call support on ConsistentImplodeRector (#5958)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to static reflection in Rector 0.10 #3490, the autoloading of whole project is not require anymore. On the other hand, some rules required full composer autoload of all classes.
These rules attempted to detect unused public methods, yet it's hard to determine if that is true or not. E.g. in case of magic methods without parent contract interface, Doctrine entities, controller/presenter methods, template calls of objects etc. Magical limit is too high.
This caused false positives on removed methods, privatized constants od method that were actually used.
Another bad side effect was slow performance, as whole project had to be analysed with clear-cache. In the end we didn't even used this rules on Rector itself.
One more problem: these rules cripled parallel run idea, as big amount of metadata had to be passed between runs, compared to other rules that were independent on global context of the project.
Saying that, this is out of Rector scope. It's a place for advanced too, another package or even private service.
This is concerned ~10 rules. To avoid more problems caused to Rector users, we remove them.
Feel free to re-use them, making own packages or wrapper tool. It has a potential.
Similar tool doing similar work phpdcd was deprecated couple of years go, possibly due to similar "too-magical" reason: https://github.com/sebastianbergmann/phpdcd
PHPStorm does much better job in this matter, suggesting dead methods right in the code. It's also easier to verify it there by looking for a string name of the method.
See Related Sources