File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/Symfony/Bridge/Twig/Tests/NodeVisitor Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1515use Symfony \Bridge \Twig \Node \TransNode ;
1616use Twig \Attribute \FirstClassTwigCallableReady ;
1717use Twig \Node \BodyNode ;
18+ use Twig \Node \EmptyNode ;
1819use Twig \Node \Expression \ArrayExpression ;
1920use Twig \Node \Expression \ConstantExpression ;
2021use Twig \Node \Expression \FilterExpression ;
@@ -28,13 +29,15 @@ class TwigNodeProvider
2829{
2930 public static function getModule ($ content )
3031 {
32+ $ emptyNodeExists = class_exists (EmptyNode::class);
33+
3134 return new ModuleNode (
3235 new BodyNode ([new ConstantExpression ($ content , 0 )]),
3336 null ,
34- new ArrayExpression ([], 0 ),
35- new ArrayExpression ([], 0 ),
36- new ArrayExpression ([], 0 ),
37- null ,
37+ $ emptyNodeExists ? new EmptyNode () : new ArrayExpression ([], 0 ),
38+ $ emptyNodeExists ? new EmptyNode () : new ArrayExpression ([], 0 ),
39+ $ emptyNodeExists ? new EmptyNode () : new ArrayExpression ([], 0 ),
40+ $ emptyNodeExists ? new EmptyNode () : null ,
3841 new Source ('' , '' )
3942 );
4043 }
You can’t perform that action at this time.
0 commit comments