mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-04 22:47:21 +00:00
Do not pass closure as reference
It's not needed.
This commit is contained in:
@@ -50,7 +50,7 @@ class ForNode extends Node
|
||||
->write("\$$iteratorVar = new \Twig\Runtime\LoopIterator(")
|
||||
->subcompile($this->getNode('seq'))
|
||||
->raw(");\n")
|
||||
->write("\$$functionVar = function (\$$iteratorVar, &\$context, \$blocks, &\$$functionVar, \$depth) {\n")
|
||||
->write("\$$functionVar = function (\$$iteratorVar, &\$context, \$blocks, \$$functionVar, \$depth) {\n")
|
||||
->indent()
|
||||
->write("\$macros = \$this->macros;\n")
|
||||
->write("\$$parentVar = \$context;\n")
|
||||
|
||||
@@ -68,7 +68,7 @@ class ForTest extends NodeTestCase
|
||||
$tests[] = [$node, <<<EOF
|
||||
// line 1
|
||||
\$__internal_compile_0 = new \Twig\Runtime\LoopIterator({$itemsGetter});
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, &\$__internal_compile_1, \$depth) {
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, \$__internal_compile_1, \$depth) {
|
||||
\$macros = \$this->macros;
|
||||
\$__internal_compile_2 = \$context;
|
||||
foreach (\$__internal_compile_0 as \$context["key"] => \$context["item"]) {
|
||||
@@ -93,7 +93,7 @@ EOF
|
||||
$tests[] = [$node, <<<EOF
|
||||
// line 1
|
||||
\$__internal_compile_0 = new \Twig\Runtime\LoopIterator({$valuesGetter});
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, &\$__internal_compile_1, \$depth) {
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, \$__internal_compile_1, \$depth) {
|
||||
\$macros = \$this->macros;
|
||||
\$__internal_compile_2 = \$context;
|
||||
\$context['loop'] = new \Twig\Runtime\LoopContext(\$__internal_compile_0, \$__internal_compile_2, \$blocks, \$__internal_compile_1, \$depth);
|
||||
@@ -119,7 +119,7 @@ EOF
|
||||
$tests[] = [$node, <<<EOF
|
||||
// line 1
|
||||
\$__internal_compile_0 = new \Twig\Runtime\LoopIterator({$valuesGetter});
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, &\$__internal_compile_1, \$depth) {
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, \$__internal_compile_1, \$depth) {
|
||||
\$macros = \$this->macros;
|
||||
\$__internal_compile_2 = \$context;
|
||||
\$context['loop'] = new \Twig\Runtime\LoopContext(\$__internal_compile_0, \$__internal_compile_2, \$blocks, \$__internal_compile_1, \$depth);
|
||||
@@ -146,7 +146,7 @@ EOF
|
||||
$tests[] = [$node, <<<EOF
|
||||
// line 1
|
||||
\$__internal_compile_0 = new \Twig\Runtime\LoopIterator({$valuesGetter});
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, &\$__internal_compile_1, \$depth) {
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, \$__internal_compile_1, \$depth) {
|
||||
\$macros = \$this->macros;
|
||||
\$__internal_compile_2 = \$context;
|
||||
\$context['loop'] = new \Twig\Runtime\LoopContext(\$__internal_compile_0, \$__internal_compile_2, \$blocks, \$__internal_compile_1, \$depth);
|
||||
@@ -173,7 +173,7 @@ EOF
|
||||
$tests[] = [$node, <<<EOF
|
||||
// line 1
|
||||
\$__internal_compile_0 = new \Twig\Runtime\LoopIterator({$itemsGetter});
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, &\$__internal_compile_1, \$depth) {
|
||||
\$__internal_compile_1 = function (\$__internal_compile_0, &\$context, \$blocks, \$__internal_compile_1, \$depth) {
|
||||
\$macros = \$this->macros;
|
||||
\$__internal_compile_2 = \$context;
|
||||
\$context['loop'] = new \Twig\Runtime\LoopContext(\$__internal_compile_0, \$__internal_compile_2, \$blocks, \$__internal_compile_1, \$depth);
|
||||
|
||||
Reference in New Issue
Block a user