feat: allow user to skip privatization for specific methods/properties#7144
feat: allow user to skip privatization for specific methods/properties#7144calebdw wants to merge 1 commit intorectorphp:mainfrom
Conversation
6080ae1 to
e7e268d
Compare
.../Privatization/Rector/ClassMethod/PrivatizeFinalClassMethodRector/config/configured_rule.php
Outdated
Show resolved
Hide resolved
fc92adf to
e6ceac6
Compare
1208982 to
bbfc125
Compare
bbfc125 to
5afa462
Compare
|
Hey, I'm looking into this and adding callbacks to specific rule might trigger follow PRs with adding it everywhere. Instead, this could be solved on a In this specific example, the rule could be aware of the framework magic and behave propperly. We do the same with other rules, to take burden from the user having to spam the rector.php config to rule doing what it suppose to do. Thanks for understanding 👍 |
|
Sounds good, I wasn't sure if y'all would be okay with framework specific logic in the rector itself |
|
In moderate amount, yes 😉 |
|
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!
There are occasions where final classes still need to have
protectedmethods/properties (e.g., Laravel Models and the attributes/scope methods, see larastan/larastan#2334). Instead of simply skipping all Models, it would be great if the specific methods/properties can be skipped.This PR adds the ability for the user to define a callback that is called with the property/method and the class reflection and allows the user to determine if anything should be skipped
Thanks!