.php_cs.dist 1.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

$finder = PhpCsFixer\Finder::create()
    ->exclude('ACP3/Modules/ACP3/Filemanager/libraries')
    ->exclude('build')
    ->exclude('cache')
    ->exclude('designs')
    ->exclude('node_modules')
    ->exclude('uploads')
    ->exclude('vendor')
    ->in(__DIR__);

13 14 15 16 17
$header = <<<DOCBLOCK
Copyright (c) by the ACP3 Developers.
See the LICENSE file at the top-level module directory for licensing details.
DOCBLOCK;

18
return PhpCsFixer\Config::create()
19 20
    ->setRiskyAllowed(true)
    ->setLineEnding("\n")
21
    ->setRules([
22
        '@Symfony' => true,
23
        'array_syntax' => ['syntax' => 'short'],
24
        'class_attributes_separation' => ['elements' => ['method']],
25
        'concat_space' => ['spacing' => 'one'],
26
        'declare_equal_normalize' => ['space' => 'single'],
27 28 29 30
        'header_comment' => [
            'commentType' => 'PHPDoc',
            'header' => $header,
        ],
31 32
        'method_chaining_indentation' => true,
        'modernize_types_casting' => true,
33 34 35 36 37 38
        'native_function_invocation' => true,
        'no_null_property_initialization' => true,
        'no_useless_else' => true,
        'no_useless_return' => true,
        'ordered_imports' => ['importsOrder' => null],
        'ternary_to_null_coalescing' => true,
39
        'yoda_style' => false,
40 41 42
    ])
    ->setFinder($finder)
;