PHP CS Fixer config.
Run:
$ composer require --dev profideo/php-cs-fixer-configCreate a configuration file .php_cs in the root of your project:
<?php
$config = new Profideo\CS\Config\PhpXX();
$config->getFinder()
->in([
__DIR__.'/src',
])
;
return $config;Add .php_cs.cache (this is the cache file created by php-cs-fixer) to .gitignore:
vendor/
.php_cs.cache
Create a Makefile with the targets below:
# Coding Style
cs:
./vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --diff
cs-fix:
./vendor/bin/php-cs-fixer fix --verbose
cs-ci:
./vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --verbose --show-progress=estimatingIf you need to check issues locally, run:
$ make csIf you need to fix issues locally, run:
$ make cs-fixIn your Continuous Integration, run:
$ make cs-ciInspired by m6web/php-cs-fixer-config.
This project is licensed under the MIT license.