Skip to content

Commit

Permalink
Fix path normalization issues on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jun 10, 2024
1 parent 2a3384e commit 61804f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ClassMapGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ private function filterByNamespace(array $classes, string $filePath, string $bas
$cwd = self::getCwd();
}
$cwd = self::normalizePath($cwd);
$shortPath = Preg::replace('{^'.preg_quote($cwd).'}', '.', $filePath, 1);
$shortBasePath = Preg::replace('{^'.preg_quote($cwd).'}', '.', $basePath, 1);
$shortPath = Preg::replace('{^'.preg_quote($cwd).'}', '.', self::normalizePath($filePath), 1);
$shortBasePath = Preg::replace('{^'.preg_quote($cwd).'}', '.', self::normalizePath($basePath), 1);

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

0 comments on commit 61804f9

Please sign in to comment.