LexerInterface.php 764 B

123456789101112131415161718192021222324252627282930313233
  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 lexer classes.
  12. *
  13. * @author Fabien Potencier <fabien@symfony.com>
  14. *
  15. * @deprecated since 1.12 (to be removed in 3.0)
  16. */
  17. interface Twig_LexerInterface
  18. {
  19. /**
  20. * Tokenizes a source code.
  21. *
  22. * @param string $code The source code
  23. * @param string $filename A unique identifier for the source code
  24. *
  25. * @return Twig_TokenStream A token stream instance
  26. *
  27. * @throws Twig_Error_Syntax When the code is syntactically wrong
  28. */
  29. public function tokenize($code, $filename = null);
  30. }