mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
[Scoper] Try fix InstalledVersions autoload in docker with env definition check (#5855)
This commit is contained in:
parent
0207942086
commit
52d94dd8d5
2
.github/workflows/publish_docker_images.yaml
vendored
2
.github/workflows/publish_docker_images.yaml
vendored
|
@ -30,6 +30,8 @@ jobs:
|
|||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build images
|
||||
env:
|
||||
IMAGES: docker
|
||||
run: |
|
||||
DOCKER_TAGS=""
|
||||
|
||||
|
|
12
scoper.php
12
scoper.php
|
@ -29,6 +29,18 @@ return [
|
|||
ScoperOption::PATCHERS => [
|
||||
// [BEWARE] $filePath is absolute!
|
||||
|
||||
// fixes https://github.com/rectorphp/rector-prefixed/runs/2103759172
|
||||
// and https://github.com/rectorphp/rector-prefixed/blob/0cc433e746b645df5f905fa038573c3a1a9634f0/vendor/jean85/pretty-package-versions/src/PrettyVersions.php#L6
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
if (getenv('IMAGES') !== 'docker') {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// return Composer\InstalledVersions;
|
||||
// see https://regex101.com/r/v8zRMm/1
|
||||
return Strings::replace($content, '#' . $prefix . '\\\\Composer\\\\InstalledVersions#', 'Composer\InstalledVersions');
|
||||
},
|
||||
|
||||
// unprefix string classes, as they're string on purpose - they have to be checked in original form, not prefixed
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
// skip vendor
|
||||
|
|
Loading…
Reference in New Issue
Block a user