public function leaveNode(Node $node)
    {
        $filter = $this->filter;

        if (! $node instanceof ClassMethod || null === ($filterResult = $filter($node))) {
            return null;
        }

        if (false === $filterResult) {
            return false;
        }

        $node->stmts = array(
            new Throw_(
                new New_(
                    new FullyQualified('BadMethodCallException'),
                    array(new Arg(new String_('Method is disabled')))
                )
            )
        );

        return $node;
    }
public function leaveNode(Node $node)
    {
        $filter = $this->filter;

        if (! $node instanceof ClassMethod || null === ($filterResult = $filter($node))) {
            return null;
        }

        if (false === $filterResult) {
            return false;
        }

        $node->stmts = array(
            new Throw_(
                new New_(
                    new FullyQualified('BadMethodCallException'),
                    array(new Arg(new String_('Method is disabled')))
                )
            )
        );

        return $node;
    }
public function leaveNode ( Node $ node ) { $ filter = $ this -> filter ; if ( ! $ node instanceof ClassMethod || null === ( $ filterResult = $ filter ( $ node ) ) ) { return null ; } if ( false === $ filterResult ) { return false ; } $ node -> stmts = array ( new Throw_ ( new New_ ( new FullyQualified ( 'BadMethodCallException' ) , array ( new Arg ( new String_ ( 'Method is disabled' ) ) ) ) ) ) ; return $ node ; }
Replaces the given node if it is a class method and matches according to the given callback

@param \PhpParser\Node $node

@return bool|null|\PhpParser\Node\Stmt\ClassMethod
Replaces the given node if it is a class method and matches according to the given callback