fsevestre / php-cs-fixer-config
PHP CS Fixer config
v1.0.0
2018-04-21 16:38 UTC
Requires
- friendsofphp/php-cs-fixer: ^2.10
This package is auto-updated.
Last update: 2024-05-15 00:26:30 UTC
README
PHP CS Fixer
config.
Installation
Run:
$ composer require --dev fsevestre/php-cs-fixer-config
Usage
Configuration
Create a configuration file .php_cs
in the root of your project:
<?php $config = new FSevestre\CS\Config\PhpXX(); $config->getFinder() ->in([ __DIR__.'/src' ])->exclude([ 'tests' ]) ; return $config;
Git
Add .php_cs.cache
(this is the cache file created by php-cs-fixer
) to .gitignore
:
vendor/
.php_cs.cache
Makefile
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=estimating
Fixing issues
If you need to check issues locally, run:
$ make cs
If you need to fix issues locally, run:
$ make cs-fix
In your Continuous Integration, run:
$ make cs-ci
Credits
Inspired by m6web/php-cs-fixer-config.
License
This project is licensed under the MIT license.