You are here

public function Twig_TokenParserBroker::setParser in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/TokenParserBroker.php \Twig_TokenParserBroker::setParser()

Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.

Parameters

Twig_ParserInterface $parser A Twig_ParserInterface interface:

Overrides Twig_TokenParserBrokerInterface::setParser

File

vendor/Twig/TokenParserBroker.php, line 132

Class

Twig_TokenParserBroker
Default implementation of a token parser broker.

Code

public function setParser(Twig_ParserInterface $parser) {
  $this->parser = $parser;
  foreach ($this->parsers as $tokenParser) {
    $tokenParser
      ->setParser($parser);
  }
  foreach ($this->brokers as $broker) {
    $broker
      ->setParser($parser);
  }
}