private function isMethodCall(Node\Node $node, string $objectName, string $methodName): bool
    {
        if ($node instanceof Node\CallExpression) {
            $callee = $node->getCallee();

            if ($callee instanceof Node\MemberExpression) {
                $object = $callee->getObject();
                $property = $callee->getProperty();

                if ($object instanceof Node\Identifier && $property instanceof Node\Identifier) {
                    return $object->getName() === $objectName && $property->getName() === $methodName;
                }
            }
        }

        return false;
    }
private function isMethodCall(Node\Node $node, string $objectName, string $methodName): bool
    {
        if ($node instanceof Node\CallExpression) {
            $callee = $node->getCallee();

            if ($callee instanceof Node\MemberExpression) {
                $object = $callee->getObject();
                $property = $callee->getProperty();

                if ($object instanceof Node\Identifier && $property instanceof Node\Identifier) {
                    return $object->getName() === $objectName && $property->getName() === $methodName;
                }
            }
        }

        return false;
    }
private function isMethodCall ( Node \ Node $ node , string $ objectName , string $ methodName ) : bool { if ( $ node instanceof Node \ CallExpression ) { $ callee = $ node -> getCallee ( ) ; if ( $ callee instanceof Node \ MemberExpression ) { $ object = $ callee -> getObject ( ) ; $ property = $ callee -> getProperty ( ) ; if ( $ object instanceof Node \ Identifier && $ property instanceof Node \ Identifier ) { return $ object -> getName ( ) === $ objectName && $ property -> getName ( ) === $ methodName ; } } } return false ; }
Returns true if node is a method call.

@param \Peast\Syntax\Node\Node $node
@param string $objectName
@param string $methodName

@return bool
Returns true if node is a method call .