Merge branch '3.x' into 4.x

* 3.x:
  Deprecate passing $ifexpr to ForNode
This commit is contained in:
Fabien Potencier
2025-01-24 15:07:55 +01:00
+4
View File
@@ -31,6 +31,10 @@ class ForNode extends Node
$body = new IfNode(new Nodes([$ifexpr, $body]), null, $lineno);
}
if (null !== $ifexpr) {
trigger_deprecation('twig/twig', '3.19', \sprintf('Passing not-null to the "ifexpr" argument of the "%s" constructor is deprecated.', static::class));
}
$nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body];
if (null !== $else) {
$nodes['else'] = $else;