addNodeBeforeNode is deprecated - What is the new way? #7790
Answered
by
TomasVotruba
Mirko-Tebaldi
asked this question in
Q&A
-
|
I am using a lot the See this: vendor/rector/rector/packages/PostRector/Collector/NodesToAddCollector.php Actually the Which is the current suggested way to prepend a node to another? |
Beta Was this translation helpful? Give feedback.
Answered by
TomasVotruba
Feb 20, 2023
Replies: 1 comment
-
|
Hi, if you want to replace 1 node with 2, just return array of 2 stmts: return [$firstStmt, $secondStmt];That will update the node tree with these 2 new nodes. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Mirko-Tebaldi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, if you want to replace 1 node with 2, just return array of 2 stmts:
That will update the node tree with these 2 new nodes.