-
-
Notifications
You must be signed in to change notification settings - Fork 429
feat: add RemoveReadonlyPropertyVisibilityOnReadonlyClassRector #7115
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
|
Hey, good work 👌 Last step is to register rule in the set: And apply on the codebase. Let's see what it finds here :) |
|
Sounds good---is there any preference on where the rule is added in the set? Are rules just appended or should it go near the front since it's relatively safe? |
ed995fe to
341f25b
Compare
|
Anywhere where you'd expect it. Rebase and force push make it harder for me to review new changes. Ideally keep new changes in separated commits. |
rules/CodeQuality/Rector/Class_/RemoveReadonlyPropertyVisibilityOnReadonlyClassRector.php
Show resolved
Hide resolved
rules/CodeQuality/Rector/Class_/RemoveReadonlyPropertyVisibilityOnReadonlyClassRector.php
Outdated
Show resolved
Hide resolved
rules/CodeQuality/Rector/Class_/RemoveReadonlyPropertyVisibilityOnReadonlyClassRector.php
Show resolved
Hide resolved
341f25b to
2c77a94
Compare
This Rector removes the `readonly` visibility modifier from properties in classes that are already marked as `readonly`. This is useful for cleaning up code where the `readonly` modifier is redundant due to the class's readonly status.
2c77a94 to
48d3b5c
Compare
|
Let's give it a try, thank you @calebdw |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |

Hello!
This Rector removes the
readonlyvisibility modifier from properties in classes that are already marked asreadonly. This is useful for cleaning up code where thereadonlymodifier is redundant due to the class's readonly status.Thanks!