PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/external_libraries/vendor/twig/twig/lib/Twig/TokenParser/Flush.php

https://bitbucket.org/ofpiyush/hystrix
PHP | 42 lines | 13 code | 4 blank | 25 comment | 0 complexity | b6f0a3ec7581d0414899fc50bdaad814 MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, BSD-2-Clause
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2011 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Flushes the output to the client.
  12. *
  13. * @see flush()
  14. */
  15. class Twig_TokenParser_Flush extends Twig_TokenParser
  16. {
  17. /**
  18. * Parses a token and returns a node.
  19. *
  20. * @param Twig_Token $token A Twig_Token instance
  21. *
  22. * @return Twig_NodeInterface A Twig_NodeInterface instance
  23. */
  24. public function parse(Twig_Token $token)
  25. {
  26. $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
  27. return new Twig_Node_Flush($token->getLine(), $this->getTag());
  28. }
  29. /**
  30. * Gets the tag name associated with this token parser.
  31. *
  32. * @return string The tag name
  33. */
  34. public function getTag()
  35. {
  36. return 'flush';
  37. }
  38. }