protected function getTagAttributes()
    {
        $stream = $this->parser->getStream();
        $attributes = [];
        $lineno = $stream->getCurrent()->getLine();
        $name = $stream->getSourceContext()->getName();

        if (!$stream->test(Token::BLOCK_END_TYPE)) {
            do {
                $this->validateAttributeType($stream, 'name', ['NAME', 'STRING']);
                $attr = $stream->getCurrent()->getValue();
                $stream->next();
                $this->validateAttributeOperator($stream, $attr);
                $stream->next();
                $this->validateAttributeType($stream, 'value', ['NAME', 'STRING', 'NUMBER']);

                $attributes[$attr] = $this->parser->getExpressionParser()->parseExpression()->getAttribute('value');
            } while (!$stream->test(Token::BLOCK_END_TYPE));
        }

        return $this->formatAttributes($attributes, $lineno, $name);
    }
protected function getTagAttributes()
    {
        $stream = $this->parser->getStream();
        $attributes = [];
        $lineno = $stream->getCurrent()->getLine();
        $name = $stream->getSourceContext()->getName();

        if (!$stream->test(Token::BLOCK_END_TYPE)) {
            do {
                $this->validateAttributeType($stream, 'name', ['NAME', 'STRING']);
                $attr = $stream->getCurrent()->getValue();
                $stream->next();
                $this->validateAttributeOperator($stream, $attr);
                $stream->next();
                $this->validateAttributeType($stream, 'value', ['NAME', 'STRING', 'NUMBER']);

                $attributes[$attr] = $this->parser->getExpressionParser()->parseExpression()->getAttribute('value');
            } while (!$stream->test(Token::BLOCK_END_TYPE));
        }

        return $this->formatAttributes($attributes, $lineno, $name);
    }
protected function getTagAttributes ( ) { $ stream = $ this -> parser -> getStream ( ) ; $ attributes = [ ] ; $ lineno = $ stream -> getCurrent ( ) -> getLine ( ) ; $ name = $ stream -> getSourceContext ( ) -> getName ( ) ; if ( ! $ stream -> test ( Token :: BLOCK_END_TYPE ) ) { do { $ this -> validateAttributeType ( $ stream , 'name' , [ 'NAME' , 'STRING' ] ) ; $ attr = $ stream -> getCurrent ( ) -> getValue ( ) ; $ stream -> next ( ) ; $ this -> validateAttributeOperator ( $ stream , $ attr ) ; $ stream -> next ( ) ; $ this -> validateAttributeType ( $ stream , 'value' , [ 'NAME' , 'STRING' , 'NUMBER' ] ) ; $ attributes [ $ attr ] = $ this -> parser -> getExpressionParser ( ) -> parseExpression ( ) -> getAttribute ( 'value' ) ; } while ( ! $ stream -> test ( Token :: BLOCK_END_TYPE ) ) ; } return $ this -> formatAttributes ( $ attributes , $ lineno , $ name ) ; }
Gets the attributes of the twig tag.

@throws SyntaxError When the attribute does not exist
@throws SyntaxError When the attribute is not followed by "=" operator

@return array The tag attributes
Gets the attributes of the twig tag .