https://github.com/mapado/php-cs-fixer-config
Mapado PHP CS fixer configuration file
https://github.com/mapado/php-cs-fixer-config
Last synced: 5 months ago
JSON representation
Mapado PHP CS fixer configuration file
- Host: GitHub
- URL: https://github.com/mapado/php-cs-fixer-config
- Owner: mapado
- License: mit
- Created: 2017-06-29T08:02:10.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T15:33:06.000Z (about 1 year ago)
- Last Synced: 2025-08-29T16:42:25.391Z (9 months ago)
- Language: PHP
- Size: 77.1 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Mapado php-cs-fixer-config
[`PHP CS Fixer`](http://github.com/FriendsOfPHP/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
getFinder()
->in([
__DIR__.'/src',
])
// if you want to exclude Tests directory
// ->exclude([ 'Tests' ])
;
return $config;
```
### Run
```sh
bin/php-cs-fixer fix --config=.php_cs
```
### In project
You might want to use [lint-staged](https://github.com/okonet/lint-staged), [php-git-hooks](https://github.com/bruli/php-git-hooks) or [composer-git-hooks](https://github.com/BrainMaestro/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](LICENSE).