Skip to content

Commit 609a0dd

Browse files
committed
Patch vendor with Composer patches
1 parent 7f04d5d commit 609a0dd

File tree

7 files changed

+326
-32
lines changed

7 files changed

+326
-32
lines changed

compiler/build/scoper.inc.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,7 @@ function (string $filePath, string $prefix, string $content): string {
195195
}
196196

197197
return str_replace(sprintf('%s\\Attribute', $prefix), 'Attribute', $content);
198-
},
199-
function (string $filePath, string $prefix, string $content): string {
200-
return str_replace('private static final', 'private static', $content);
201-
},
202-
function (string $filePath, string $prefix, string $content): string {
203-
if ($filePath !== 'vendor/hoa/stream/Stream.php') {
204-
return $content;
205-
}
206-
207-
$content = str_replace('\Hoa\Consistency::registerShutdownFunction(xcallable(\'Hoa\\\\Stream\\\\Stream::_Hoa_Stream\'));', '', $content);
208-
209-
return $content;
210-
},
198+
}
211199
],
212200
'whitelist' => [
213201
'PHPStan\*',

compiler/src/Console/CompileCommand.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5050

5151
$this->buildPreloadScript();
5252
$this->deleteUnnecessaryVendorCode();
53-
$this->patchFile(
54-
$output,
55-
'vendor/hoa/consistency/Consistency.php',
56-
'compiler/patches/Consistency.diff'
57-
);
58-
$this->patchFile(
59-
$output,
60-
'vendor/hoa/protocol/Wrapper.php',
61-
'compiler/patches/Wrapper.diff'
62-
);
6353
$this->fixComposerJson($this->buildDir);
6454
$this->renamePhpStormStubs();
6555
$this->patchPhpStormStubs($output);

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"phpstan/phpstan-php-parser": "^0.12",
4848
"phpstan/phpstan-phpunit": "^0.12",
4949
"phpstan/phpstan-strict-rules": "^0.12",
50-
"phpunit/phpunit": "^9.5.4"
50+
"phpunit/phpunit": "^9.5.4",
51+
"vaimo/composer-patches": "^4.22"
5152
},
5253
"config": {
5354
"platform": {
@@ -59,6 +60,9 @@
5960
"extra": {
6061
"branch-alias": {
6162
"dev-master": "0.12-dev"
63+
},
64+
"patcher": {
65+
"search": "patches"
6266
}
6367
},
6468
"autoload": {

composer.lock

Lines changed: 285 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)