Skip to content

Ruleset: remove support for sniffs nor implementing Sniff interface #986

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

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Apr 14, 2025

Description

Previously truly invalid sniffs would already be ignored/rejected, but sniffs which didn't implement the interface, but did implement the required methods would still be accepted.

Now, both will be rejected.

Includes removing the RegisterSniffsRejectsInvalidSniffTest class as these tests are now redundant (covered via the RegisterSniffsMissingInterfaceTest class).

This commit executes step 4 to address issue #694.

Suggested changelog entry

Removed:

  • Support for sniffs not implementing the PHP_CodeSniffer\Sniffs\Sniff interface.

Related issues/external references

Closes #694

Related to #6

Previously truly invalid sniffs would already be ignored/rejected, but sniffs which didn't implement the interface, but did implement the required methods would still be accepted.

Now, both will be rejected.

Includes removing the `RegisterSniffsRejectsInvalidSniffTest` class as these tests are now redundant (covered via the `RegisterSniffsMissingInterfaceTest` class).

This commit executes step 4 to address issue 694..

Closes 694

Related to 6
@jrfnl jrfnl merged commit f267f46 into 4.x Apr 14, 2025
54 checks passed
@jrfnl jrfnl deleted the phpcs-4.0/feature/694-4-ruleset-dont-allow-sniffs-not-implementing-sniff-interface branch April 14, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants