PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
## Description This PR adds documentation for the `Squiz.WhiteSpace.FunctionClosingBraceSpace` [sniff](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php). - `bin/phpcs --standard=Squiz --generator=text --sniffs=Squiz.WhiteSpace.FunctionClosingBraceSpace` - `bin/phpcs --standard=Squiz --generator=html --sniffs=Squiz.WhiteSpace.FunctionClosingBraceSpace` ## Suggested changelog entry Add documentation for the `Squiz.WhiteSpace.FunctionClosingBraceSpace` sniff....
# Description ### Tokenizers/Comment: add tests The `Tokenizers\Comment` class did not have any tests associated with it. This commit fixes that and documents the existing behaviour. Note: code coverage is...
I found an used variable in src/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php . We should check for unused variables with automated testing. ## Description We can check for unused variables with https://github.com/slevomat/coding-standard/blob/master/doc/variables.md#slevomatcodingstandardvariablesunusedvariable . Not sure...
## Description This is an implementation of the suggestions made by @gsherwood in https://github.com/squizlabs/PHP_CodeSniffer/pull/2646#issuecomment-541255248 I have intentionally not looked at the code changes initially suggested in https://github.com/squizlabs/PHP_CodeSniffer/pull/2646 (to avoid any...
## Is your feature request related to a problem? Yes and no. When using `phpcs --cache`, subsequent runs are fast. When using `phpcbf --cache`, every run takes the same amount...
# Description While working on #481, I noticed that the `fixableCount` property had an incorrect value. Upon investigation, I found that issues with severity zero are still being included in...
# Description As part of the development process, I often find myself using `phpcbf` followed by `phpcs` in order to check that the code I've written complies with the configured...
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/3932: > **TL;DR: This repo is being abandoned. The project continues in the [PHPCSStandards](https://github.com/PHPCSStandards/PHP_CodeSniffer) organisation.** > > --- > > > Okay, it's time. > > About seven...
## Current Situation As things are, tokens within DocBlocks are tokenized as `T_DOC_COMMENT_*` tokens. Additionally, there are two tokens in a docblock which receive additional information: * The `T_DOC_COMMENT_OPEN_TAG` token...
Repost from https://github.com/squizlabs/PHP_CodeSniffer/issues/1984: > PHP 7.1 introduced the "short list syntax", i.e. using the short array syntax instead of calling `list()`. > Ref: http://php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring > > Now I can imagine...