vendor/twig/twig/src/TokenParser/TokenParserInterface.php line 52

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 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. namespace Twig\TokenParser;
  11. use Twig\Error\SyntaxError;
  12. use Twig\Node\Node;
  13. use Twig\Parser;
  14. use Twig\Token;
  15. /**
  16. * Interface implemented by token parsers.
  17. *
  18. * @author Fabien Potencier <fabien@symfony.com>
  19. */
  20. interface TokenParserInterface
  21. {
  22. /**
  23. * Sets the parser associated with this token parser.
  24. */
  25. public function setParser(Parser $parser);
  26. /**
  27. * Parses a token and returns a node.
  28. *
  29. * @return Node
  30. *
  31. * @throws SyntaxError
  32. */
  33. public function parse(Token $token);
  34. /**
  35. * Gets the tag name associated with this token parser.
  36. *
  37. * @return string The tag name
  38. */
  39. public function getTag();
  40. }
  41. class_alias('Twig\TokenParser\TokenParserInterface', 'Twig_TokenParserInterface');
  42. // Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name.
  43. class_exists('Twig\Token');
  44. class_exists('Twig\Parser');