PHP_CodeSniffer sweetened with ease 🍒
SugaredRim\PHP_CodeSniffer takes an opinionated view of code style checking with PHP_CodeSniffer, it is preconfigured to get you up and running as quickly as possible.
$ composer require --dev sugared-rim/php_codesniffer
Instead of running phpcs
with all its options, just run sugared-rim-phpcs
- that's it:
{
...
"require-dev": {
"sugared-rim/php_codesniffer": ...
},
"scripts": {
"lint": "sugared-rim-phpcs"
}
}
You may overwrite some options by putting it in your composer.json
.
See schnittstabil/finder-by-config for details of the files
options.
Some of the default settings:
{
...
"scripts": {
"lint": "sugared-rim-phpcs"
},
"extra": {
"sugared-rim/php_codesniffer": {
"default_standard": ["PSR1", "PSR2"],
"files": {
"in": ["."],
"name": ["*.php"],
"files": true,
"exclude": [
"build",
"bower_components",
"node_modules",
"vendor"
],
"ignoreDotFiles": true,
"ignoreVCS": true
}
}
}
}
All extra.sugared-rim/php_codesniffer
options are passed through PHP_CodeSniffer::setConfigData, except:
files
: Array of files and/or directories to check.
MIT © Michael Mayer