CompilerInterface.php 741B

123456789101112131415161718192021222324252627282930313233343536
  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. * Interface implemented by compiler classes.
  12. *
  13. * @package twig
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. interface Twig_CompilerInterface
  17. {
  18. /**
  19. * Compiles a node.
  20. *
  21. * @param Twig_NodeInterface $node The node to compile
  22. *
  23. * @return Twig_CompilerInterface The current compiler instance
  24. */
  25. function compile(Twig_NodeInterface $node);
  26. /**
  27. * Gets the current PHP code after compilation.
  28. *
  29. * @return string The PHP code
  30. */
  31. function getSource();
  32. }