PHP CS Fixer
config for M6Web components.
Run
$ composer require --dev rem42/php-cs-fixer-config
Create a configuration file .php-cs-fixer.dist.php
in the root of your project:
<?php
$config = new Rem42\CS\Config\Config;
$config->getFinder()
->in(
[
__DIR__.'/src',
__DIR__.'/tests',
]
);
return $config;
Add .php-cs-fixer.cache
(this is the cache file created by php-cs-fixer
) to .gitignore
:
vendor/
.php-cs-fixer.cache
Create a Makefile
with the targets below:
# Coding Style
cs:
./bin/php-cs-fixer fix --dry-run --stop-on-violation --diff
cs-fix:
./bin/php-cs-fixer fix
cs-ci:
./bin/php-cs-fixer fix --dry-run --using-cache=no --verbose
If you need to check issues locally, just run
$ make cs
If you need to fix issues locally, just run
$ make cs-fix
In your Continuous Integration, run
$ make cs-ci
Developed by Rémy BRUYERE (rem42), inspired by Bedrock Streaming.
This project is licensed under the MIT license.