This commit is contained in:
Fabien Potencier
2024-04-14 10:22:11 +02:00
parent 34f1bec64c
commit 30b5658f89
4 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -199,7 +199,7 @@
* removed Parser::isReservedMacroName()
* removed SanboxedPrintNode
* removed Node::setTemplateName()
* made classes maked as "@final" final
* made classes marked as "@final" final
* removed InitRuntimeInterface, ExistsLoaderInterface, and SourceContextLoaderInterface
* removed the "spaceless" tag
* removed Twig\Environment::getBaseTemplateClass() and Twig\Environment::setBaseTemplateClass()
+1 -1
View File
@@ -34,7 +34,7 @@ class CaptureNode extends Node
if (!$this->getAttribute('raw')) {
$compiler->raw("('' === \$tmp = ");
}
$compiler->raw($useYield ? "implode('', iterator_to_array(" : "\\Twig\\Extension\\CoreExtension::captureOutput(");
$compiler->raw($useYield ? "implode('', iterator_to_array(" : '\\Twig\\Extension\\CoreExtension::captureOutput(');
if ($this->getAttribute('with_blocks')) {
$compiler->raw("(function () use (&\$context, \$macros, \$blocks) {\n");
} else {
+2
View File
@@ -342,6 +342,7 @@ abstract class Template
try {
if ($this->useYield) {
yield from $this->doDisplay($context, $blocks);
return;
}
@@ -411,6 +412,7 @@ abstract class Template
try {
if ($this->useYield) {
yield from $template->$block($context, $blocks);
return;
}
-1
View File
@@ -14,7 +14,6 @@ namespace Twig\Tests\Node;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
use Twig\Node\BlockNode;
use Twig\Node\Node;
use Twig\Node\TextNode;
use Twig\Test\NodeTestCase;