Skip to content

Commit f94d1d0

Browse files
Merge branch '2.8' into 3.3
* 2.8: [HttpFoundation] Fix FileBag issue with associative arrays fix the phpdoc that is not really inherited from response Minor docblock cleanup Remove redundant sprintf arguments.
2 parents 17b2ccf + 06e3beb commit f94d1d0

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Extension/CodeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public function abbrMethod($method)
7070
list($class, $method) = explode('::', $method, 2);
7171
$result = sprintf('%s::%s()', $this->abbrClass($class), $method);
7272
} elseif ('Closure' === $method) {
73-
$result = sprintf('<abbr title="%s">%s</abbr>', $method, $method);
73+
$result = sprintf('<abbr title="%s">%1$s</abbr>', $method);
7474
} else {
75-
$result = sprintf('<abbr title="%s">%s</abbr>()', $method, $method);
75+
$result = sprintf('<abbr title="%s">%1$s</abbr>()', $method);
7676
}
7777

7878
return $result;

Tests/Node/FormThemeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function testCompile()
7474
protected function getVariableGetter($name)
7575
{
7676
if (\PHP_VERSION_ID >= 70000) {
77-
return sprintf('($context["%s"] ?? null)', $name, $name);
77+
return sprintf('($context["%s"] ?? null)', $name);
7878
}
7979

80-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
80+
return sprintf('(isset($context["%s"]) ? $context["%1$s"] : null)', $name);
8181
}
8282
}

Tests/Node/SearchAndRenderBlockNodeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
272272
protected function getVariableGetter($name)
273273
{
274274
if (\PHP_VERSION_ID >= 70000) {
275-
return sprintf('($context["%s"] ?? null)', $name, $name);
275+
return sprintf('($context["%s"] ?? null)', $name);
276276
}
277277

278-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
278+
return sprintf('(isset($context["%s"]) ? $context["%1$s"] : null)', $name);
279279
}
280280
}

Tests/Node/TransNodeTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ public function testCompileStrict()
4545
protected function getVariableGetterWithoutStrictCheck($name)
4646
{
4747
if (\PHP_VERSION_ID >= 70000) {
48-
return sprintf('($context["%s"] ?? null)', $name, $name);
48+
return sprintf('($context["%s"] ?? null)', $name);
4949
}
5050

51-
return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
51+
return sprintf('(isset($context["%s"]) ? $context["%1$s"] : null)', $name);
5252
}
5353

5454
protected function getVariableGetterWithStrictCheck($name)
5555
{
5656
if (Environment::MAJOR_VERSION >= 2) {
57-
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);
57+
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);
5858
}
5959

6060
if (\PHP_VERSION_ID >= 70000) {
61-
return sprintf('($context["%s"] ?? $this->getContext($context, "%s"))', $name, $name, $name);
61+
return sprintf('($context["%s"] ?? $this->getContext($context, "%1$s"))', $name);
6262
}
6363

64-
return sprintf('(isset($context["%s"]) ? $context["%s"] : $this->getContext($context, "%s"))', $name, $name, $name);
64+
return sprintf('(isset($context["%s"]) ? $context["%1$s"] : $this->getContext($context, "%1$s"))', $name);
6565
}
6666
}

0 commit comments

Comments
 (0)