vendor/twig/twig/src/Extension/ExtensionInterface.php line 73

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\Extension;
  11. use Twig\NodeVisitor\NodeVisitorInterface;
  12. use Twig\TokenParser\TokenParserInterface;
  13. use Twig\TwigFilter;
  14. use Twig\TwigFunction;
  15. use Twig\TwigTest;
  16. /**
  17. * Interface implemented by extension classes.
  18. *
  19. * @author Fabien Potencier <fabien@symfony.com>
  20. */
  21. interface ExtensionInterface
  22. {
  23. /**
  24. * Returns the token parser instances to add to the existing list.
  25. *
  26. * @return TokenParserInterface[]
  27. */
  28. public function getTokenParsers();
  29. /**
  30. * Returns the node visitor instances to add to the existing list.
  31. *
  32. * @return NodeVisitorInterface[]
  33. */
  34. public function getNodeVisitors();
  35. /**
  36. * Returns a list of filters to add to the existing list.
  37. *
  38. * @return TwigFilter[]
  39. */
  40. public function getFilters();
  41. /**
  42. * Returns a list of tests to add to the existing list.
  43. *
  44. * @return TwigTest[]
  45. */
  46. public function getTests();
  47. /**
  48. * Returns a list of functions to add to the existing list.
  49. *
  50. * @return TwigFunction[]
  51. */
  52. public function getFunctions();
  53. /**
  54. * Returns a list of operators to add to the existing list.
  55. *
  56. * @return array<array> First array of unary operators, second array of binary operators
  57. */
  58. public function getOperators();
  59. }
  60. class_alias('Twig\Extension\ExtensionInterface', 'Twig_ExtensionInterface');
  61. // Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name.
  62. class_exists('Twig\Environment');