mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
Merge branch '3.x' into 4.x
* 3.x: Deprecate passing $ifexpr to ForNode
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user