thrownew\LogicException('getTokenParsers() must return an array of \Twig\TokenParser\TokenParserInterface.');
}
$this->parsers[$parser->getTag()]=$parser;
}
// node visitors
foreach($extension->getNodeVisitors()as$visitor){
$this->visitors[]=$visitor;
}
// operators
if($operators=$extension->getOperators()){
if(!\is_array($operators)){
thrownew\InvalidArgumentException(\sprintf('"%s::getOperators()" must return an array with operators, got "%s".',\get_class($extension),\is_object($operators)?\get_class($operators):\gettype($operators).(\is_resource($operators)?'':'#'.$operators)));
}
if(2!==\count($operators)){
thrownew\InvalidArgumentException(\sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.',\get_class($extension),\count($operators)));