minor #29892 [TwigBridge] remove unreachable code (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] remove unreachable code

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Since our version constraint is `^1.37.1|^2.6.2` any Twig version that
is below 2.4.5 must be a Twig 1.x release.

Commits
-------

16f97b9769 remove unreachable code
This commit is contained in:
Fabien Potencier 2019-01-16 09:32:02 +01:00
commit c7f46e4795
1 changed files with 1 additions and 5 deletions

View File

@ -53,12 +53,8 @@ class TransNodeTest extends TestCase
protected function getVariableGetterWithStrictCheck($name)
{
if (Environment::VERSION_ID > 20404) {
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
}
if (Environment::MAJOR_VERSION >= 2) {
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name);
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
}
if (\PHP_VERSION_ID >= 70000) {