8000 minor #21030 [TwigBridge] fix Twig 2.x compatibility (xabbuh) · symfony/symfony@7fa18ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 7fa18ba

Browse files
committed
minor #21030 [TwigBridge] fix Twig 2.x compatibility (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [TwigBridge] fix Twig 2.x compatibility | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | twigphp/Twig#2302 | License | MIT | Doc PR | Commits ------- 08e5747 [TwigBridge] fix Twig 2.x compatibility
2 parents d559e26 + 08e5747 commit 7fa18ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function getVariableGetterWithoutStrictCheck($name)
5353
protected function getVariableGetterWithStrictCheck($name)
5454
{
5555
if (\Twig_Environment::MAJOR_VERSION >= 2) {
56-
return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : $this->notFound("%s", 0))', $name, $name, $name, $name);
56+
return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%s" does not exist.\', 0, $this->getSourceContext()); })())', $name, $name, $name, $name);
5757
}
5858

5959
if (PHP_VERSION_ID >= 70000) {

0 commit comments

Comments
 (0)
0