Skip to content
Discussion options

You must be logged in to vote

You can define Expression statement for that:

    public function getNodeTypes() : array
    {
        return [Node\Stmt\Expression::class];
    }

then, use its expr property to verify:

if ($node->expr instanceof MethodCall && $this->isName($node->expr->name, $removeMethodCall->methodName)) {
    return \PhpParser\NodeVisitor::REMOVE_NODE;
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nikophil
Comment options

@samsonasik
Comment options

@nikophil
Comment options

Answer selected by samsonasik
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