mirror of
https://github.com/twigphp/Twig.git
synced 2026-10-14 07:46:02 +00:00
Replace return; yield with yield from []
This has the same effect, but looks less hacky and makes PHPStan happy. https://phpstan.org/r/df7fcc88-1df8-428e-b675-5dc6965c34d6 Previously this was needed to work properly with output capturing.
This commit is contained in:
@@ -353,7 +353,7 @@ final class ModuleNode extends Node
|
||||
$compiler->subcompile($this->getNode('display_end'));
|
||||
|
||||
if (!$this->hasNode('parent')) {
|
||||
$compiler->write("return; yield '';\n"); // ensure at least one yield call even for templates with no output
|
||||
$compiler->write("yield from [];\n");
|
||||
}
|
||||
|
||||
$compiler
|
||||
|
||||
Reference in New Issue
Block a user