struggling with my first rule #8785
-
See also #8784 QuestionI'm trying to change some code like that: use \Namespace\ClassD;
ClassD::getA();
ClassD::getA(1,2,3); to this: use \Namespace\ClassC;
ClassC::getB()->getValue();
ClassC::getB()->getValue(1, null, 2,3); I tried to change Any pointers for the smallest possible solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ref original answer #8784 (comment) so no need write down answer. First, apply rename class + method + auto import https://getrector.com/demo/a38638ff-7f36-4b24-9d49-dc7a9daaff80 per AST structure at https://getrector.com/ast/a4686a7810518c6c740f126e056bdb77c39b4847 You can use MethodCall, which verify its |
Beta Was this translation helpful? Give feedback.
Ref original answer #8784 (comment) so no need write down answer.
First, apply rename class + method + auto import https://getrector.com/demo/a38638ff-7f36-4b24-9d49-dc7a9daaff80
per AST structure at https://getrector.com/ast/a4686a7810518c6c740f126e056bdb77c39b4847
You can use MethodCall, which verify its
var
isStaticCall
, it read from the back to front to verify it, then you can change/insert new Arg between.