mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 11:27:00 +00:00
Remove obsolete code, remove deprecations
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user