PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
Follow up/repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/2823: > A number of sniffs contain a `public $error` property to toggle whether the sniff should throw an `error` or a `warning`. > > This property...
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/2898 by @gsherwood: > Version 4 is a good time to review the exit codes that both scripts produce to ensure that success cases all use `0` and...
End to end tests should be introduced in a separate test suite to cover the use of all supported CLI arguments (and some combinations of these). PHPUnit supports a `phpt`...
It was previously already announced that the 4.0 release will drop support for: * JavaScript and CSS tokenizers, which also means the JS and CSS specific sniffs will be removed....
Follow up on #198. * [ ] Remove the `getBlacklist()` and `getWhitelist()` methods. * [ ] Make the new `getDisallowedFiles()` and `getAllowedFiles()` methods `abstract` and change the return type from...
The Generic.CodeAnalysis.ForLoopShouldBeWhileLoop sniff is used to detect `for` loops that can be simplified to `while` loops. Currently, the sniff is triggered only when it finds a `for` loop that only...
## Description The current method, listing codes to disable and a list of exceptions to that list, still has trouble with some cases. For example, disabling a standard, re-enabling a...
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/3601: > The following code sample: > ```php >
## Description Recreation of upstream PR https://github.com/squizlabs/PHP_CodeSniffer/pull/3771: > ### Generic/Todo-Fixme: make the sniffs more selective > > The sniffs as-they-were, would sniff all comment related tokens, including `T_DOC_COMMENT_STAR`, `T_DOC_COMMENT_WHITESPACE` etc....
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/1955 by @gsherwood: > Everywhere a sniff code or error message code is sourced from a ruleset, do case insensitive matching on the real sniff and error codes....