diff --git a/src/Node/MacroNode.php b/src/Node/MacroNode.php index 5ada1b220..d96e98cf2 100644 --- a/src/Node/MacroNode.php +++ b/src/Node/MacroNode.php @@ -14,6 +14,7 @@ namespace Twig\Node; use Twig\Attribute\YieldReady; use Twig\Compiler; use Twig\Error\SyntaxError; +use Twig\Markup; use Twig\Node\Expression\ArrayExpression; use Twig\Node\Expression\Variable\LocalVariable; @@ -76,7 +77,7 @@ class MacroNode extends Node $compiler ->raw('...$varargs') - ->raw(")\n") + ->raw("): string|Markup\n") ->write("{\n") ->indent() ->write("\$macros = \$this->macros;\n") diff --git a/tests/Node/MacroTest.php b/tests/Node/MacroTest.php index 39ff9cd1f..fcd5db402 100644 --- a/tests/Node/MacroTest.php +++ b/tests/Node/MacroTest.php @@ -49,7 +49,7 @@ class MacroTest extends NodeTestCase yield 'with use_yield = true' => [$node, <<macros; \$context = [ @@ -71,7 +71,7 @@ EOF yield 'with use_yield = false' => [$node, <<macros; \$context = [