@@ -18,54 +18,54 @@ protected function compileWithArguments(
18
18
{
19
19
$ compiler ->raw ("\n" );
20
20
$ compiler ->indent ();
21
- $ compiler ->addIndentation ( );
21
+ $ compiler ->write ( '' );
22
22
$ compiler ->raw ("function() use(& \$context) { \n" );
23
23
$ compiler ->indent ();
24
24
25
25
// copy of arguments and __ from context
26
26
foreach ($ arguments as $ arg ) {
27
- $ compiler ->addIndentation ( );
27
+ $ compiler ->write ( '' );
28
28
$ compiler ->raw ("if (isset( \$context[' $ arg'])) \$outer $ arg = \$context[' $ arg']; \n" );
29
29
}
30
- $ compiler ->addIndentation ( );
30
+ $ compiler ->write ( '' );
31
31
$ compiler ->raw ("if (isset( \$context['__'])) \$outer__ = \$context['__']; \n" );
32
32
33
33
// adding closure's arguments to context
34
- $ compiler ->addIndentation ( );
34
+ $ compiler ->write ( '' );
35
35
$ compiler ->raw ("\$context['__'] = func_get_args(); \n" );
36
36
foreach ($ arguments as $ i => $ arg ) {
37
- $ compiler ->addIndentation ( );
37
+ $ compiler ->write ( '' );
38
38
$ compiler ->raw ("if (func_num_args()> $ i) \$context[' $ arg'] = func_get_arg( $ i); \n" );
39
- $ compiler ->addIndentation ( );
39
+ $ compiler ->write ( '' );
40
40
$ compiler ->raw ("else unset( \$context[' $ arg']); \n" );
41
41
}
42
42
43
43
// getting call result
44
- $ compiler ->addIndentation ( );
44
+ $ compiler ->write ( '' );
45
45
$ compiler ->raw ("\$result = " );
46
46
$ compiler ->subcompile ($ this ->getNode ($ expressionNode ));
47
47
$ compiler ->raw ("; \n" );
48
48
49
49
// recreating original context
50
50
foreach ($ arguments as $ arg ) {
51
- $ compiler ->addIndentation ( );
51
+ $ compiler ->write ( '' );
52
52
$ compiler ->raw ("if (isset( \$outer $ arg)) \$context[' $ arg'] = \$outer $ arg ; \n" );
53
- $ compiler ->addIndentation ( );
53
+ $ compiler ->write ( '' );
54
54
$ compiler ->raw ("else unset( \$context[' $ arg']); \n" );
55
55
}
56
- $ compiler ->addIndentation ( );
56
+ $ compiler ->write ( '' );
57
57
$ compiler ->raw ("if (isset( \$outer__)) \$context['__'] = \$outer__ ; \n" );
58
- $ compiler ->addIndentation ( );
58
+ $ compiler ->write ( '' );
59
59
$ compiler ->raw ("else unset( \$context['__']); \n" );
60
60
61
61
// return statement
62
- $ compiler ->addIndentation ( );
62
+ $ compiler ->write ( '' );
63
63
$ compiler ->raw ("return \$result; \n" );
64
64
$ compiler ->outdent ();
65
- $ compiler ->addIndentation ( );
65
+ $ compiler ->write ( '' );
66
66
67
67
$ compiler ->raw ("} \n" );
68
68
$ compiler ->outdent ();
69
- $ compiler ->addIndentation ( );
69
+ $ compiler ->write ( '' );
70
70
}
71
71
}
0 commit comments