CustomRule How to replace one node with multiple statements? #7623
Unanswered
alexander-schranz
asked this question in
Q&A
Replies: 1 comment 6 replies
-
Hi, you can replace single stmts with multiple stmts: public function refactor(Node $node)
{
$node = ...;
// ...
return [$newStmt, $secondNewStmt];
} |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to replace a single methodCall inside a static function with multiple stmts.
I already have all new
stmts
inside an array. But I'm no sure how I can replace a Node with this new statments.Beta Was this translation helpful? Give feedback.
All reactions