You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's expected, you can't use NodeTraverser::REMOVE_NODE directly under refactor() on Expr, you need to remove the whole Expression stmt, something like:
Bug Report
Cannot remove includes and requires from files. I wrote a rule that removes any includes and requires. When I run, I get the next error:
There are next issues already:
But they don't seem to help. I've tried to make workarounds like overriding supermethods to access parent nodes
Minimal PHP Code Causing Issue
https://getrector.com/demo/d14e8e14-3157-43da-8d9c-c3aa3c9ee4e8
Expected Behaviour
Rector should remove node when
NodeTraverser::REMOVE_NODE
is returned from therefactor(Node $node)
methodThe text was updated successfully, but these errors were encountered: