blob: 02c74aa134b4f0b931950db1e216e6337cf40620 [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001<?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\Node\Node;
16use Twig\Token;
17
18/**
19 * Flushes the output to the client.
20 *
21 * @see flush()
22 *
23 * @internal
24 */
25final class FlushTokenParser extends AbstractTokenParser
26{
27 public function parse(Token $token): Node
28 {
29 $this->parser->getStream()->expect(/* Token::BLOCK_END_TYPE */ 3);
30
31 return new FlushNode($token->getLine(), $this->getTag());
32 }
33
34 public function getTag(): string
35 {
36 return 'flush';
37 }
38}