ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Method.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12@trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use Twig_SimpleTest instead.', E_USER_DEPRECATED);
13
22{
23 protected $extension;
24 protected $method;
25
27 {
28 $options['callable'] = array($extension, $method);
29
30 parent::__construct($options);
31
32 $this->extension = $extension;
33 $this->method = $method;
34 }
35
36 public function compile()
37 {
38 return sprintf('$this->env->getExtension(\'%s\')->%s', get_class($this->extension), $this->method);
39 }
40}
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Represents a method template test.
Definition: Method.php:22
compile()
Compiles a test.
Definition: Method.php:36
__construct(Twig_ExtensionInterface $extension, $method, array $options=array())
Definition: Method.php:26
Represents a template test.
Definition: Test.php:22
$options
Definition: Test.php:23
Interface implemented by extension classes.