Skip to content

Commit db8f59e

Browse files
committed
These patches no longer needed
1 parent e5789d3 commit db8f59e

File tree

1 file changed

+7
-54
lines changed

1 file changed

+7
-54
lines changed

compiler/build/scoper.inc.php

Lines changed: 7 additions & 54 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,28 +68,13 @@ 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
},
100-
function (string $filePath, string $prefix, string $content): string {
101-
if (strpos($filePath, 'src/') !== 0) {
102-
return $content;
103-
}
104-
105-
$content = str_replace(sprintf('\'%s\\\\r\\\\n\'', $prefix), '\'\\\\r\\\\n\'', $content);
106-
$content = str_replace(sprintf('\'%s\\\\', $prefix), '\'', $content);
107-
108-
return $content;
109-
},
11078
function (string $filePath, string $prefix, string $content): string {
11179
if (strpos($filePath, '.neon') === false) {
11280
return $content;
@@ -178,21 +146,12 @@ function (string $filePath, string $prefix, string $content): string {
178146

179147
return str_replace(sprintf('%s\\Composer\\InstalledVersions', $prefix), 'Composer\\InstalledVersions', $content);
180148
},
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-
},
190149
function (string $filePath, string $prefix, string $content): string {
191150
if ($filePath !== 'vendor/phpstan/php-8-stubs/Php8StubsMap.php') {
192151
return $content;
193152
}
194153

195-
$content = str_replace('\'' . $prefix . '\\\\', '\'', $content);
154+
$content = str_replace('\'' . $prefix . '\\', '\'', $content);
196155

197156
return $content;
198157
},
@@ -208,7 +167,7 @@ function (string $filePath, string $prefix, string $content): string {
208167
return $content;
209168
}
210169

211-
return str_replace(sprintf('\'%s\\\\JetBrains\\\\', $prefix), '\'JetBrains\\\\', $content);
170+
return str_replace(sprintf('\'%s\\JetBrains\\', $prefix), '\'JetBrains\\', $content);
212171
},
213172
function (string $filePath, string $prefix, string $content): string {
214173
if (!str_starts_with($filePath, 'vendor/nikic/php-parser/lib')) {
@@ -244,12 +203,6 @@ function (string $filePath, string $prefix, string $content): string {
244203

245204
return str_replace('#[Language(\'RegExp\')] ', '', $content);
246205
},
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-
},
253206
],
254207
'exclude-namespaces' => [
255208
'PHPStan',

0 commit comments

Comments
 (0)