|
1 | 1 | <?php |
2 | 2 |
|
3 | | -$finder = Symfony\CS\Finder\DefaultFinder::create(); |
| 3 | +$finder = PhpCsFixer\Finder::create(); |
4 | 4 | $finder->in([ |
5 | 5 | __DIR__ . '/src', |
6 | 6 | __DIR__ . '/tests/integration', |
7 | 7 | __DIR__ . '/tests/unit' |
8 | 8 | ]); |
9 | 9 |
|
10 | | -$config = Symfony\CS\Config\Config::create(); |
11 | | -$config->setUsingCache(true); |
12 | | -$config->setUsingLinter(false); |
13 | | -$config->finder($finder); |
14 | | -$config->level(Symfony\CS\FixerInterface::PSR2_LEVEL); |
15 | | -$config->fixers([ |
16 | | - //symfony |
17 | | - 'double_arrow_multiline_whitespaces', |
18 | | - 'duplicate_semicolon', |
19 | | - 'empty_return', |
20 | | - 'extra_empty_lines', |
21 | | - 'include', |
22 | | - 'join_function', |
23 | | - 'multiline_array_trailing_comma', |
24 | | - 'namespace_no_leading_whitespace', |
25 | | - 'new_with_braces', |
26 | | - 'no_blank_lines_after_class_opening', |
27 | | - 'object_operator', |
28 | | - 'operators_spaces', |
29 | | - 'phpdoc_indent', |
30 | | - 'phpdoc_params', |
31 | | - 'remove_leading_slash_use', |
32 | | - 'remove_lines_between_uses', |
33 | | - 'return', |
34 | | - 'single_array_no_trailing_comma', |
35 | | - 'spaces_before_semicolon', |
36 | | - 'spaces_cast', |
37 | | - 'standardize_not_equal', |
38 | | - 'ternary_spaces', |
39 | | - 'unused_use', |
40 | | - 'whitespacy_lines', |
41 | | - |
42 | | - //contrib |
43 | | - 'align_double_arrow', |
44 | | - 'align_equals', |
45 | | - 'concat_with_spaces', |
46 | | - 'multiline_spaces_before_semicolon', |
47 | | - 'ordered_use', |
48 | | - 'short_array_syntax', |
49 | | -]); |
| 10 | +$config = PhpCsFixer\Config::create() |
| 11 | +->setUsingCache(true) |
| 12 | +->setRiskyAllowed(true) |
| 13 | +->setFinder($finder) |
| 14 | +->setRules([ |
| 15 | + '@PSR1' => true, |
| 16 | + '@PSR2' => true, |
| 17 | + '@Symfony' => true, |
| 18 | + '@Symfony:risky' => true, |
| 19 | + '@PhpCsFixer' => true, |
| 20 | + 'align_multiline_comment' => true, |
| 21 | + 'array_syntax' => ['syntax' => 'short'], |
| 22 | + 'declare_strict_types' => false, |
| 23 | + 'return_assignment' => false, |
| 24 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], |
| 25 | + 'dir_constant' => true, |
| 26 | + 'elseif' => false, |
| 27 | + 'ereg_to_preg' => true, |
| 28 | + 'is_null' => true, |
| 29 | + 'list_syntax' => ['syntax' => 'short'], |
| 30 | + 'mb_str_functions' => true, |
| 31 | + 'phpdoc_order' => true, |
| 32 | + 'concat_space' => ['spacing' => 'one'], |
| 33 | + 'yoda_style' => [ |
| 34 | + 'equal' => false, |
| 35 | + 'identical' => false, |
| 36 | + 'less_and_greater' => false, |
| 37 | + ], |
| 38 | + 'fully_qualified_strict_types' => true, |
| 39 | + 'global_namespace_import' => [ |
| 40 | + 'import_classes' => true, |
| 41 | + ], |
| 42 | + 'phpdoc_to_comment' => false, |
| 43 | + 'method_argument_space' => ['on_multiline' => 'ignore'], |
| 44 | + 'php_unit_ordered_covers' => false, |
| 45 | + 'no_superfluous_elseif' => false, |
| 46 | +] |
| 47 | +); |
50 | 48 |
|
51 | 49 | return $config; |
0 commit comments