Code styling standard for Oirë projects written in PHP.
This repository contains a set of PHP CS Fixer rules we use in our projects at Oirë. You can use them in your projects, too.
The rules were reviewed with PHP CS Fixer version 2.17.3 Desert Beast.
I assume you use Composer for your dependency management. As we don’t add this tiny project to Packagist, first you need to add its repository to your composer.json file as follows:
{
<...>,
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Oire/php-code-style"
}
],
Then add a file called .php_cs.dist
to the root of your projects with this contents, adjusting your paths accordingly:
<?php
use Oire\Helpers\CsFixerRules;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__);
return CsFixerRules::style($finder);
If you have Php-Cs-Fixer installed locally in your project, run:
./vendor/bin/php-cs-fixer fix
That's it, enjoy your cleaner code style!
Contributions are welcome. However, as code style is mostly a pure matter of taste, I may reject your pull request if I don't like the rules in there 😀.
Copyright © 2020, Andre Polykanine also known as Menelion Elensúlë, The Magical Kingdom of Oirë.
This software is licensed under an MIT license.