public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array()) { $options['callable'] = array($extension, $method); parent::__construct($options); $this->extension = $extension; $this->method = $method; }
public function __construct($class, array $options = []) { parent::__construct($options); $this->class = $class; }
public function addTest(Twig_Test $test) { $this->tests[$test->getName()] = $test; }
/** * Registers a Test. * * @param Twig_Test $test A Twig_Test instance */ public function addTest(Twig_Test $test) { if ($this->extensionInitialized) { throw new LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $test->getName())); } $this->staging->addTest($test); }
public function __construct($function, array $options = array()) { $options['callable'] = $function; parent::__construct($options); $this->function = $function; }