fix(scoper): prefix vendor classes from PHPDoc, close #6614 (#739)

This commit is contained in:
Hugo Alliaume 2021-08-23 01:05:17 +02:00 committed by GitHub
parent e267f89b34
commit 877cbb2de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -122,6 +122,13 @@ return [
'PHPUnit\Framework\Constraint\IsEqual'
),
// prefix vendor classes in phpdoc
fn (string $filePath, string $prefix, string $content): string => Strings::replace(
$content,
'#@(var|param) (\\\\(?!Rector)(?:[^ ]+))#',
'@$1 \\\\' . $prefix . '$2'
),
// unprefixed ContainerConfigurator
function (string $filePath, string $prefix, string $content): string {
// keep vendor prefixed the prefixed file loading; not part of public API