1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-23 21:04:52 +01:00
vichan/inc/lib/Twig/SimpleTest.php

74 lines
1.4 KiB
PHP
Raw Normal View History

2013-08-01 21:20:12 +02:00
<?php
/*
* This file is part of Twig.
*
2018-05-10 12:24:53 +02:00
* (c) Fabien Potencier
2013-08-01 21:20:12 +02:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Represents a template test.
*
2018-05-10 12:24:53 +02:00
* @final
*
2013-08-01 21:20:12 +02:00
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_SimpleTest
{
protected $name;
protected $callable;
protected $options;
public function __construct($name, $callable, array $options = array())
{
$this->name = $name;
$this->callable = $callable;
$this->options = array_merge(array(
2018-05-10 12:24:53 +02:00
'is_variadic' => false,
2013-08-01 21:20:12 +02:00
'node_class' => 'Twig_Node_Expression_Test',
2018-05-10 12:24:53 +02:00
'deprecated' => false,
'alternative' => null,
2013-08-01 21:20:12 +02:00
), $options);
}
public function getName()
{
return $this->name;
}
public function getCallable()
{
return $this->callable;
}
public function getNodeClass()
{
return $this->options['node_class'];
}
2018-05-10 12:24:53 +02:00
public function isVariadic()
{
return $this->options['is_variadic'];
}
public function isDeprecated()
{
return (bool) $this->options['deprecated'];
}
public function getDeprecatedVersion()
{
return $this->options['deprecated'];
}
public function getAlternative()
{
return $this->options['alternative'];
}
2013-08-01 21:20:12 +02:00
}
2018-05-10 12:24:53 +02:00
class_alias('Twig_SimpleTest', 'Twig\TwigTest', false);