|
13 | 13 | return (new PhpCsFixer\Config())
|
14 | 14 | ->setRules([
|
15 | 15 | '@PSR2' => true,
|
| 16 | + '@PSR12' => true, |
| 17 | + 'array_indentation' => true, |
16 | 18 | 'array_syntax' => ['syntax' => 'short'],
|
17 |
| - 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
18 |
| - 'no_unused_imports' => true, |
19 |
| - 'not_operator_with_successor_space' => true, |
20 |
| - 'trailing_comma_in_multiline' => true, |
21 |
| - 'phpdoc_scalar' => true, |
22 |
| - 'unary_operator_spaces' => true, |
23 |
| - 'binary_operator_spaces' => true, |
| 19 | + 'binary_operator_spaces' => [ |
| 20 | + 'default' => 'single_space', |
| 21 | + 'operators' => ['=>' => 'single_space'] |
| 22 | + ], |
24 | 23 | 'blank_line_before_statement' => [
|
25 | 24 | 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
|
26 | 25 | ],
|
27 |
| - 'phpdoc_single_line_var_spacing' => true, |
28 |
| - 'phpdoc_var_without_name' => true, |
| 26 | + 'cast_spaces' => true, |
| 27 | + 'class_attributes_separation' => [ |
| 28 | + 'elements' => ['method'] |
| 29 | + ], |
| 30 | + 'concat_space' => [ |
| 31 | + 'spacing' => 'none' |
| 32 | + ], |
| 33 | + 'encoding' => true, |
| 34 | + 'full_opening_tag' => true, |
| 35 | + 'fully_qualified_strict_types' => true, // added by Shift |
| 36 | + 'function_typehint_space' => true, |
| 37 | + 'heredoc_to_nowdoc' => true, |
| 38 | + 'include' => true, |
| 39 | + 'increment_style' => ['style' => 'post'], |
| 40 | + 'linebreak_after_opening_tag' => true, |
| 41 | + 'lowercase_constants' => true, |
| 42 | + 'magic_method_casing' => true, // added from Symfony |
| 43 | + 'magic_constant_casing' => true, |
29 | 44 | 'method_argument_space' => [
|
30 | 45 | 'on_multiline' => 'ensure_fully_multiline',
|
31 | 46 | 'keep_multiple_spaces_after_comma' => true,
|
32 | 47 | ],
|
| 48 | + 'native_function_casing' => true, |
| 49 | + 'no_alias_functions' => true, |
| 50 | + 'no_extra_blank_lines' => [ |
| 51 | + 'tokens' => [ |
| 52 | + 'extra', |
| 53 | + 'throw', |
| 54 | + 'use', |
| 55 | + 'use_trait', |
| 56 | + ] |
| 57 | + ], |
| 58 | + 'no_blank_lines_after_phpdoc' => true, |
| 59 | + 'no_closing_tag' => true, |
| 60 | + 'no_empty_phpdoc' => true, |
| 61 | + 'no_empty_statement' => true, |
| 62 | + 'no_leading_namespace_whitespace' => true, |
| 63 | + 'no_mixed_echo_print' => [ |
| 64 | + 'use' => 'echo' |
| 65 | + ], |
| 66 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 67 | + 'multiline_whitespace_before_semicolons' => [ |
| 68 | + 'strategy' => 'no_multi_line' |
| 69 | + ], |
| 70 | + 'no_short_bool_cast' => true, |
| 71 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 72 | + 'no_spaces_around_offset' => true, |
| 73 | + 'no_superfluous_phpdoc_tags' => true, |
| 74 | + 'no_trailing_comma_in_list_call' => true, |
| 75 | + 'no_trailing_comma_in_singleline_array' => true, |
| 76 | + 'no_unneeded_control_parentheses' => true, |
| 77 | + 'no_unreachable_default_argument_value' => true, |
| 78 | + 'no_unused_imports' => true, |
| 79 | + 'no_useless_return' => true, |
| 80 | + 'no_whitespace_before_comma_in_array' => true, |
| 81 | + 'normalize_index_brace' => true, |
| 82 | + 'not_operator_with_successor_space' => true, |
| 83 | + 'nullable_type_declaration_for_default_null_value' => true, |
| 84 | + 'object_operator_without_whitespace' => true, |
| 85 | + 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
| 86 | + 'phpdoc_indent' => true, |
| 87 | + 'phpdoc_inline_tag' => true, |
| 88 | + 'phpdoc_no_access' => true, |
| 89 | + 'phpdoc_no_package' => true, |
| 90 | + 'phpdoc_no_useless_inheritdoc' => true, |
| 91 | + 'phpdoc_scalar' => true, |
| 92 | + 'phpdoc_single_line_var_spacing' => true, |
| 93 | + 'phpdoc_summary' => true, |
| 94 | + 'phpdoc_to_comment' => true, |
| 95 | + 'phpdoc_trim' => true, |
| 96 | + 'phpdoc_types' => true, |
| 97 | + 'phpdoc_var_without_name' => true, |
| 98 | + 'psr4' => true, |
| 99 | + 'self_accessor' => true, |
| 100 | + 'simplified_null_return' => false, // disabled by Shift |
| 101 | + 'single_line_comment_style' => [ |
| 102 | + 'comment_types' => ['hash'] |
| 103 | + ], |
| 104 | + 'single_quote' => true, |
33 | 105 | 'single_trait_insert_per_statement' => true,
|
| 106 | + 'space_after_semicolon' => true, |
| 107 | + 'standardize_not_equals' => true, |
| 108 | + 'ternary_to_null_coalescing' => true, |
| 109 | + 'trailing_comma_in_multiline' => true, |
| 110 | + 'trim_array_spaces' => true, |
| 111 | + 'unary_operator_spaces' => true, |
| 112 | + 'use_arrow_functions' => true, |
| 113 | + 'whitespace_after_comma_in_array' => true, |
34 | 114 | ])
|
35 | 115 | ->setFinder($finder);
|
0 commit comments