mirror of
https://gh.wpcy.net/https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2026-04-26 00:02:20 +08:00
PHPCS 3.2.0 includes the same `DiscourageGoto` sniff as was previously pulled to WPCS.
As the minimum PHPCS requirement has gone up to beyond 3.2.0 now, we can switch over to use the upstream version instead.
Note:
Deprecating the WPCS version of the sniff and letting it extend the upstream version and throwing a deprecation message would be useless in this case, as:
* When doing so, the error codes for the normal messages would not change, so people would not be able to update their custom rulesets and/or inline annotations.
* If both sniffs - the WPCS one and the PHPCS version - would be included in the ruleset, we'd need to silence the error codes from one or the other to prevent duplicate messages from being thrown.
- If we'd silence the PHPCS messages, the net effect would be the same as just keeping the WPCS sniff and people would still not be able to adjust their rulesets/annotations.
- If we'd silence the WPCS messages, the net effect would be the same as this PR minus the deprecation message.
So, as this will be going into a major release anyway, we may as well get the change over with.
Note: this is a BC-break for anyone using a custom ruleset or PHPCS annotations referencing the previously included sniff.
Refs:
* squizlabs/PHP_CodeSniffer 1662
* squizlabs/PHP_CodeSniffer 1664
|
||
|---|---|---|
| .. | ||
| class-ruleset-test.php | ||
| pre-commit | ||