Remove obsolete code, remove deprecations

This commit is contained in:
Fabien Potencier
2024-10-24 08:09:33 +02:00
parent ef63506239
commit 4698d15b8e
24 changed files with 180 additions and 267 deletions
+2 -17
View File
@@ -20,13 +20,8 @@ use Twig\Loader\ArrayLoader;
use Twig\Node\Expression\ArrayExpression;
use Twig\Node\Expression\Binary\ConcatBinary;
use Twig\Node\Expression\ConstantExpression;
use Twig\Node\Expression\NameExpression;
use Twig\Node\Expression\Unary\SpreadUnary;
use Twig\Node\Expression\FilterExpression;
use Twig\Node\Expression\FunctionExpression;
use Twig\Node\Expression\TestExpression;
use Twig\Node\Expression\Variable\ContextVariable;
use Twig\Node\Node;
use Twig\Parser;
use Twig\Source;
use Twig\TwigFilter;
@@ -183,7 +178,7 @@ class ExpressionParserTest extends TestCase
new ConstantExpression(2, 1),
new ConstantExpression(2, 1),
self::createContextVariable(new SpreadUnary(new NameExpression('foo', 1), 1)),
new SpreadUnary(new ContextVariable('foo', 1), 1),
], 1)],
// mapping with spread operator
@@ -196,7 +191,7 @@ class ExpressionParserTest extends TestCase
new ConstantExpression('c', 1),
new ConstantExpression(0, 1),
self::createContextVariable(new SpreadUnary(new NameExpression('otherLetters', 1), 1)),
new SpreadUnary(new ContextVariable('otherLetters', 1), 1),
], 1)],
];
}
@@ -445,14 +440,4 @@ class ExpressionParserTest extends TestCase
$parser->parse($env->tokenize(new Source('{{ 1 is empty element }}', 'index')));
$this->expectNotToPerformAssertions();
}
private static function createContextVariable(string $name, array $attributes): ContextVariable
{
$expression = new ContextVariable($name, 1);
foreach ($attributes as $key => $value) {
$expression->setAttribute($key, $value);
}
return $expression;
}
}