c-quential / coding-standard
C-quential Coding Standard for PHP_CodeSniffer.
Package info
github.com/C-quential/coding-standard
Type:phpcodesniffer-standard
pkg:composer/c-quential/coding-standard
Requires
- php: ^8.3
- squizlabs/php_codesniffer: ^4.0.0
Requires (Dev)
- phpunit/phpunit: ^12.0.3
README
Custom rules for PHP_CodeSniffer
Installation
Install using Composer.
composer require c-quential/coding-standard
Sniffs
Below is an alphabetical list of sniffs, with short explanations.
Strings
CquentialCodingStandard.Strings.UnneededDoubleQuoteUsage: If a string can be rewritten to use single quotes, without adding string concatenation, you must do so.
TypeHints
CquentialCodingStandard.TypeHints.ArrowFunctionTypeHint: This sniff checks if arrow functions are fully type-hinted. All parameters need to be type-hinted and a return type is also required. If there is no return value, you can use null, as void is not allowed on arrow functions.