Update Twig to v2.15.4

This commit is contained in:
slawkens
2023-02-02 10:37:45 +01:00
parent e552bcfe82
commit 130f7ba405
309 changed files with 3802 additions and 4005 deletions

View File

@@ -55,24 +55,12 @@ abstract class NodeTestCase extends TestCase
{
$line = $line > 0 ? "// line {$line}\n" : '';
if (\PHP_VERSION_ID >= 70000) {
return sprintf('%s($context["%s"] ?? null)', $line, $name);
}
if (\PHP_VERSION_ID >= 50400) {
return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name);
}
return sprintf('%s$this->getContext($context, "%s")', $line, $name);
return sprintf('%s($context["%s"] ?? null)', $line, $name);
}
protected function getAttributeGetter()
{
if (\function_exists('twig_template_get_attributes')) {
return 'twig_template_get_attributes($this, ';
}
return '$this->getAttribute(';
return 'twig_get_attribute($this->env, $this->source, ';
}
}