src/ContainerParser/Parser/ReferenceParser.php
protected function next()
    { 
        $token = $this->currentToken();

        // get the current value and remove the prefix
        $name = $token->getValue();
        $name = substr($name, 1);

        // is parameter reference
        if ($token->isType(T::TOKEN_PARAMETER)) 
        {
            return new ParameterReferenceNode($name);
        }

        // is dependency reference
        elseif ($token->isType(T::TOKEN_DEPENDENCY)) 
        {
            return new ServiceReferenceNode($name);
        }

        // anything else?
        else 
        {
            throw $this->errorUnexpectedToken($token);
        }
    }
protected function next()
    { 
        $token = $this->currentToken();

        // get the current value and remove the prefix
        $name = $token->getValue();
        $name = substr($name, 1);

        // is parameter reference
        if ($token->isType(T::TOKEN_PARAMETER)) 
        {
            return new ParameterReferenceNode($name);
        }

        // is dependency reference
        elseif ($token->isType(T::TOKEN_DEPENDENCY)) 
        {
            return new ServiceReferenceNode($name);
        }

        // anything else?
        else 
        {
            throw $this->errorUnexpectedToken($token);
        }
    }
Parse the next token

@return null|Node