New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect other PSR violations where namespace is missing or not a subnamespace of configured one #8
base: main
Are you sure you want to change the base?
Detect other PSR violations where namespace is missing or not a subnamespace of configured one #8
Conversation
d1fb66b
to
3ee697c
Compare
3ee697c
to
9956a25
Compare
…ilently passing if valid classes are found, will only show up when requesting PSR violations)
@@ -216,10 +216,6 @@ private function filterByNamespace(array $classes, string $filePath, string $bas | |||
$realSubPath = substr($realSubPath, 0, $dotPosition === false ? PHP_INT_MAX : $dotPosition); | |||
|
|||
foreach ($classes as $class) { | |||
// silently skip if ns doesn't have common root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check was explicitely here, but looking at the code it can be handled as a rejectedClass instead as it gets silently ignored anyway if at least one valid class is found. Then it can be used when checking with --strict-psr. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No silent ignoring 👍🏻
Fixes composer/composer#11957
To get warnings about missing namespaces or non-common namespaces in Composer when running with --strict-psr, classes shouldn't be skipped before checking their namespace if they don't have a common root.