| Conditions | 4 |
| Paths | 4 |
| Total Lines | 27 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function parse(Twig_Token $token) |
||
| 21 | { |
||
| 22 | $stream = $this->parser->getStream(); |
||
| 23 | $exprParser = $this->parser->getExpressionParser(); |
||
| 24 | |||
| 25 | $typesExpr = null; |
||
| 26 | if (!$stream->test(Twig_Token::NAME_TYPE, 'using') && !$stream->test(Twig_Token::BLOCK_END_TYPE)) { |
||
| 27 | $typesExpr = $exprParser->parseExpression(); |
||
| 28 | } |
||
| 29 | |||
| 30 | $catalogExpr = null; |
||
| 31 | |||
| 32 | if ($stream->test(Twig_Token::NAME_TYPE, 'using')) { |
||
| 33 | $stream->expect(Twig_Token::NAME_TYPE, 'using'); |
||
| 34 | $stream->expect(Twig_Token::NAME_TYPE, 'catalog'); |
||
| 35 | |||
| 36 | $catalogExpr = $exprParser->parseExpression(); |
||
| 37 | } |
||
| 38 | |||
| 39 | $stream->expect(Twig_Token::BLOCK_END_TYPE); |
||
| 40 | |||
| 41 | $body = $this->parser->subparse(array($this, 'isEndTag'), true); |
||
| 42 | |||
| 43 | $stream->expect(Twig_Token::BLOCK_END_TYPE); |
||
| 44 | |||
| 45 | return $this->nodeFactory->createFlashesNode($typesExpr, $catalogExpr, $body, $token->getLine()); |
||
| 46 | } |
||
| 47 | |||
| 58 |