Skip to content

Commit f2bb4ca

Browse files
committed
Fix prefixing in PHP-Parser
1 parent a42be43 commit f2bb4ca

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/build/scoper.inc.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ function (string $filePath, string $prefix, string $content): string {
216216

217217
return str_replace(sprintf('use %s\\PhpParser;', $prefix), 'use PhpParser;', $content);
218218
},
219+
function (string $filePath, string $prefix, string $content): string {
220+
if (!str_starts_with($filePath, 'vendor/nikic/php-parser/lib')) {
221+
return $content;
222+
}
223+
224+
return str_replace([
225+
sprintf('\\%s', $prefix),
226+
sprintf('\\\\%s', $prefix),
227+
], '', $content);
228+
},
219229
function (string $filePath, string $prefix, string $content): string {
220230
if (
221231
$filePath !== 'vendor/nette/utils/src/Utils/Strings.php'

0 commit comments

Comments
 (0)