getLine(); $stream = $this->parser->getStream(); if ($token = $stream->nextIf(TwigToken::NAME_TYPE)) { $name = $token->getValue(); } else { $name = 'all'; } $stream->expect(TwigToken::BLOCK_END_TYPE); $body = $this->parser->subparse([$this, 'decideIfEnd'], true); $stream->expect(TwigToken::BLOCK_END_TYPE); return new FlashNode($name, $body, $lineno, $this->getTag()); } public function decideIfEnd(TwigToken $token) { return $token->test(['endflash']); } /** * Gets the tag name associated with this token parser. * * @return string The tag name */ public function getTag() { return 'flash'; } }