kaiseki / php-coding-standard
Kaiseki PHP Coding Standard
dev-master
2024-11-11 15:06 UTC
Requires
- php: ^8.1
- friendsofphp/php-cs-fixer: ^3.32
This package is auto-updated.
Last update: 2025-03-11 16:08:48 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" } }