Move beforeTraverse() to global Node since beforeTraverse() not overrideable#443
Conversation
|
@GeniJaho @driftingly @peterfox Ready to merge 👍 after this PR merged, I think new immediate release is needed so next composer update when sometime rector released new version, there will be less to no regression as possible :) |
|
For note: after next rector release, which new This PR ensure keep work first whenever next rector release anytime soon when we are may not available to immediatelly patch :) |
|
@GeniJaho @driftingly @peterfox I've bumped to latest rector ^2.2.13 and fix compatible code:
Ready to merge and this needs immediate new release :) |
|
Looks good. I'm wandering if what we need is a mechanism where a default config is loaded with the Laravel Package or the package has it's own Config object at this point that preloads a few things. Then we could use NodeVisitors. This will be good to resolve the current situation. |
|
There is default config: https://github.com/driftingly/rector-laravel/blob/main/config/config.php already included in sets, but then user that only want to use single rule and done, will require manually include it, that's another step for user. |
since
beforeTraverse()become final,the use of beforeTraverse here is invalid,
Using custom node visitor is not ideal for shareable rules, since user then need another step to register visitor, this PR make it keep working automatically, by register on global
Nodeearly on the particular rules that requires set attributes.