|
1 | 1 | <?php |
2 | 2 |
|
3 | | -return PhpCsFixer\Config::create() |
| 3 | +return (new PhpCsFixer\Config()) |
4 | 4 | ->setUsingCache(false) |
5 | 5 | ->setRiskyAllowed(true) |
6 | | - //->setCacheFile(__DIR__ . '/.php_cs.cache') |
7 | | - ->setRules([ |
8 | | - '@PSR1' => true, |
9 | | - '@PSR2' => true, |
10 | | - '@Symfony' => true, |
11 | | - 'psr4' => true, |
12 | | - // custom rules |
13 | | - 'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5 |
14 | | - 'phpdoc_to_comment' => false, |
15 | | - 'no_superfluous_phpdoc_tags' => false, |
16 | | - 'array_indentation' => true, |
17 | | - 'array_syntax' => ['syntax' => 'short'], |
18 | | - 'cast_spaces' => ['space' => 'none'], |
19 | | - 'concat_space' => ['spacing' => 'one'], |
20 | | - 'compact_nullable_typehint' => true, |
21 | | - 'declare_equal_normalize' => ['space' => 'single'], |
22 | | - 'increment_style' => ['style' => 'post'], |
23 | | - 'list_syntax' => ['syntax' => 'short'], |
24 | | - 'no_short_echo_tag' => true, |
25 | | - 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], |
26 | | - 'phpdoc_align' => false, |
27 | | - 'phpdoc_no_empty_return' => false, |
28 | | - 'phpdoc_order' => true, // psr-5 |
29 | | - 'phpdoc_no_useless_inheritdoc' => false, |
30 | | - 'protected_to_private' => false, |
31 | | - 'yoda_style' => false, |
32 | | - 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], |
33 | | - 'ordered_imports' => [ |
34 | | - 'sort_algorithm' => 'alpha', |
35 | | - 'imports_order' => ['class', 'const', 'function'] |
36 | | - ], |
37 | | - 'single_line_throw' => false, |
38 | | - ]) |
39 | | - ->setFinder(PhpCsFixer\Finder::create() |
40 | | - ->in(__DIR__ . '/src') |
41 | | - ->in(__DIR__ . '/tests') |
42 | | - ->name('*.php') |
43 | | - ->ignoreDotFiles(true) |
44 | | - ->ignoreVCS(true)); |
| 6 | + ->setRules( |
| 7 | + [ |
| 8 | + '@PSR1' => true, |
| 9 | + '@PSR2' => true, |
| 10 | + '@Symfony' => true, |
| 11 | + 'psr_autoloading' => true, |
| 12 | + // custom rules |
| 13 | + 'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5 |
| 14 | + 'phpdoc_to_comment' => false, |
| 15 | + 'no_superfluous_phpdoc_tags' => false, |
| 16 | + 'array_indentation' => true, |
| 17 | + 'array_syntax' => ['syntax' => 'short'], |
| 18 | + 'cast_spaces' => ['space' => 'none'], |
| 19 | + 'concat_space' => ['spacing' => 'one'], |
| 20 | + 'compact_nullable_typehint' => true, |
| 21 | + 'declare_equal_normalize' => ['space' => 'single'], |
| 22 | + 'increment_style' => ['style' => 'post'], |
| 23 | + 'list_syntax' => ['syntax' => 'short'], |
| 24 | + 'echo_tag_syntax' => ['format' => 'long'], |
| 25 | + 'phpdoc_add_missing_param_annotation' => ['only_untyped' => false], |
| 26 | + 'phpdoc_align' => false, |
| 27 | + 'phpdoc_no_empty_return' => false, |
| 28 | + 'phpdoc_order' => true, // psr-5 |
| 29 | + 'phpdoc_no_useless_inheritdoc' => false, |
| 30 | + 'protected_to_private' => false, |
| 31 | + 'yoda_style' => false, |
| 32 | + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], |
| 33 | + 'ordered_imports' => [ |
| 34 | + 'sort_algorithm' => 'alpha', |
| 35 | + 'imports_order' => ['class', 'const', 'function'] |
| 36 | + ], |
| 37 | + 'single_line_throw' => false, |
| 38 | + ] |
| 39 | + ) |
| 40 | + ->setFinder( |
| 41 | + PhpCsFixer\Finder::create() |
| 42 | + ->in(__DIR__ . '/src') |
| 43 | + ->in(__DIR__ . '/tests') |
| 44 | + ->name('*.php') |
| 45 | + ->ignoreDotFiles(true) |
| 46 | + ->ignoreVCS(true) |
| 47 | + ); |
0 commit comments