-
-
Notifications
You must be signed in to change notification settings - Fork 429
[DeadCode] Skip Class Constant used in Enum on RemoveUnusedPrivateCla… #3174
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
Conversation
|
Could you try to provide a patch for it? It seems you can check on rector-src/src/NodeManipulator/ClassConstManipulator.php Lines 28 to 31 in 863fee3
- $class = $this->betterNodeFinder->findParentType($classConst, Class_::class);
- if (! $class instanceof Class_) {
- return false;
- }since it already check on next |
|
@samsonasik Thanks for the hint, I'm already on it and will provide a fix soon. |
...adCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector/Fixture/demo_fixture.php.inc
Outdated
Show resolved
Hide resolved
...adCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector/Fixture/demo_fixture.php.inc
Outdated
Show resolved
Hide resolved
...adCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector/Fixture/demo_fixture.php.inc
Outdated
Show resolved
Hide resolved
...adCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector/Fixture/demo_fixture.php.inc
Outdated
Show resolved
Hide resolved
|
After fix applied, please rename PR title to something like: |
# Failing Test for RemoveUnusedPrivateClassConstantRector Based on https://getrector.org/demo/2333a008-e4b0-4d11-9ade-3b37412193d2
4142b1a to
763f50a
Compare
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
samsonasik
left a comment
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.
Looks good 👍
|
Thanks 🙏 |
Based on https://getrector.org/demo/2333a008-e4b0-4d11-9ade-3b37412193d2
Fixes rectorphp/rector#7651