Skip to content

mobizel/coding-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Standard

🥇 Battle-tested coding standard configuration used at Mobizel.

Installation & usage

  1. Install this package:

    $ composer require --dev mobizel/coding-standard
  2. Import the configuration file in your ecs.php:

    $ecsConfig->import('vendor/mobizel/coding-standard/ecs.php');

Example config (ecs.php)

<?php

use PhpCsFixer\Fixer\Comment\HeaderCommentFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function (ECSConfig $ecsConfig): void {
   $ecsConfig->import('vendor/mobizel/coding-standard/ecs.php');

   $header = <<<EOM
This file is part of <The Project>.

(c) Mobizel

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOM;

   $services = $ecsConfig->services();
   $services
       ->set(HeaderCommentFixer::class)
       ->call('configure', [[
           'header' => $header,
           'location' => 'after_open',
       ]])
   ; 
};