From 2eed7b082f83630301e51f57ca8394de228a8605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 18 Aug 2019 21:14:58 -0500 Subject: first commit --- .../library/template/Twig/Node/Expression/Test.php | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 public/system/library/template/Twig/Node/Expression/Test.php (limited to 'public/system/library/template/Twig/Node/Expression/Test.php') diff --git a/public/system/library/template/Twig/Node/Expression/Test.php b/public/system/library/template/Twig/Node/Expression/Test.php new file mode 100644 index 0000000..c0358c8 --- /dev/null +++ b/public/system/library/template/Twig/Node/Expression/Test.php @@ -0,0 +1,35 @@ + $node, 'arguments' => $arguments), array('name' => $name), $lineno); + } + + public function compile(Twig_Compiler $compiler) + { + $name = $this->getAttribute('name'); + $test = $compiler->getEnvironment()->getTest($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'test'); + $this->setAttribute('thing', $test); + if ($test instanceof Twig_TestCallableInterface || $test instanceof Twig_SimpleTest) { + $this->setAttribute('callable', $test->getCallable()); + } + if ($test instanceof Twig_SimpleTest) { + $this->setAttribute('is_variadic', $test->isVariadic()); + } + + $this->compileCallable($compiler); + } +} -- cgit v1.2.3