Skip to content

Commit

Permalink
[scoped] unprefixed SmartFileInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 2, 2021
1 parent 8d73a43 commit ef5167c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
return [
ScoperOption::PREFIX => 'RectorPrefix' . $timestamp,
ScoperOption::WHITELIST => StaticEasyPrefixer::getExcludedNamespacesAndClasses(),
// ScoperOption::FILES_WHITELIST => [
// // composer versions
// '../../vendor/composer/InstalledVersions.php'
// ],
ScoperOption::PATCHERS => [
// [BEWARE] $filePath is absolute!

Expand Down Expand Up @@ -69,6 +65,15 @@ function (string $filePath, string $prefix, string $content): string {
);
},

// unprefixed SmartFileInfo
function (string $filePath, string $prefix, string $content): string {
return Strings::replace(
$content, '
#' . $prefix . '\\\\Symplify\\\\SmartFileSystem\\\\SmartFileInfo#',
'Symplify\SmartFileSystem\SmartFileInfo'
);
},

// get version for prefixed version
function (string $filePath, string $prefix, string $content): string {
if (! Strings::endsWith($filePath, 'src/Configuration/Configuration.php')) {
Expand Down

0 comments on commit ef5167c

Please sign in to comment.