File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,12 @@ class JsPhpizePhug extends CompilerModule
14
14
15
15
public function __construct (array $ options = [])
16
16
{
17
- $ this ->options = array_merge ([
17
+ $ this ->options = array_merge_recursive ([
18
+ 'allowTruncatedParentheses ' => true ,
18
19
'catchDependencies ' => true ,
20
+ 'helpers ' => [
21
+ 'dot ' => 'dotWithArrayPrototype ' ,
22
+ ],
19
23
], $ options );
20
24
}
21
25
Original file line number Diff line number Diff line change @@ -78,10 +78,22 @@ public function testTruncatedCode()
78
78
'modules ' => [JsPhpizePhug::class],
79
79
]);
80
80
81
- $ compiler ->setOption ('jsphpize_engine ' , new JsPhpize ());
81
+ $ compiler ->setOption ('jsphpize_engine ' , new JsPhpize ([
82
+ 'allowTruncatedParentheses ' => true ,
83
+ 'catchDependencies ' => true ,
84
+ 'helpers ' => [
85
+ 'dot ' => 'dotWithArrayPrototype ' ,
86
+ ],
87
+ ]));
82
88
83
89
$ jsPhpize = $ compiler ->getFormatter ()->getOption (['patterns ' , 'transform_expression ' ]);
84
90
91
+ self ::assertSame (
92
+ 'call_user_func(call_user_func($GLOBALS[ \'__jpv_dotWithArrayPrototype \'], $items, ' .
93
+ '\'forEach \'), function ($item) { ' ,
94
+ $ jsPhpize ('items.forEach(function (item) { ' )
95
+ );
96
+
85
97
self ::assertSame (
86
98
'' ,
87
99
$ jsPhpize ('' )
You can’t perform that action at this time.
0 commit comments