Skip to content

Commit 25b071a

Browse files
committed
Dedupe variables
1 parent 3666b93 commit 25b071a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/JsPhpize/Compiler/DyiadeTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ protected function compileLazyDyiade($helper, $leftHand, $rightHand)
2525
'$_ENV',
2626
]);
2727
}));
28-
$use = count($variables) ? ' use (&' . implode(', &', $variables) . ')' : '';
28+
$variables = array_map('strval', $variables);
29+
$use = count($variables) ? ' use (&' . implode(', &', array_unique($variables)) . ')' : '';
2930

3031
return $this->helperWrap($helper, [
3132
$leftHand,

0 commit comments

Comments
 (0)