Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

LitusProject/PHP-CS-Fixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Litus PHP CodeStyle

This project contains a custom fixer for php-cs-fixer. If a php file doesn't contain a license header, it is added. If the license header in the php file is different than the supplied file, the php file is updated.

Usage

Add the following to composer.json:

{
    ...
    "require": {
        "litus/php-cs": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/LitusProject/PhpCodeStyle"
        }
    ],
    ...
}

Create a .license_header file (or pick any filename you want) and put the license header in this file.
Note: Add an unformatted version of the license header!

Create a .php_cs file:

<?php

$finder = Symfony\CS\Finder\DefaultFinder::create()
    ->in(__DIR__);

return Litus\CodeStyle\Config\Config::create()
    ->setLicense(__DIR__ . '/.license_header') // or the filename you chose
    ->finder($finder);

Code Style

We conform to the PSR-2 and PSR-4 coding styles with the following exceptions:

  • We only have one use statement per file instead of one statement per declaration
  • We sometimes do prepend private variables and methods with an underscore ('_')
    note to ourselves: the "sometimes" indicates we're doing this wrong
  • We do not use a vendor namespace for the main project

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •