for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MewesK\TwigExcelBundle\Twig\TokenParser;
use MewesK\TwigExcelBundle\Twig\Node\XlsRowNode;
use Twig_Node_Expression_Constant;
use Twig_Token;
/**
* Class XlsRowTokenParser
*
* @package MewesK\TwigExcelBundle\Twig\TokenParser
*/
class XlsRowTokenParser extends AbstractTokenParser
{
* @param Twig_Token $token
* @return XlsRowNode
* @throws \Twig_Error_Syntax
public function parse(Twig_Token $token)
// parse attributes
$index = new Twig_Node_Expression_Constant(null, $token->getLine());
if (!$this->parser->getStream()->test(Twig_Token::BLOCK_END_TYPE)) {
$index = $this->parser->getExpressionParser()->parseExpression();
}
$this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
// parse body
$body = $this->parseBody();
// return node
return new XlsRowNode($index, $body, $token->getLine(), $this->getTag());
* @return string
public function getTag()
return 'xlsrow';