mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
use EmptyNode instead of an Nodes instance without children
This commit is contained in:
@@ -41,7 +41,11 @@ final class ModuleNode extends Node
|
||||
if (!$embeddedTemplates instanceof Node) {
|
||||
trigger_deprecation('twig/twig', '3.21', \sprintf('Not passing a "%s" instance as the "embedded_templates" argument of the "%s" constructor is deprecated.', Node::class, static::class));
|
||||
|
||||
$embeddedTemplates = new Nodes($embeddedTemplates ?? []);
|
||||
if (null !== $embeddedTemplates) {
|
||||
$embeddedTemplates = new Nodes($embeddedTemplates);
|
||||
} else {
|
||||
$embeddedTemplates = new EmptyNode();
|
||||
}
|
||||
}
|
||||
|
||||
$nodes = [
|
||||
|
||||
Reference in New Issue
Block a user