Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 13, 2021
1 parent c8e758f commit 9305fdf
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ function (string $filePath, string $prefix, string $content) use ($filePathsToRe
function (string $filePath, string $prefix, string $content): string {
foreach (UNPREFIX_CLASSES_BY_FILE as $endFilePath => $unprefixClasses) {
if (! Strings::endsWith($filePath, $endFilePath)) {
foreach ($unprefixClasses as $unprefixClass) {
$doubleQuotedClass = preg_quote(preg_quote('\\' . $unprefixClass));

$content = Strings::replace(
$content,
'#' . $prefix . '\\' . $doubleQuotedClass . '#',
$unprefixClass
);
}
continue;
}

foreach ($unprefixClasses as $unprefixClass) {
$doubleQuotedClass = preg_quote(preg_quote('\\' . $unprefixClass));

$content = Strings::replace(
$content,
'#' . $prefix . '\\' . $doubleQuotedClass . '#',
$unprefixClass
);
}
}

Expand Down

0 comments on commit 9305fdf

Please sign in to comment.