From 08e5747ce1882685a08a118132f5edf699d75454 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 23 Dec 2016 12:20:51 +0100 Subject: [PATCH] [TwigBridge] fix Twig 2.x compatibility --- src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php index 3a444e8a1f..b1980b8a37 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php @@ -53,7 +53,7 @@ class TransNodeTest extends \PHPUnit_Framework_TestCase protected function getVariableGetterWithStrictCheck($name) { if (\Twig_Environment::MAJOR_VERSION >= 2) { - return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : $this->notFound("%s", 0))', $name, $name, $name, $name); + 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); } if (PHP_VERSION_ID >= 70000) {