Skip to content

Commit 61804f9

Browse files
committed
Fix path normalization issues on windows
1 parent 2a3384e commit 61804f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ClassMapGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ private function filterByNamespace(array $classes, string $filePath, string $bas
248248
$cwd = self::getCwd();
249249
}
250250
$cwd = self::normalizePath($cwd);
251-
$shortPath = Preg::replace('{^'.preg_quote($cwd).'}', '.', $filePath, 1);
252-
$shortBasePath = Preg::replace('{^'.preg_quote($cwd).'}', '.', $basePath, 1);
251+
$shortPath = Preg::replace('{^'.preg_quote($cwd).'}', '.', self::normalizePath($filePath), 1);
252+
$shortBasePath = Preg::replace('{^'.preg_quote($cwd).'}', '.', self::normalizePath($basePath), 1);
253253

254254
foreach ($rejectedClasses as $class) {
255255
$this->classMap->addPsrViolation("Class $class located in $shortPath does not comply with $namespaceType autoloading standard (rule: $baseNamespace => $shortBasePath). Skipping.", $class, $filePath);

0 commit comments

Comments
 (0)