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