TokenParserBrokerInterface.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2010 Fabien Potencier
  6. * (c) 2010 Arnaud Le Blanc
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. /**
  12. * Interface implemented by token parser brokers.
  13. *
  14. * Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name.
  15. *
  16. * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
  17. *
  18. * @deprecated since 1.12 (to be removed in 2.0)
  19. */
  20. interface Twig_TokenParserBrokerInterface
  21. {
  22. /**
  23. * Gets a TokenParser suitable for a tag.
  24. *
  25. * @param string $tag A tag name
  26. *
  27. * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found
  28. */
  29. public function getTokenParser($tag);
  30. /**
  31. * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.
  32. *
  33. * @param Twig_ParserInterface $parser A Twig_ParserInterface interface
  34. */
  35. public function setParser(Twig_ParserInterface $parser);
  36. /**
  37. * Gets the Twig_ParserInterface.
  38. *
  39. * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null
  40. */
  41. public function getParser();
  42. }