Skip to content

Fix PSR-0 optimized classmap includes classes that do not match the configured namespace prefix #33

Open
skmetaly wants to merge 1 commit intocomposer:mainfrom
skmetaly:fix-psr0-prefix-check
Open

Fix PSR-0 optimized classmap includes classes that do not match the configured namespace prefix #33
skmetaly wants to merge 1 commit intocomposer:mainfrom
skmetaly:fix-psr0-prefix-check

Conversation

@skmetaly
Copy link
Copy Markdown

Fixes #32

Restores the namespace prefix check for PSR-0 inside filterByNamespace(). This was removed in #8 to enable --strict-psr warnings for non-matching classes, but PSR-0 path computation uses the full class name without stripping the prefix, so the check was the only guard preventing false positive matches.

The fix adds the prefix check back inside the PSR-0 if branch only. Non-matching classes are still added to $rejectedClasses so PSR violation warnings are preserved.

PSR-4 is unaffected because it strips the prefix during path computation, so non-matching classes produce wrong paths and are rejected.

@skmetaly skmetaly changed the title Fix PSR-0 optimized classmap including classes not matching namespace… Fix PSR-0 optimized classmap includes classes that do not match the configured namespace prefix Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PSR-0 optimized classmap includes classes that do not match the configured namespace prefix

1 participant