Replies: 1 comment 1 reply
-
Hi, that sounds interested and I'd use it myself. E.g. to finalize all controllers or add return type declaratoins there. The config registration might not work, as rule is a service registered in the whole project. Could you come up with a POC PR? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Something I think would be useful is to have the ability to apply rules but in a more limited scope.
For instance. Maybe I have a rule to make classes Final, but I don't want to apply it to all classes but classes extending a certain other class. But I would like to enforce that all classes that extend another particular class are made Final. I could enforce this by PHPStan or another tool but ultimately a more useful situation would be to have Rector do the work automatically. At current, I would have to do either:
I'm thinking in the config we could have:
One of the things I feel is missing a bit from working on many of the Laravel rules I've created is configuration can be difficult as it's hard to predict new and interesting ways Rules could be used. It works for Upgrading projects but less so for regular integration.
Beta Was this translation helpful? Give feedback.
All reactions