|
30 | 30 | ->setRiskyAllowed(true)
|
31 | 31 | ->setRules([
|
32 | 32 | '@DoctrineAnnotation' => true,
|
33 |
| - '@PER' => true, |
34 |
| - '@PSR2' => true, |
| 33 | + // @todo: Switch to @PER-CS2.0 once php-cs-fixer's todo list is done: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/7247 |
| 34 | + '@PER-CS1.0' => true, |
| 35 | + 'array_indentation' => true, |
35 | 36 | 'array_syntax' => ['syntax' => 'short'],
|
36 |
| - 'blank_line_after_opening_tag' => true, |
37 |
| - 'braces' => ['allow_single_line_closure' => true], |
| 37 | + 'braces_position' => true, |
38 | 38 | 'cast_spaces' => ['space' => 'none'],
|
39 |
| - 'compact_nullable_typehint' => true, |
| 39 | + // @todo: Can be dropped once we enable @PER-CS2.0 |
| 40 | + 'compact_nullable_type_declaration' => true, |
40 | 41 | 'concat_space' => ['spacing' => 'one'],
|
| 42 | + 'control_structure_braces' => true, |
| 43 | + 'control_structure_continuation_position' => true, |
41 | 44 | 'declare_equal_normalize' => ['space' => 'none'],
|
| 45 | + 'declare_parentheses' => true, |
42 | 46 | 'dir_constant' => true,
|
| 47 | + // @todo: Can be dropped once we enable @PER-CS2.0 |
| 48 | + 'function_declaration' => [ |
| 49 | + 'closure_fn_spacing' => 'none', |
| 50 | + ], |
43 | 51 | 'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
|
44 |
| - 'function_typehint_space' => true, |
| 52 | + 'type_declaration_spaces' => true, |
| 53 | + 'global_namespace_import' => ['import_classes' => false, 'import_constants' => false, 'import_functions' => false], |
45 | 54 | 'header_comment' => [
|
46 | 55 | 'header' => $headerComment,
|
47 | 56 | 'comment_type' => 'comment',
|
| 57 | + 'location' => 'after_declare_strict', |
48 | 58 | 'separate' => 'both',
|
49 |
| - 'location' => 'after_declare_strict' |
50 | 59 | ],
|
51 |
| - 'lowercase_cast' => true, |
52 |
| - 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], |
| 60 | + 'list_syntax' => ['syntax' => 'short'], |
| 61 | + // @todo: Can be dropped once we enable @PER-CS2.0 |
| 62 | + 'method_argument_space' => true, |
53 | 63 | 'modernize_strpos' => true,
|
54 | 64 | 'modernize_types_casting' => true,
|
55 | 65 | 'native_function_casing' => true,
|
56 |
| - 'new_with_braces' => true, |
| 66 | + 'new_with_parentheses' => true, |
57 | 67 | 'no_alias_functions' => true,
|
58 | 68 | 'no_blank_lines_after_phpdoc' => true,
|
59 | 69 | 'no_empty_phpdoc' => true,
|
60 | 70 | 'no_empty_statement' => true,
|
61 | 71 | 'no_extra_blank_lines' => true,
|
62 |
| - 'no_leading_import_slash' => true, |
63 | 72 | 'no_leading_namespace_whitespace' => true,
|
| 73 | + 'no_multiple_statements_per_line' => true, |
64 | 74 | 'no_null_property_initialization' => true,
|
65 | 75 | 'no_short_bool_cast' => true,
|
66 | 76 | 'no_singleline_whitespace_before_semicolons' => true,
|
|
70 | 80 | 'no_unused_imports' => true,
|
71 | 81 | 'no_useless_else' => true,
|
72 | 82 | 'no_useless_nullsafe_operator' => true,
|
73 |
| - 'no_whitespace_in_blank_line' => true, |
74 |
| - 'ordered_imports' => true, |
| 83 | + 'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'], |
75 | 84 | 'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
|
76 | 85 | 'php_unit_mock_short_will_return' => true,
|
77 | 86 | 'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
|
|
84 | 93 | 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
|
85 | 94 | 'return_type_declaration' => ['space_before' => 'none'],
|
86 | 95 | 'single_quote' => true,
|
| 96 | + 'single_space_around_construct' => true, |
87 | 97 | 'single_line_comment_style' => ['comment_types' => ['hash']],
|
88 |
| - 'single_trait_insert_per_statement' => true, |
| 98 | + // @todo: Can be dropped once we enable @PER-CS2.0 |
| 99 | + 'single_line_empty_body' => true, |
| 100 | + 'statement_indentation' => true, |
89 | 101 | 'trailing_comma_in_multiline' => ['elements' => ['arrays']],
|
90 | 102 | 'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
|
91 | 103 | 'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
|
|
0 commit comments