mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 11:50:51 +00:00
[scoper] unprefix the exception in the code
This commit is contained in:
parent
537a9abc50
commit
566e171c36
15
scoper.php
15
scoper.php
|
@ -65,6 +65,21 @@ return [
|
|||
);
|
||||
},
|
||||
|
||||
// make UT=1 in tests work
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
if (! Strings::endsWith($filePath, 'packages/Testing/PHPUnit/AbstractRectorTestCase.php')) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
// see https://regex101.com/r/v8zRMm/1
|
||||
return Strings::replace(
|
||||
$content, '
|
||||
#' . $prefix . '\\\\PHPUnit\\\\Framework\\\\ExpectationFailedException',
|
||||
#',
|
||||
'PHPUnit\Framework\ExpectationFailedException'
|
||||
);
|
||||
},
|
||||
|
||||
// unprefixed SmartFileInfo
|
||||
function (string $filePath, string $prefix, string $content): string {
|
||||
return Strings::replace(
|
||||
|
|
|
@ -19,8 +19,6 @@ final class StaticEasyPrefixer
|
|||
// for ComposerJson because it is part of the public API. I.e. ComposerRectorInterface
|
||||
'Symplify\ComposerJsonManipulator\ValueObject\ComposerJson',
|
||||
'Symplify\ComposerJsonManipulator\ComposerJsonFactory',
|
||||
// this will make AbstractRectorTest case work for fixture updating
|
||||
'PHPUnit\Framework\ExpectationFailedException',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user