Skip to content

Commit

Permalink
fix(scoper): prefix vendor classes from PHPDoc, close #6614 (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Aug 22, 2021
1 parent e267f89 commit 877cbb2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scoper.php
Expand Up @@ -122,6 +122,13 @@ function (string $filePath, string $prefix, string $content): string {
'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
Expand Down

0 comments on commit 877cbb2

Please sign in to comment.