mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 09:56:32 +00:00
Remove obsolete code
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
</testsuites>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<ini name="xdebug.mode" value="off" />
|
||||
<ini name="xdebug.overload_var_dump" value="0" />
|
||||
</php>
|
||||
<listeners>
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class EqualBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(0 === twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('==');
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class GreaterBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(1 === twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('>');
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class GreaterEqualBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(0 <= twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('>=');
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class LessBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(-1 === twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('<');
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class LessEqualBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(0 >= twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('<=');
|
||||
|
||||
@@ -15,23 +15,6 @@ use Twig\Compiler;
|
||||
|
||||
class NotEqualBinary extends AbstractBinary
|
||||
{
|
||||
public function compile(Compiler $compiler): void
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
parent::compile($compiler);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$compiler
|
||||
->raw('(0 !== twig_compare(')
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
;
|
||||
}
|
||||
|
||||
public function operator(Compiler $compiler): Compiler
|
||||
{
|
||||
return $compiler->raw('!=');
|
||||
|
||||
@@ -36,20 +36,12 @@ class NameExpression extends AbstractExpression
|
||||
if ($this->getAttribute('is_defined_test')) {
|
||||
if ($this->isSpecial()) {
|
||||
$compiler->repr(true);
|
||||
} elseif (\PHP_VERSION_ID >= 70400) {
|
||||
} else {
|
||||
$compiler
|
||||
->raw('array_key_exists(')
|
||||
->string($name)
|
||||
->raw(', $context)')
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->raw('(isset($context[')
|
||||
->string($name)
|
||||
->raw(']) || array_key_exists(')
|
||||
->string($name)
|
||||
->raw(', $context))')
|
||||
;
|
||||
}
|
||||
} elseif ($this->isSpecial()) {
|
||||
$compiler->raw($this->specialVars[$name]);
|
||||
|
||||
Reference in New Issue
Block a user