Add more types to Template class and compiled templates

This commit is contained in:
Ruud Kamphuis
2024-08-29 20:21:36 +02:00
committed by Fabien Potencier
parent 22abdfafae
commit 7e52a68097
7 changed files with 30 additions and 26 deletions
+4 -1
View File
@@ -32,7 +32,10 @@ class BlockNode extends Node
{
$compiler
->addDebugInfo($this)
->write(\sprintf("public function block_%s(\$context, array \$blocks = [])\n", $this->getAttribute('name')), "{\n")
->write("/**\n")
->write(" * @return iterable<string>\n")
->write(" */\n")
->write(\sprintf("public function block_%s(array \$context, array \$blocks = []): iterable\n", $this->getAttribute('name')), "{\n")
->indent()
->write("\$macros = \$this->macros;\n")
;