Provides default configuration and configuration builder for friendsofphp/php-cs-fixer.
Does the following things:
- Filter\GitFilter: Configures to accept only files that are present in Git
- Filter\DefaultFilter: Configures to include
.php_cs
to file set - Rules\DefaultRules: Applies set of rules based on @Symfony rules
- Rules\PlatformRules: Enables extra rules that are dependent on PHP version
The PHP version determined by:
- read from
composer.lock
(if file present):"platform-overrides": { "php": "5.6.0" }
- read from
composer.json:
"config": { "platform": { "php": "5.6.0" } }
Run
$ composer require --dev glen/php-cs-fixer-config
Create a configuration file .php_cs
in the root of your project:
<?php
// vim:ft=php
/** @var \glen\PhpCsFixerConfig\Config $config */
$config = require __DIR__ . '/vendor/glen/php-cs-fixer-config/phpcs.php';
$rules = $config->getRuleBuilder();
$rules['indentation_type'] = false;
$rules['class_definition'] = false;
return $config;
This package is licensed using the MIT License.
This project README is inspired by localheinz/php-cs-fixer-config.