Skip to content

Code styling standard for Oirë projects written in PHP.

License

Notifications You must be signed in to change notification settings

Oire/php-code-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Code Style

Code styling standard for Oirë projects written in PHP. MIT License

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.

Usage

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!

Contributing

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 😀.

License

Copyright © 2020, Andre Polykanine also known as Menelion Elensúlë, The Magical Kingdom of Oirë.
This software is licensed under an MIT license.

About

Code styling standard for Oirë projects written in PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages