kaiseki/php-coding-standard

Kaiseki PHP Coding Standard

dev-master 2024-03-05 08:46 UTC

This package is auto-updated.

Last update: 2024-04-05 09:00:07 UTC


README

PHP-CS-Fixer

Add the following .php-cs-fixer.dist.php file to your project's root. This will create a basic configuration with a Finder that includes everything in . and excludes vendor.:

<?php

declare(strict_types=1);

use Kaiseki\CodingStandard\PhpCsFixer\Config;

return Config::get();

If you need a more granular directory specification, you can pass a custom Finder. You can also override rules by passing your own as the second argument:

<?php

declare(strict_types=1);

use Kaiseki\CodingStandard\PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
    ->in(__DIR__ . '/src');

$rules = [
    // Your custom rules here
];

return Config::get($finder, $rules);

Add this script to your composer.json:

{
    "scripts": {
        "cs-check": "php-cs-fixer fix --dry-run",
        "cs-fix": "php-cs-fixer fix --allow-risky=yes"
    }
}