Skip to content

How should I build this rule without the Parent node? #8055

Closed Answered by samsonasik
peterfox asked this question in Q&A
Discussion options

You must be logged in to vote

You can use Expression stmt instead, and replace its expr propeety, for example:

$node->expr = ...

Register Expression as node type

https://github.com/rectorphp/rector-src/blob/706be908c5d96381785128ad94cc608814aa0f35/rules/DeadCode/Rector/Expression/SimplifyMirrorAssignRector.php#L41

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@peterfox
Comment options

Answer selected by samsonasik
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants