Skip to content

Commit 9fb15a5

Browse files
committed
Always pass a consistent file path to js-phpize
1 parent 6faad63 commit 9fb15a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/JsPhpize/JsPhpizePhug.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct(ModuleContainerInterface $container)
6767
public function compile(JsPhpize $jsPhpize, $code, $fileName)
6868
{
6969
try {
70-
$phpCode = trim($jsPhpize->compile($code, $fileName));
70+
$phpCode = trim($jsPhpize->compile($code, $fileName ?: 'raw string'));
7171
$phpCode = preg_replace('/\{\s*\}$/', '', $phpCode);
7272
$phpCode = preg_replace(
7373
'/^(?<!\$)\$+(\$[a-zA-Z\\\\\\x7f-\\xff][a-zA-Z0-9\\\\_\\x7f-\\xff]*\s*[=;])/',

0 commit comments

Comments
 (0)