Fix iterable return type

Currently, the PHPDoc states that a string should be returned, but that's not correct.

It can be anything that is echo-able.

That means any scalar, Stringable and even null.
This commit is contained in:
Ruud Kamphuis
2024-09-05 09:24:38 +02:00
parent 83c5415da5
commit 4cd8955f74
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ class BlockNode extends Node
$compiler
->addDebugInfo($this)
->write("/**\n")
->write(" * @return iterable<string>\n")
->write(" * @return iterable<null|scalar|\Stringable>\n")
->write(" */\n")
->write(\sprintf("public function block_%s(array \$context, array \$blocks = []): iterable\n", $this->getAttribute('name')), "{\n")
->indent()