예제 #1
0
 public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array())
 {
     $options['callable'] = array($extension, $method);
     parent::__construct($options);
     $this->extension = $extension;
     $this->method = $method;
 }
예제 #2
0
 public function __construct($class, array $options = [])
 {
     parent::__construct($options);
     $this->class = $class;
 }
예제 #3
0
파일: Staging.php 프로젝트: rvanlaak/Twig
 public function addTest(Twig_Test $test)
 {
     $this->tests[$test->getName()] = $test;
 }
예제 #4
0
 /**
  * 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);
 }
예제 #5
0
 public function __construct($function, array $options = array())
 {
     $options['callable'] = $function;
     parent::__construct($options);
     $this->function = $function;
 }