You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/TwigHooks/src/Twig/Node/HookNode.php
+26-3Lines changed: 26 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,19 +14,43 @@
14
14
namespaceSylius\TwigHooks\Twig\Node;
15
15
16
16
useSylius\TwigHooks\Twig\Runtime\HooksRuntime;
17
+
useTwig\Attribute\YieldReady;
17
18
useTwig\Compiler;
18
19
useTwig\Node\Expression\ArrayExpression;
19
20
useTwig\Node\Node;
20
21
22
+
#[YieldReady]
21
23
finalclass HookNode extends Node
22
24
{
23
25
publicfunction__construct(
24
26
Node$name,
25
27
?Node$context,
26
28
bool$only,
27
29
int$lineno,
28
-
?string$tag = null,
29
30
) {
31
+
if (\func_num_args() > 4) {
32
+
trigger_deprecation('sylius/twig-hooks', '0.11.0', \sprintf('The "tag" constructor argument of the "%s" class is deprecated and ignored (check which TokenParser class set it to "%s"), the tag is now automatically set by the Parser when needed.', static::class, func_get_arg(4) ?: 'null'));
33
+
}
34
+
35
+
// Remove when twig < 3.12 support is dropped
36
+
if (!class_exists(\Twig\Node\Expression\FunctionNode\EnumCasesFunction::class)) {
0 commit comments