Skip to content

Commit

Permalink
[Scoper] Fix scoper to fix prefixed regex on doctrine inflector take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 6, 2025
1 parent c38a120 commit 5499ffa
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ static function (string $filePath, string $prefix, string $content): string {
return Unprefixer::unprefixQuoted($content, $prefix);
},

// unprefix regex content on doctrine inflector
static function (string $filePath, string $prefix, string $content): string {
if (\str_contains($filePath, 'vendor/doctrine/inflector')) {
return $content;
}

return str_replace(
"'" . $prefix . "\\",
"'\\",
$content
);
},

static function (string $filePath, string $prefix, string $content): string {
if (! \str_ends_with($filePath, 'vendor/nette/utils/src/Utils/Strings.php')) {
return $content;
Expand Down

0 comments on commit 5499ffa

Please sign in to comment.