Skip to content

Commit 168805e

Browse files
committed
These patches no longer needed
1 parent 8646922 commit 168805e

File tree

1 file changed

+9
-46
lines changed

1 file changed

+9
-46
lines changed

compiler/build/scoper.inc.php

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,19 @@
4545
'exclude-files' => $stubs,
4646
'php-version' => '7.4',
4747
'patchers' => [
48-
function (string $filePath, string $prefix, string $content): string {
49-
if ($filePath !== 'bin/phpstan') {
50-
return $content;
51-
}
52-
return str_replace('__DIR__ . \'/..', '\'phar://phpstan.phar', $content);
53-
},
54-
function (string $filePath, string $prefix, string $content): string {
55-
if ($filePath !== 'bin/phpstan') {
56-
return $content;
57-
}
58-
return str_replace(sprintf('%s\\\\__PHPSTAN_RUNNING__', $prefix), '__PHPSTAN_RUNNING__', $content);
59-
},
6048
function (string $filePath, string $prefix, string $content): string {
6149
if ($filePath !== 'vendor/nette/di/src/DI/Compiler.php') {
6250
return $content;
6351
}
64-
return str_replace('|Nette\\\\DI\\\\Statement', sprintf('|\\\\%s\\\\Nette\\\\DI\\\\Statement', $prefix), $content);
52+
return str_replace('|Nette\\DI\\Statement', sprintf('|\\%s\\Nette\\DI\\Statement', $prefix), $content);
6553
},
6654
function (string $filePath, string $prefix, string $content): string {
6755
if ($filePath !== 'vendor/nette/di/src/DI/Extensions/DefinitionSchema.php') {
6856
return $content;
6957
}
7058
$content = str_replace(
71-
sprintf('\'%s\\\\callable', $prefix),
72-
'\'callable',
73-
$content
74-
);
75-
$content = str_replace(
76-
'|Nette\\\\DI\\\\Definitions\\\\Statement',
77-
sprintf('|%s\\\\Nette\\\\DI\\\\Definitions\\\\Statement', $prefix),
59+
'|Nette\\DI\\Definitions\\Statement',
60+
sprintf('|%s\\Nette\\DI\\Definitions\\Statement', $prefix),
7861
$content
7962
);
8063

@@ -85,25 +68,20 @@ function (string $filePath, string $prefix, string $content): string {
8568
return $content;
8669
}
8770
$content = str_replace(
88-
sprintf('\'%s\\\\string', $prefix),
89-
'\'string',
90-
$content
91-
);
92-
$content = str_replace(
93-
'|Nette\\\\DI\\\\Definitions\\\\Statement',
94-
sprintf('|%s\\\\Nette\\\\DI\\\\Definitions\\\\Statement', $prefix),
71+
'|Nette\\DI\\Definitions\\Statement',
72+
sprintf('|%s\\Nette\\DI\\Definitions\\Statement', $prefix),
9573
$content
9674
);
9775

9876
return $content;
9977
},
78+
10079
function (string $filePath, string $prefix, string $content): string {
10180
if (strpos($filePath, 'src/') !== 0) {
10281
return $content;
10382
}
10483

105-
$content = str_replace(sprintf('\'%s\\\\r\\\\n\'', $prefix), '\'\\\\r\\\\n\'', $content);
106-
$content = str_replace(sprintf('\'%s\\\\', $prefix), '\'', $content);
84+
$content = str_replace(sprintf('\'%s\\r\\n\'', $prefix), '\'\\r\\n\'', $content);
10785

10886
return $content;
10987
},
@@ -178,21 +156,12 @@ function (string $filePath, string $prefix, string $content): string {
178156

179157
return str_replace(sprintf('%s\\Composer\\InstalledVersions', $prefix), 'Composer\\InstalledVersions', $content);
180158
},
181-
function (string $filePath, string $prefix, string $content): string {
182-
if ($filePath !== 'vendor/jetbrains/phpstorm-stubs/PhpStormStubsMap.php') {
183-
return $content;
184-
}
185-
186-
$content = str_replace('\'' . $prefix . '\\\\', '\'', $content);
187-
188-
return $content;
189-
},
190159
function (string $filePath, string $prefix, string $content): string {
191160
if ($filePath !== 'vendor/phpstan/php-8-stubs/Php8StubsMap.php') {
192161
return $content;
193162
}
194163

195-
$content = str_replace('\'' . $prefix . '\\\\', '\'', $content);
164+
$content = str_replace('\'' . $prefix . '\\', '\'', $content);
196165

197166
return $content;
198167
},
@@ -208,7 +177,7 @@ function (string $filePath, string $prefix, string $content): string {
208177
return $content;
209178
}
210179

211-
return str_replace(sprintf('\'%s\\\\JetBrains\\\\', $prefix), '\'JetBrains\\\\', $content);
180+
return str_replace(sprintf('\'%s\\JetBrains\\', $prefix), '\'JetBrains\\', $content);
212181
},
213182
function (string $filePath, string $prefix, string $content): string {
214183
if (!str_starts_with($filePath, 'vendor/nikic/php-parser/lib')) {
@@ -244,12 +213,6 @@ function (string $filePath, string $prefix, string $content): string {
244213

245214
return str_replace('#[Language(\'RegExp\')] ', '', $content);
246215
},
247-
function (string $filePath, string $prefix, string $content): string {
248-
if ($filePath !== 'vendor/fidry/cpu-core-counter/src/Finder/WindowsRegistryLogicalFinder.php') {
249-
return $content;
250-
}
251-
return str_replace(sprintf('%s\\\\reg query', $prefix), 'reg query', $content);
252-
},
253216
],
254217
'exclude-namespaces' => [
255218
'PHPStan',

0 commit comments

Comments
 (0)