1<?php 2 3/* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace Twig\TokenParser; 13 14use Twig\Node\FlushNode; 15use Twig\Token; 16 17/** 18 * Flushes the output to the client. 19 * 20 * @see flush() 21 * 22 * @final 23 */ 24class FlushTokenParser extends AbstractTokenParser 25{ 26 public function parse(Token $token) 27 { 28 $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); 29 30 return new FlushNode($token->getLine(), $this->getTag()); 31 } 32 33 public function getTag() 34 { 35 return 'flush'; 36 } 37} 38 39class_alias('Twig\TokenParser\FlushTokenParser', 'Twig_TokenParser_Flush'); 40