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 15
15
use Symfony \Bridge \Twig \Node \TransNode ;
16
16
use Twig \Attribute \FirstClassTwigCallableReady ;
17
17
use Twig \Node \BodyNode ;
18
+ use Twig \Node \EmptyNode ;
18
19
use Twig \Node \Expression \ArrayExpression ;
19
20
use Twig \Node \Expression \ConstantExpression ;
20
21
use Twig \Node \Expression \FilterExpression ;
@@ -28,13 +29,15 @@ class TwigNodeProvider
28
29
{
29
30
public static function getModule ($ content )
30
31
{
32
+ $ emptyNodeExists = class_exists (EmptyNode::class);
33
+
31
34
return new ModuleNode (
32
35
new BodyNode ([new ConstantExpression ($ content , 0 )]),
33
36
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 ,
38
41
new Source ('' , '' )
39
42
);
40
43
}
You can’t perform that action at this time.
0 commit comments