glen / php-cs-fixer-config
Provides a configuration for php-cs-fixer
Installs: 33 834
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: ^5.3 || ^7.0
- ext-json: *
Requires (Dev)
- composer/semver: ^1.0
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^4.8.36
- symfony/process: ^2.7 || ^3.0 || ^4.0
README
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" } }
Installation
Run
$ composer require --dev glen/php-cs-fixer-config
Usage
Configuration
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;
License
This package is licensed using the MIT License.
Credits
This project README is inspired by localheinz/php-cs-fixer-config.