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:
Ruud Kamphuis
2024-09-03 09:54:27 +02:00
parent c0f11545fd
commit 09a43a9f6f
7 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ public function block_foo(array \$context, array \$blocks = []): iterable
{
\$macros = \$this->macros;
yield "foo";
return; yield '';
yield from [];
}
EOF
, new Environment(new ArrayLoader()),