Skip to content

Commit 5bb7f1e

Browse files
committed
Fix strtr calls 🤦🏻‍♂️
1 parent fa7edd2 commit 5bb7f1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ClassMap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function sort(): void
8888
*/
8989
public function addClass(string $className, string $path): void
9090
{
91-
unset($this->psrViolations[strtr('\\', '/', $path)]);
91+
unset($this->psrViolations[strtr($path, '\\', '/')]);
9292

9393
$this->map[$className] = $path;
9494
}
@@ -116,14 +116,14 @@ public function hasClass(string $className): bool
116116

117117
public function addPsrViolation(string $warning, string $className, string $path): void
118118
{
119-
$path = rtrim(strtr('\\', '/', $path), '/');
119+
$path = rtrim(strtr($path, '\\', '/'), '/');
120120

121121
$this->psrViolations[$path][] = ['warning' => $warning, 'className' => $className];
122122
}
123123

124124
public function clearPsrViolationsByPath(string $pathPrefix): void
125125
{
126-
$pathPrefix = rtrim(strtr('\\', '/', $pathPrefix), '/');
126+
$pathPrefix = rtrim(strtr($pathPrefix, '\\', '/'), '/');
127127

128128
foreach ($this->psrViolations as $path => $violations) {
129129
if ($path === $pathPrefix || 0 === \strpos($path, $pathPrefix.'/')) {

0 commit comments

Comments
 (0)