Skip to content

Commit

Permalink
[scoper] unprefix SmartFileInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 29, 2022
1 parent 58a577c commit c579c28
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@
$content
),

// unprefixed SmartFileInfo - needed in AbstractTestCase
fn (string $filePath, string $prefix, string $content): string => Strings::replace(
$content,
'#' . $prefix . '\\\\Symplify\\\\SmartFileSystem\\\\SmartFileInfo#',
'Symplify\SmartFileSystem\SmartFileInfo'
),

static function (string $filePath, string $prefix, string $content): string {
if (! \str_ends_with($filePath, 'src/Application/VersionResolver.php')) {
return $content;
Expand Down

5 comments on commit c579c28

@TomasVotruba
Copy link
Member Author

@TomasVotruba TomasVotruba commented on c579c28 Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes some troubles during Rector 0.14 relase of the Rector book.

Partial revert of d4b7b48

@samsonasik
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomasVotruba this cause erorr in laminas-servicemanager-migration test:

There were 5 errors:

1) Error
The data provider specified for LaminasTest\ServiceManager\Migration\Rector\Class_\ImplementsFactoryInterfaceToPsrFactoryRector\AutoImportRenameUseTest::test is invalid.
Error: Class "Symplify\SmartFileSystem\SmartFileInfo" not found
/Users/samsonasik/www/laminas-servicemanager-migration/vendor/rector/rector/vendor/symplify/easy-testing/src/DataProvider/StaticFixtureFinder.php:59

@samsonasik
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomasVotruba I create issue report for it rectorphp/rector#7433 for it.

@samsonasik
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomasVotruba in bootstrap.php, the require_once may need to be re-added:

    if ($class === 'Symplify\SmartFileSystem\SmartFileInfo') {
        require_once 'vendor/symplify/smart-file-system/src/SmartFileInfo.php';
    }

@samsonasik
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomasVotruba I created PR #2846 for it.

Please sign in to comment.