/** * Creates a method call on an object with an empty argument list. * * @param Node $object * The expression that is an object. * @param string $method_name * The name of the called method. * * @return static */ public static function create(Node $object, $method_name) { /** @var ObjectMethodCallNode $node */ $node = new static(); $node->addChild($object, 'object'); $node->addChild(Token::objectOperator(), 'operator'); $node->addChild(Token::identifier($method_name), 'methodName'); $node->addChild(Token::openParen(), 'openParen'); $node->addChild(new CommaListNode(), 'arguments'); $node->addChild(Token::closeParen(), 'closeParen'); return $node; }