Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 0bda7ea

Browse files
committed
Fix global function scoping
1 parent fdf9f19 commit 0bda7ea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scoper.inc.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
declare(strict_types=1);
44

55
return [
6-
'expose-global-functions' => false,
7-
// 'exclude-functions' => ['app'],
6+
'expose-global-functions' => true,
87
'patchers' => [
98
function (string $filePath, string $prefix, string $content): string {
9+
// Remove from any `app` path strings
1010
if (\str_contains($content, $prefix . '\\app')) {
1111
$content = \preg_replace(
12-
'/' . $prefix . '[\\\\]+app' . '/',
12+
'/' . $prefix . '\\\\+app' . '/',
1313
'app',
1414
$content
1515
);
1616
}
1717

18+
// Remove from any common class references within Tasks
1819
if (\str_starts_with($filePath, 'src/Tasks/')) {
1920
$content = \str_replace(
2021
$prefix . '\\\\Illuminate\\\\',
@@ -48,6 +49,6 @@ function (string $filePath, string $prefix, string $content): string {
4849
'vendor/symfony/polyfill-intl-grapheme/bootstrap.php',
4950
],
5051
'exclude-namespaces' => [
51-
'Symfony\Polyfill\*',
52+
'Symfony\\Polyfill\\*',
5253
],
5354
];

0 commit comments

Comments
 (0)