mapado / php-cs-fixer-config
Mapado PHP CS Fixer configuration
Installs: 19 219
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 0
Open Issues: 0
Requires
- friendsofphp/php-cs-fixer: ^3.60
Requires (Dev)
- phpunit/phpunit: ^10.3
README
PHP CS Fixer
config for Mapado.
Installation
$ composer require --dev mapado/php-cs-fixer-config
Usage
Configuration
Create a configuration file .php_cs
in the root of your project:
<?php require(__DIR__ .'/vendor/autoload.php'); $config = new \Mapado\CS\Config(); $config->getFinder() ->in([ __DIR__.'/src', ]) // if you want to exclude Tests directory // ->exclude([ 'Tests' ]) ; return $config;
Run
bin/php-cs-fixer fix --config=.php_cs
In project
You might want to use lint-staged, php-git-hooks or composer-git-hooks to run this command automatically on git files, or autofix on save in your IDE.
Git
Add .php_cs.cache
(this is the cache file created by php-cs-fixer
) to .gitignore
:
License
This project is licensed under the MIT license.