|
8 | 8 | ->in(__DIR__); |
9 | 9 |
|
10 | 10 | $rules = [ |
11 | | - '@PSR2' => true, |
12 | | - '@Symfony' => true, |
13 | | - '@PhpCsFixer' => true, |
14 | | - '@PhpCsFixer:risky' => true, |
15 | | - '@PHPUnit75Migration:risky' => true, |
16 | | - '@PHP71Migration:risky' => true, |
17 | | - 'php_unit_dedicate_assert' => ['target' => '5.6'], |
18 | | - 'array_syntax' => ['syntax' => 'short'], |
19 | | - 'no_superfluous_phpdoc_tags' => true, |
20 | | - 'native_function_invocation' => false, |
21 | | - 'concat_space' => ['spacing' => 'one'], |
22 | | - 'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'], |
23 | | - 'single_line_comment_style' => [ |
24 | | - 'comment_types' => ['hash'], |
25 | | - ], |
26 | | - 'phpdoc_summary' => false, |
27 | | - 'cast_spaces' => ['space' => 'none'], |
28 | | - 'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal']], |
29 | | - 'no_unused_imports' => true, |
30 | | - 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']], |
31 | | - 'phpdoc_to_comment' => false, |
32 | | - 'native_constant_invocation' => false, |
33 | | - 'fully_qualified_strict_types' => false, |
| 11 | + '@PER-CS' => true, |
| 12 | + '@Symfony' => true, |
| 13 | + '@PhpCsFixer' => true, |
| 14 | + '@PHPUnit100Migration:risky' => true, |
| 15 | + '@PHP80Migration:risky' => true, |
| 16 | + '@PHP82Migration' => true, |
| 17 | + 'no_superfluous_phpdoc_tags' => true, |
| 18 | + 'native_function_invocation' => false, |
| 19 | + 'concat_space' => ['spacing' => 'one'], |
| 20 | + 'phpdoc_types_order' => ['null_adjustment' => 'always_first', 'sort_algorithm' => 'alpha'], |
| 21 | + 'single_line_comment_style' => ['comment_types' => [ /* 'hash' */],], |
| 22 | + 'phpdoc_summary' => false, |
| 23 | + 'cast_spaces' => ['space' => 'none'], |
| 24 | + 'binary_operator_spaces' => ['default' => null, 'operators' => ['=' => 'align_single_space_minimal', '=>' => 'align_single_space_minimal_by_scope']], |
| 25 | + 'no_unused_imports' => true, |
| 26 | + 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']], |
| 27 | + 'control_structure_braces' => true, |
| 28 | + 'control_structure_continuation_position' => true, |
| 29 | + 'date_time_create_from_format_call' => true, |
| 30 | + 'date_time_immutable' => true, |
| 31 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 32 | + 'phpdoc_line_span' => ['const' => 'single', 'method' => 'single', 'property' => 'single'], |
| 33 | + 'simplified_null_return' => true, |
| 34 | + 'statement_indentation' => true, |
| 35 | + 'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'default', 'exit', 'goto', 'include', 'include_once', 'require', 'require_once', 'return', 'switch']], |
| 36 | + 'simplified_if_return' => true, |
| 37 | + 'use_arrow_functions' => false, |
| 38 | + 'fully_qualified_strict_types' => false, |
| 39 | + 'phpdoc_to_comment' => false, |
34 | 40 | ]; |
35 | | -if (version_compare(PHP_VERSION, '7.3.0', '>=')) { |
36 | | - $rules['@PHP73Migration'] = true; |
37 | | -} |
38 | 41 |
|
39 | 42 | $config = new PhpCsFixer\Config(); |
40 | 43 | $config->setRiskyAllowed(true) |
41 | 44 | ->setRules($rules) |
42 | 45 | ->setFinder($finder); |
43 | 46 |
|
| 47 | +if (class_exists('PhpCsFixer\Runner\Parallel\ParallelConfigFactory')) { |
| 48 | + $config->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()); |
| 49 | +} |
| 50 | + |
| 51 | +if (false) { |
| 52 | + $resolver = new \PhpCsFixer\Console\ConfigurationResolver($config, [], '', new \PhpCsFixer\ToolInfo()); |
| 53 | + echo "\n\n# DUMPING EFFECTIVE RULES #################\n"; |
| 54 | + var_export($resolver->getRules()); |
| 55 | + echo "\n\n###########################################\n"; |
| 56 | + |
| 57 | + die(); |
| 58 | +} |
| 59 | + |
44 | 60 | return $config; |
0 commit comments