Skip to content
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

[CodeQuality] Allow transform static to self on final class on ConvertStaticPrivateConstantToSelfRector #6295

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Sep 7, 2024

On non-final class, it only works on private constant, see

https://3v4l.org/rPYm0 vs https://3v4l.org/80571

This rule currently only works on private constant https://getrector.com/demo/5c3ff3fc-8b61-45d1-acab-2bb3f974f3af

On Final class, it can actually should works on private, protected, and public as no child to read:

see https://3v4l.org/7TGlv

so this PR add this ability

Closes rectorphp/rector#8818

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Member Author

@TomasVotruba let's merge 👍

@samsonasik samsonasik merged commit 1ebb7aa into main Sep 8, 2024
36 checks passed
@samsonasik samsonasik deleted the allow-final-class branch September 8, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CodeQuality] Add new rule to change "static::CONSTANT" to "self::CONSTANT"
1 participant