Skip to content
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

Fix false positives for UnusedIssueHandlerSuppression #11212

Open
wants to merge 1 commit into
base: 6.x
Choose a base branch
from

Conversation

edsrzf
Copy link
Contributor

@edsrzf edsrzf commented Jan 27, 2025

UnusedIssueHandlerSuppression would be emitted for any issue handler rather than just suppressions.

For example, this would trigger it, even if it was used:

<UndefinedClass errorLevel="info" />

This fixes up an if statement so that the issue is only emitted for errorLevel="suppress".

I tried writing a test for this change, but didn't find it very straightforward and settled for not writing one:

  • TestCase doesn't have very good hooks for providing a custom configuration or issue handlers, though it is doable.
  • IssueBuffer::finish doesn't provide a way to inspect the final issues, except by capturing and parsing output (ob_start, etc.)

Happy to receive feedback or advice on testing.

UnusedIssueHandlerSuppression would be emitted for any issue handler
rather than just suppressions.

For example, this would trigger it, even if it was used:

```
<UndefinedClass errorLevel="info" />
```

This fixes up an if statement so that the issue is only emitted for
`errorLevel="suppress"`.
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.

1 participant