mirror of
https://github.com/rectorphp/rector.git
synced 2024-07-31 13:50:23 +00:00
This reverts commit e237ffb669
.
This commit is contained in:
parent
e237ffb669
commit
10705059a3
31
scoper.php
31
scoper.php
@ -57,14 +57,39 @@ return [
|
||||
},
|
||||
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
if (! Strings::contains($content, $prefix . '\Composer\\')) {
|
||||
if (! Strings::endsWith($filePath, 'vendor/composer/package-versions-deprecated/src/PackageVersions/Versions.php')) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// see https://regex101.com/r/v8zRMm/1
|
||||
return Strings::replace(
|
||||
$content, '
|
||||
#' . $prefix . '\\\\Composer\\\\InstalledVersions#',
|
||||
'Composer\InstalledVersions'
|
||||
);
|
||||
},
|
||||
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
if (! Strings::contains($content, $prefix . '\Composer\Plugin')) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
return Strings::replace(
|
||||
$content, '
|
||||
#' . $prefix . '\\\\Composer\\\\#',
|
||||
'Composer\\'
|
||||
#' . $prefix . '\\\\Composer\\\\Plugin#',
|
||||
'Composer\Plugin'
|
||||
);
|
||||
},
|
||||
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
if (! Strings::contains($content, $prefix . '\Composer\EventDispatcher')) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
return Strings::replace(
|
||||
$content, '
|
||||
#' . $prefix . '\\\\Composer\\\\EventDispatcher#',
|
||||
'Composer\EventDispatcher'
|
||||
);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user