mll-lab/php-cs-fixer-config

Shared rules for php-cs-fixer

v4.4.1 2021-12-05 21:27 UTC

README

Shared configuration for php-cs-fixer

GitHub license Packagist Packagist

Installation

composer require --dev mll-lab/php-cs-fixer-config

Usage

In your .php-cs-fixer.php:

<?php declare(strict_types=1);

use function MLL\PhpCsFixerConfig\config;

$finder = PhpCsFixer\Finder::create()
    ->notPath('vendor')
    ->in(__DIR__)
    ->name('*.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return config($finder);

Enable risky rules:

use function MLL\PhpCsFixerConfig\risky;

return risky($finder);

Override rules:

return config($finder, [
    'some_rule' => false,
]);

Customize config:

return config($finder)
    ->setHideProgress(true);