@@ -6,6 +6,8 @@ declare(strict_types=1);
6
6
* List of available rules: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/index.rst
7
7
*/
8
8
$rules = [
9
+ '@PSR12' => true,
10
+ '@PHP81Migration' => true,
9
11
'array_syntax' => ['syntax' => 'short'],
10
12
'binary_operator_spaces' => [
11
13
'default' => 'single_space',
@@ -15,8 +17,6 @@ $rules = [
15
17
'|' => 'no_space'
16
18
],
17
19
],
18
- 'blank_line_after_namespace' => true,
19
- 'blank_line_after_opening_tag' => true,
20
20
'blank_line_before_statement' => [
21
21
'statements' => [
22
22
'break',
@@ -27,7 +27,6 @@ $rules = [
27
27
'try',
28
28
],
29
29
],
30
- 'braces' => true,
31
30
'cast_spaces' => true,
32
31
'class_attributes_separation' => [
33
32
'elements' => [
@@ -36,38 +35,23 @@ $rules = [
36
35
'property' => 'one',
37
36
],
38
37
],
39
- 'class_definition' => true ,
38
+ 'class_definition' => ['space_before_parenthesis' => false] ,
40
39
'concat_space' => ['spacing' => 'none'],
41
- 'constant_case' => ['case' => 'lower'],
42
- 'declare_equal_normalize' => true,
43
40
'declare_strict_types' => true,
44
41
'echo_tag_syntax' => ['format' => 'long'],
45
- 'elseif' => true,
46
- 'encoding' => true,
47
42
'final_internal_class' => true,
48
- 'full_opening_tag' => true,
49
43
'fully_qualified_strict_types' => true,
50
- 'function_declaration' => true,
51
44
'function_typehint_space' => true,
52
45
'heredoc_to_nowdoc' => true,
53
46
'include' => true,
54
- 'increment_style' => ['style' => 'post'],
55
- 'indentation_type' => true,
47
+ 'increment_style' => ['style' => 'pre'],
56
48
'linebreak_after_opening_tag' => true,
57
- 'line_ending' => true,
58
- 'lowercase_cast' => true,
59
- 'lowercase_keywords' => true,
60
- 'lowercase_static_reference' => true,
61
49
'magic_method_casing' => true,
62
50
'magic_constant_casing' => true,
63
- 'method_argument_space' => true,
64
51
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
65
52
'native_function_casing' => true,
66
- 'new_with_braces' => true,
67
53
'no_alias_functions' => true,
68
- 'no_blank_lines_after_class_opening' => true,
69
54
'no_blank_lines_after_phpdoc' => true,
70
- 'no_closing_tag' => true,
71
55
'no_empty_phpdoc' => true,
72
56
'no_empty_statement' => true,
73
57
'no_extra_blank_lines' => [
@@ -78,21 +62,16 @@ $rules = [
78
62
'use_trait',
79
63
],
80
64
],
81
- 'no_leading_import_slash' => true,
82
65
'no_leading_namespace_whitespace' => true,
83
66
'no_mixed_echo_print' => ['use' => 'echo'],
84
67
'no_multiline_whitespace_around_double_arrow' => true,
85
68
'no_short_bool_cast' => true,
86
69
'no_singleline_whitespace_before_semicolons' => true,
87
- 'no_spaces_after_function_name' => true,
88
70
'no_spaces_around_offset' => [
89
71
'positions' => ['inside'],
90
72
],
91
- 'no_spaces_inside_parenthesis' => true,
92
73
'no_trailing_comma_in_list_call' => true,
93
74
'no_trailing_comma_in_singleline_array' => true,
94
- 'no_trailing_whitespace' => true,
95
- 'no_trailing_whitespace_in_comment' => true,
96
75
'no_unneeded_control_parentheses' => [
97
76
'statements' => [
98
77
'break',
@@ -109,11 +88,13 @@ $rules = [
109
88
'no_useless_else' => true,
110
89
'no_useless_return' => true,
111
90
'no_whitespace_before_comma_in_array' => true,
112
- 'no_whitespace_in_blank_line' => true,
113
91
'normalize_index_brace' => true,
114
92
'not_operator_with_successor_space' => true,
115
93
'object_operator_without_whitespace' => true,
116
- 'ordered_imports' => ['sort_algorithm' => 'alpha'],
94
+ 'ordered_imports' => [
95
+ 'imports_order' => ['class', 'function', 'const'],
96
+ 'sort_algorithm' => 'alpha',
97
+ ],
117
98
'php_unit_strict' => true,
118
99
'php_unit_test_class_requires_covers' => true,
119
100
'phpdoc_add_missing_param_annotation' => true,
@@ -134,42 +115,26 @@ $rules = [
134
115
'psr_autoloading' => true,
135
116
'self_accessor' => true,
136
117
'semicolon_after_instruction' => true,
137
- 'short_scalar_cast' => true,
138
118
'simplified_null_return' => true,
139
- 'single_blank_line_at_eof' => true,
140
- 'single_blank_line_before_namespace' => true,
141
119
'single_class_element_per_statement' => [
142
120
'elements' => [
143
121
'const',
144
122
'property',
145
123
],
146
124
],
147
- 'single_import_per_statement' => true,
148
- 'single_line_after_imports' => true,
149
125
'single_line_comment_style' => [
150
126
'comment_types' => ['hash'],
151
127
],
152
128
'single_quote' => true,
153
- 'single_trait_insert_per_statement' => true,
154
129
'space_after_semicolon' => true,
155
130
'standardize_not_equals' => true,
156
131
'strict_comparison' => true,
157
132
'strict_param' => true,
158
- 'switch_case_semicolon_to_colon' => true,
159
- 'switch_case_space' => true,
160
- 'ternary_operator_spaces' => true,
161
133
'trailing_comma_in_multiline' => [
162
134
'elements' => ['arrays'],
163
135
],
164
136
'trim_array_spaces' => true,
165
137
'unary_operator_spaces' => true,
166
- 'visibility_required' => [
167
- 'elements' => [
168
- 'property',
169
- 'method',
170
- 'const',
171
- ],
172
- ],
173
138
'whitespace_after_comma_in_array' => true,
174
139
];
175
140
@@ -185,8 +150,7 @@ $finder = PhpCsFixer\Finder::create()
185
150
->ignoreDotFiles(true)
186
151
->ignoreVCS(true);
187
152
188
- $config = new PhpCsFixer\Config();
189
- return $config
153
+ return (new PhpCsFixer\Config())
190
154
->setFinder($finder)
191
155
->setRules($rules)
192
156
->setRiskyAllowed(true)
0 commit comments