Skip to content

Commit b9ef26f

Browse files
committed
Temporary patch to work around php-scoper bugs
1 parent 6cab379 commit b9ef26f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

compiler/build/scoper.inc.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,23 @@ function (string $filePath, string $prefix, string $content): string {
222222

223223
return str_replace('#[Language(\'RegExp\')] ', '', $content);
224224
},
225+
function (string $filePath, string $prefix, string $content): string {
226+
if (strpos($filePath, 'src/') !== 0) {
227+
return $content;
228+
}
229+
230+
return str_replace([
231+
sprintf('\'%s\\BcMath\\', $prefix),
232+
sprintf('\'%s\\Dom\\', $prefix),
233+
sprintf('\'%s\\FFI\\', $prefix),
234+
sprintf('\'%s\\Ds\\', $prefix),
235+
], [
236+
'\'BcMath\\',
237+
'\'Dom\\',
238+
'\'FFI\\',
239+
'\'Ds\\',
240+
], $content);
241+
},
225242
],
226243
'exclude-namespaces' => [
227244
'PHPStan',

0 commit comments

Comments
 (0)