Skip to content

Commit

Permalink
Tweak PSR violation text to contain source rule (base namespace and p…
Browse files Browse the repository at this point in the history
…ath)
  • Loading branch information
Seldaek authored May 31, 2024
1 parent c27da00 commit 234f4c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ClassMapGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ private function filterByNamespace(array $classes, string $filePath, string $bas
// warn only if no valid classes, else silently skip invalid
if (\count($validClasses) === 0) {
foreach ($rejectedClasses as $class) {
$this->classMap->addPsrViolation("Class $class located in ".Preg::replace('{^'.preg_quote(self::getCwd()).'}', '.', $filePath, 1)." does not comply with $namespaceType autoloading standard. Skipping.");
$shortPath = Preg::replace('{^'.preg_quote(self::getCwd()).'}', '.', $filePath, 1);
$shortBasePath = Preg::replace('{^'.preg_quote(self::getCwd()).'}', '.', $basePath, 1);
$this->classMap->addPsrViolation("Class $class located in $shortPath does not comply with $namespaceType autoloading standard (rule: $baseNamespace => $shortBasePath). Skipping.");
}

return [];
Expand Down

0 comments on commit 234f4c5

Please sign in to comment.