src/Twig/TokenParser/ComponentTokenParser.php
protected function parseArguments()
    {
        $stream = $this->parser->getStream();

        $data = null;
        $only = false;

        if ($stream->test(Twig_Token::BLOCK_END_TYPE)) {
            $stream->expect(Twig_Token::BLOCK_END_TYPE);

            return [$data, $only];
        }

        if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
            $only = true;
            $stream->next();
            $stream->expect(Twig_Token::BLOCK_END_TYPE);

            return [$data, $only];
        }

        $data = $this->parser->getExpressionParser()->parseExpression();

        if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
            $only = true;
            $stream->next();
        }

        $stream->expect(Twig_Token::BLOCK_END_TYPE);

        return [$data, $only];
    }
protected function parseArguments()
    {
        $stream = $this->parser->getStream();

        $data = null;
        $only = false;

        if ($stream->test(Twig_Token::BLOCK_END_TYPE)) {
            $stream->expect(Twig_Token::BLOCK_END_TYPE);

            return [$data, $only];
        }

        if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
            $only = true;
            $stream->next();
            $stream->expect(Twig_Token::BLOCK_END_TYPE);

            return [$data, $only];
        }

        $data = $this->parser->getExpressionParser()->parseExpression();

        if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
            $only = true;
            $stream->next();
        }

        $stream->expect(Twig_Token::BLOCK_END_TYPE);

        return [$data, $only];
    }
protected function parseArguments ( ) { $ stream = $ this -> parser -> getStream ( ) ; $ data = null ; $ only = false ; if ( $ stream -> test ( Twig_Token :: BLOCK_END_TYPE ) ) { $ stream -> expect ( Twig_Token :: BLOCK_END_TYPE ) ; return [ $ data , $ only ] ; } if ( $ stream -> test ( Twig_Token :: NAME_TYPE , 'only' ) ) { $ only = true ; $ stream -> next ( ) ; $ stream -> expect ( Twig_Token :: BLOCK_END_TYPE ) ; return [ $ data , $ only ] ; } $ data = $ this -> parser -> getExpressionParser ( ) -> parseExpression ( ) ; if ( $ stream -> test ( Twig_Token :: NAME_TYPE , 'only' ) ) { $ only = true ; $ stream -> next ( ) ; } $ stream -> expect ( Twig_Token :: BLOCK_END_TYPE ) ; return [ $ data , $ only ] ; }
Tokenizes the component stream.
@return array
Tokenizes the component stream .