-
-
Notifications
You must be signed in to change notification settings - Fork 705
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
struggling with my first rule #8784
Comments
First, there is RenameClassRector + auto import with remove unused import for that + RenameMethodRector https://getrector.com/demo/a38638ff-7f36-4b24-9d49-dc7a9daaff80 then after that, you can create custom rule to inject argument in the middle on |
Thanks, that brings me a bit further.
Hm, I tried that but probably What about the extra
|
You can learn about Node structure at AST page https://getrector.com/ast For example https://getrector.com/ast/a4686a7810518c6c740f126e056bdb77c39b4847 , I renamed namespace named "Namespace" to "Some" for demo due to namespace is php syntax to avoid error. |
Sure, but since this is a support issue the quick closure is not that helpful as it leaves me (the user) hanging with just too little information. I tried different ways but so far I still need some time to grasp the whole logic. It's great that you are that quick, but it would be better to take some time to give a complete answer. |
Learning AST requires time, and be slow is the way to go :) On another chance , use discusion instead of issue https://github.com/rectorphp/rector/discussions/categories/q-a :) |
Question
I'm trying to change some code like that:
to this:
I tried to change
name
andclass
ofStaticCall::class
but I can not get the args. And I don't know how to change or add theuse
statement.any pointers for the smallest possible solution?
The text was updated successfully, but these errors were encountered: