Skip to content

Commit

Permalink
Fix prefixing in PHP-Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Sep 16, 2024
1 parent a42be43 commit f2bb4ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions compiler/build/scoper.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ function (string $filePath, string $prefix, string $content): string {

return str_replace(sprintf('use %s\\PhpParser;', $prefix), 'use PhpParser;', $content);
},
function (string $filePath, string $prefix, string $content): string {
if (!str_starts_with($filePath, 'vendor/nikic/php-parser/lib')) {
return $content;
}

return str_replace([
sprintf('\\%s', $prefix),
sprintf('\\\\%s', $prefix),
], '', $content);
},
function (string $filePath, string $prefix, string $content): string {
if (
$filePath !== 'vendor/nette/utils/src/Utils/Strings.php'
Expand Down

0 comments on commit f2bb4ca

Please sign in to comment.