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
This PR was merged into the 3.x branch.
Discussion
----------
Deprecate instantiating Node directly, introduce EmptyNode and Nodes
Based on some comments from `@stof`:
See #4292 (comment)
See #4333 (comment)
First interesting usage here: 65ee72a
Commits
-------
8b27898 Deprecate using Node directly, introduce EmptyNode and Nodes
trigger_deprecation('twig/twig', '3.15', \sprintf('Instantiating "%s" directly is deprecated; the class will become abstract in 4.0.', self::class));
52
+
}
53
+
50
54
foreach ($nodesas$name => $node) {
51
55
if (!$nodeinstanceof self) {
52
56
thrownew \InvalidArgumentException(\sprintf('Using "%s" for the value of node "%s" of "%s" is not supported. You must pass a \Twig\Node\Node instance.', \is_object($node) ? $node::class : (null === $node ? 'null' : \gettype($node)), $name, static::class));
0 commit comments