frankverhoeven/coding-standard

3.0.5 2025-03-14 13:26 UTC

This package is auto-updated.

Last update: 2025-06-14 13:58:27 UTC


README

Set of PHP CS Fixer rules.

Install

Install the package with composer:

composer require frankverhoeven/coding-standard --dev

Configure

Include the rules in your .php-cs-fixer.dist.php configuration:

<?php
declare(strict_types=1);

use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$finder = PhpCsFixer\Finder::create()
    ->exclude('vendor')
    ->in(__DIR__)
;

return (new PhpCsFixer\Config())
    ->setParallelConfig(ParallelConfigFactory::detect())
    ->setRiskyAllowed(true)
    ->setRules(require __DIR__ . '/vendor/frankverhoeven/coding-standard/rules.php')
    ->setFinder($finder)
    ->setCacheFile(__DIR__ . '.php_cs.cache')
    ;