src/ContainerParser/Parser/ServiceMethodCallParser.php
protected function next()
    {
        if (!$this->currentToken()->isType(T::TOKEN_MINUS))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        $this->skipToken();

        if (!$this->currentToken()->isType(T::TOKEN_IDENTIFIER))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        // create the node
        $call = new ServiceMethodCallNode($this->currentToken()->getValue());
        $this->skipToken();

        // we might already be done..
        if ($this->parserIsDone() || $this->currentToken()->isType(T::TOKEN_LINE))
        {
            return $call;
        }

        // otherwise we expect an opening brace
        if (!$this->currentToken()->isType(T::TOKEN_BRACE_OPEN))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        $arguments = $this->parseChild(ArgumentArrayParser::class, $this->getTokensUntilClosingScope(), false);
        $call->setArguments($arguments);

        return $call;
    }
protected function next()
    {
        if (!$this->currentToken()->isType(T::TOKEN_MINUS))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        $this->skipToken();

        if (!$this->currentToken()->isType(T::TOKEN_IDENTIFIER))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        // create the node
        $call = new ServiceMethodCallNode($this->currentToken()->getValue());
        $this->skipToken();

        // we might already be done..
        if ($this->parserIsDone() || $this->currentToken()->isType(T::TOKEN_LINE))
        {
            return $call;
        }

        // otherwise we expect an opening brace
        if (!$this->currentToken()->isType(T::TOKEN_BRACE_OPEN))
        {
            throw $this->errorUnexpectedToken($this->currentToken());
        }

        $arguments = $this->parseChild(ArgumentArrayParser::class, $this->getTokensUntilClosingScope(), false);
        $call->setArguments($arguments);

        return $call;
    }
Parse the next token

@return null|Node