This commit is contained in:
TomasVotruba 2021-03-13 23:15:43 +01:00
parent 3124fc226d
commit 9cec23389e

View File

@ -30,12 +30,14 @@ return [
// [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 (! Strings::contains($filePath, 'vendor/jean85/pretty-package-versions/src/PrettyVersions.php')) {
return $content;
}
// return Composer\InstalledVersions;
// see https://regex101.com/r/v8zRMm/1
return Strings::replace($content, '#' . $prefix . '\\Composer\\InstalledVersions#', 'Composer\InstalledVersions');
},