remove condition on PHP version

Twig now requires PHP >= 7 so there is no need to check for prior version.
This commit is contained in:
Mathieu
2017-01-10 12:07:12 +01:00
committed by GitHub
parent a058fde56f
commit df1855840e
+5 -16
View File
@@ -44,22 +44,11 @@ class Twig_Node_Expression_Name extends Twig_Node_Expression
;
} else {
if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) {
if (PHP_VERSION_ID >= 70000) {
// use PHP 7 null coalescing operator
$compiler
->raw('($context[')
->string($name)
->raw('] ?? null)')
;
} else {
$compiler
->raw('(isset($context[')
->string($name)
->raw(']) ? $context[')
->string($name)
->raw('] : null)')
;
}
$compiler
->raw('($context[')
->string($name)
->raw('] ?? null)')
;
} else {
$compiler
->raw('(isset($context[')