ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SimpleTest.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
20{
21 protected $name;
22 protected $callable;
23 protected $options;
24
25 public function __construct($name, $callable, array $options = array())
26 {
27 $this->name = $name;
28 $this->callable = $callable;
29 $this->options = array_merge(array(
30 'is_variadic' => false,
31 'node_class' => 'Twig_Node_Expression_Test',
32 'deprecated' => false,
33 'alternative' => null,
34 ), $options);
35 }
36
37 public function getName()
38 {
39 return $this->name;
40 }
41
42 public function getCallable()
43 {
44 return $this->callable;
45 }
46
47 public function getNodeClass()
48 {
49 return $this->options['node_class'];
50 }
51
52 public function isVariadic()
53 {
54 return $this->options['is_variadic'];
55 }
56
57 public function isDeprecated()
58 {
59 return (bool) $this->options['deprecated'];
60 }
61
62 public function getDeprecatedVersion()
63 {
64 return $this->options['deprecated'];
65 }
66
67 public function getAlternative()
68 {
69 return $this->options['alternative'];
70 }
71}
72
73class_alias('Twig_SimpleTest', 'Twig\TwigTest', false);
An exception for terminatinating execution or to throw for unit testing.
Represents a template test.
Definition: SimpleTest.php:20
__construct($name, $callable, array $options=array())
Definition: SimpleTest.php:25