NodeVisitorInterface.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 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. * Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
  12. *
  13. * @package twig
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface Twig_NodeVisitorInterface
  17. {
  18. /**
  19. * Called before child nodes are visited.
  20. *
  21. * @param Twig_NodeInterface $node The node to visit
  22. * @param Twig_Environment $env The Twig environment instance
  23. *
  24. * @param Twig_NodeInterface The modified node
  25. */
  26. function enterNode(Twig_NodeInterface $node, Twig_Environment $env);
  27. /**
  28. * Called after child nodes are visited.
  29. *
  30. * @param Twig_NodeInterface $node The node to visit
  31. * @param Twig_Environment $env The Twig environment instance
  32. *
  33. * @param Twig_NodeInterface The modified node
  34. */
  35. function leaveNode(Twig_NodeInterface $node, Twig_Environment $env);
  36. /**
  37. * Returns the priority for this visitor.
  38. *
  39. * Priority should be between -10 and 10 (0 is the default).
  40. *
  41. * @return integer The priority level
  42. */
  43. function getPriority();
  44. }