Security update to Drupal 8.4.6
[yaffs-website] / vendor / twig / twig / lib / Twig / SimpleTest.php
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 /**
13  * Represents a template test.
14  *
15  * @final
16  *
17  * @author Fabien Potencier <fabien@symfony.com>
18  */
19 class Twig_SimpleTest
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
73 class_alias('Twig_SimpleTest', 'Twig\TwigTest', false);