Riimu's PHP Coding Standards Fixer Config
Most of my projects use a very consistent set of coding standards rules and project hierarchy. Rather than
copying the same PHP Coding Standards Fixer config file .php_cs
file across different projects and then
trying to figure out which project had the latest copy, I've created this composer package as a way to
include the same set of rules into every project via composer., (*1)
These standards are based on the community's best practices and PSR standards in addition to what I personally
consider to be good taste. You may freely use this configuration if you want, but do note that it may change
and evolve as time passes since I reserve the right to change my mind., (*2)
, (*3)
Usage
To add these rules into your project, you should first include them via composer as dev dependency using, (*4)
$ composer require --dev riimu/php-cs-fixer-config
Then you should create a file named .php_cs
in your project root directory that simply contains, (*5)
<?php
return require __DIR__ . '/vendor/riimu/php-cs-fixer-config/config.php';
The rules from the config will now be applied to files inside src
and tests
directories (if they exist),
when you run php-cs-fixer normally in the project root, e.g., (*6)
$ php-cs-fixer fix --dry-run -v --diff --diff-format=udiff
Credits
This package is Copyright (c) 2018 Riikka KalliomÀki., (*7)
See LICENSE for license and copying information., (*8)