Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.1 KB

advanced_configuration.md

File metadata and controls

44 lines (34 loc) · 1.1 KB

Advanced Configuration

You can find the full documentation on this page:

<?php

use PhpCsFixer\Finder;
use Realodix\Relax\Config;
use Vendor\Package\MyRuleSet;

// You can add or override rule set
$localRules = [
    // Add rule
    'array_syntax' => true,

    // Add rule or override predefined rule
    'visibility_required' => true,

    // Override predefined rule
    'braces' => false,

    // Add custom fixers
    'CustomFixer/rule_1' => true,
    'CustomFixer/rule_2' => true,
];

$finder = Finder::create()
    ->in(__DIR__)
    ->ignoreDotFiles(false)
    ->exclude(['Bar'])
    ->notName('*.foo.php')
    ->append(['.php-cs-fixer.dist.php']);

return Config::create(new MyRuleSet)
    ->setRules($localRules)
    ->setFinder($finder)
    ->setRiskyAllowed(false)
    ->registerCustomFixers(/* ... */);