|
1 | 1 | <?php declare(strict_types=1); |
2 | 2 |
|
3 | 3 | $finder = PhpCsFixer\Finder::create()->in([ |
4 | | - 'config', |
5 | | - 'database', |
6 | 4 | 'src', |
7 | 5 | 'tests', |
8 | 6 | ]); |
|
11 | 9 | /* |
12 | 10 | * Alias |
13 | 11 | */ |
14 | | - 'array_push' => false, // risky |
| 12 | + 'array_push' => false, |
| 13 | + // risky |
15 | 14 | 'backtick_to_shell_exec' => true, |
16 | | - 'ereg_to_preg' => true, // risky |
17 | | - 'mb_str_functions' => true, // risky |
18 | | - 'no_alias_functions' => ['sets' => ['@all']], // risky |
| 15 | + 'ereg_to_preg' => true, |
| 16 | + // risky |
| 17 | + 'mb_str_functions' => true, |
| 18 | + // risky |
| 19 | + 'no_alias_functions' => ['sets' => ['@all']], |
| 20 | + // risky |
19 | 21 | 'no_alias_language_construct_call' => true, |
20 | 22 | 'no_mixed_echo_print' => ['use' => 'echo'], |
21 | | - 'pow_to_exponentiation' => true, // risky |
22 | | - 'random_api_migration' => true, // risky |
23 | | - 'set_type_to_cast' => true, // risky |
| 23 | + 'pow_to_exponentiation' => true, |
| 24 | + // risky |
| 25 | + 'random_api_migration' => true, |
| 26 | + // risky |
| 27 | + 'set_type_to_cast' => true, |
| 28 | + // risky |
24 | 29 | /* |
25 | 30 | * Array notation |
26 | 31 | */ |
|
42 | 47 | 'position_after_anonymous_constructs' => 'same', |
43 | 48 | ], |
44 | 49 | 'encoding' => true, |
45 | | - 'non_printable_character' => ['use_escape_sequences_in_strings' => true], // risky |
| 50 | + 'non_printable_character' => ['use_escape_sequences_in_strings' => true], |
| 51 | + // risky |
46 | 52 | 'octal_notation' => true, |
47 | | - 'psr_autoloading' => true, // risky |
| 53 | + 'psr_autoloading' => true, |
| 54 | + // risky |
48 | 55 | /* |
49 | 56 | * Casing |
50 | 57 | */ |
|
62 | 69 | */ |
63 | 70 | 'cast_spaces' => ['space' => 'single'], |
64 | 71 | 'lowercase_cast' => true, |
65 | | - 'modernize_types_casting' => true, // risky |
| 72 | + 'modernize_types_casting' => true, |
| 73 | + // risky |
66 | 74 | 'no_short_bool_cast' => true, |
67 | 75 | 'no_unset_cast' => true, |
68 | 76 | 'short_scalar_cast' => true, |
69 | 77 | /* |
70 | 78 | * Class Notation |
71 | 79 | */ |
72 | 80 | //'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none', 'case' => 'none']], // Not yet released |
73 | | - 'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'none']], |
| 81 | + 'class_attributes_separation' => [ |
| 82 | + 'elements' => [ |
| 83 | + 'const' => 'one', |
| 84 | + 'method' => 'one', |
| 85 | + 'property' => 'one', |
| 86 | + 'trait_import' => 'none', |
| 87 | + ], |
| 88 | + ], |
74 | 89 | 'class_definition' => [ |
75 | 90 | 'multi_line_extends_each_single_line' => false, |
76 | 91 | 'single_item_single_line' => false, |
77 | 92 | 'single_line' => false, |
78 | 93 | ], |
79 | | - 'final_class' => false, // risky |
80 | | - 'final_internal_class' => false, //risky |
81 | | - 'final_public_method_for_abstract_class' => false, // risky |
| 94 | + 'final_class' => false, |
| 95 | + // risky |
| 96 | + 'final_internal_class' => false, |
| 97 | + //risky |
| 98 | + 'final_public_method_for_abstract_class' => false, |
| 99 | + // risky |
82 | 100 | 'no_blank_lines_after_class_opening' => true, |
83 | 101 | 'no_null_property_initialization' => false, |
84 | | - 'no_php4_constructor' => true, // risky |
85 | | - 'no_unneeded_final_method' => true, // risky |
| 102 | + 'no_php4_constructor' => true, |
| 103 | + // risky |
| 104 | + 'no_unneeded_final_method' => true, |
| 105 | + // risky |
86 | 106 | 'ordered_class_elements' => ['order' => ['use_trait', 'constant', 'property_static', 'property', 'construct']], |
87 | | - 'ordered_interfaces' => ['order' => 'alpha', 'direction' => 'ascend'], // risky |
88 | | - 'ordered_traits' => true, // risky |
| 107 | + 'ordered_interfaces' => ['order' => 'alpha', 'direction' => 'ascend'], |
| 108 | + // risky |
| 109 | + 'ordered_traits' => true, |
| 110 | + // risky |
89 | 111 | 'protected_to_private' => false, |
90 | | - 'self_accessor' => true, // risky |
| 112 | + 'self_accessor' => true, |
| 113 | + // risky |
91 | 114 | 'self_static_accessor' => true, |
92 | 115 | 'single_class_element_per_statement' => true, |
93 | 116 | 'single_trait_insert_per_statement' => true, |
94 | 117 | 'visibility_required' => ['elements' => ['property', 'method', 'const']], |
95 | 118 | /* |
96 | 119 | * Class Usage |
97 | 120 | */ |
98 | | - 'date_time_immutable' => true, // risky |
| 121 | + 'date_time_immutable' => true, |
| 122 | + // risky |
99 | 123 | /* |
100 | 124 | * Comment |
101 | 125 | */ |
102 | | - 'comment_to_phpdoc' => true, // risky |
| 126 | + 'comment_to_phpdoc' => true, |
| 127 | + // risky |
103 | 128 | 'header_comment' => false, |
104 | 129 | 'multiline_comment_opening_closing' => true, |
105 | 130 | 'no_empty_comment' => true, |
|
109 | 134 | /* |
110 | 135 | * Constant Notation |
111 | 136 | */ |
112 | | - 'native_constant_invocation' => false, // risky |
| 137 | + 'native_constant_invocation' => false, |
| 138 | + // risky |
113 | 139 | /* |
114 | 140 | * Control structures |
115 | 141 | */ |
|
143 | 169 | /* |
144 | 170 | * Function Notation |
145 | 171 | */ |
146 | | - 'combine_nested_dirname' => true, // risky |
147 | | - 'fopen_flag_order' => true, // risky |
148 | | - 'fopen_flags' => ['b_mode' => false], // risky |
| 172 | + 'combine_nested_dirname' => true, |
| 173 | + // risky |
| 174 | + 'fopen_flag_order' => true, |
| 175 | + // risky |
| 176 | + 'fopen_flags' => ['b_mode' => false], |
| 177 | + // risky |
149 | 178 | 'function_declaration' => ['closure_function_spacing' => 'one'], |
150 | 179 | 'function_typehint_space' => true, |
151 | | - 'implode_call' => true, // risky |
| 180 | + 'implode_call' => true, |
| 181 | + // risky |
152 | 182 | 'lambda_not_used_import' => true, |
153 | 183 | 'method_argument_space' => [ |
154 | 184 | 'keep_multiple_spaces_after_comma' => false, |
|
165 | 195 | 'no_unreachable_default_argument_value' => true, |
166 | 196 | 'no_useless_sprintf' => true, |
167 | 197 | 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], |
168 | | - 'phpdoc_to_param_type' => false, // experimental, risky |
169 | | - 'phpdoc_to_property_type' => false, // experimental, risky |
170 | | - 'phpdoc_to_return_type' => false, // experimental, risky |
171 | | - 'regular_callable_call' => true, // risky |
| 198 | + 'phpdoc_to_param_type' => false, |
| 199 | + // experimental, risky |
| 200 | + 'phpdoc_to_property_type' => false, |
| 201 | + // experimental, risky |
| 202 | + 'phpdoc_to_return_type' => false, |
| 203 | + // experimental, risky |
| 204 | + 'regular_callable_call' => true, |
| 205 | + // risky |
172 | 206 | 'return_type_declaration' => true, |
173 | 207 | 'single_line_throw' => false, |
174 | | - 'static_lambda' => false, // risky |
175 | | - 'use_arrow_functions' => false, // risky |
176 | | - 'void_return' => true, // risky |
| 208 | + 'static_lambda' => false, |
| 209 | + // risky |
| 210 | + 'use_arrow_functions' => false, |
| 211 | + // risky |
| 212 | + 'void_return' => true, |
| 213 | + // risky |
177 | 214 | /* |
178 | 215 | * Import |
179 | 216 | */ |
|
194 | 231 | 'combine_consecutive_unsets' => true, |
195 | 232 | 'declare_equal_normalize' => ['space' => 'none'], |
196 | 233 | 'declare_parentheses' => true, |
197 | | - 'dir_constant' => true, // risky |
| 234 | + 'dir_constant' => true, |
| 235 | + // risky |
198 | 236 | 'error_suppression' => false, |
199 | 237 | 'explicit_indirect_variable' => true, |
200 | 238 | 'function_to_constant' => [ |
|
206 | 244 | 'phpversion', |
207 | 245 | 'pi', |
208 | 246 | ], |
209 | | - ], // risky |
210 | | - 'get_class_to_class_keyword' => true, // risky |
| 247 | + ], |
| 248 | + // risky |
| 249 | + 'get_class_to_class_keyword' => true, |
| 250 | + // risky |
211 | 251 | 'is_null' => true, |
212 | | - 'no_unset_on_property' => false, // risky |
| 252 | + 'no_unset_on_property' => false, |
| 253 | + // risky |
213 | 254 | 'single_space_after_construct' => true, |
214 | 255 | /* |
215 | 256 | * List Notation |
|
226 | 267 | /* |
227 | 268 | * Naming |
228 | 269 | */ |
229 | | - 'no_homoglyph_names' => false, // risky |
| 270 | + 'no_homoglyph_names' => false, |
| 271 | + // risky |
230 | 272 | /* |
231 | 273 | * Operator |
232 | 274 | */ |
|
243 | 285 | 'operator_linebreak' => ['only_booleans' => true, 'position' => 'beginning'], |
244 | 286 | 'standardize_increment' => false, |
245 | 287 | 'standardize_not_equals' => true, |
246 | | - 'ternary_to_elvis_operator' => true, // risky |
| 288 | + 'ternary_to_elvis_operator' => true, |
| 289 | + // risky |
247 | 290 | 'ternary_to_null_coalescing' => true, |
248 | 291 | 'unary_operator_spaces' => true, |
249 | 292 | /* |
|
257 | 300 | /* |
258 | 301 | * PHPUnit |
259 | 302 | */ |
260 | | - 'php_unit_construct' => true, // risky |
261 | | - 'php_unit_dedicate_assert' => true, // risky |
262 | | - 'php_unit_dedicate_assert_internal_type' => true, //risky |
263 | | - 'php_unit_expectation' => true, // risky |
| 303 | + 'php_unit_construct' => true, |
| 304 | + // risky |
| 305 | + 'php_unit_dedicate_assert' => true, |
| 306 | + // risky |
| 307 | + 'php_unit_dedicate_assert_internal_type' => true, |
| 308 | + //risky |
| 309 | + 'php_unit_expectation' => true, |
| 310 | + // risky |
264 | 311 | 'php_unit_fqcn_annotation' => true, |
265 | 312 | 'php_unit_internal_class' => false, |
266 | 313 | 'php_unit_method_casing' => ['case' => 'camel_case'], |
267 | | - 'php_unit_mock' => true, // risky |
268 | | - 'php_unit_mock_short_will_return' => true, // risky |
269 | | - 'php_unit_namespaced' => true, // risky |
270 | | - 'php_unit_no_expectation_annotation' => true, // risky |
271 | | - 'php_unit_set_up_tear_down_visibility' => true, // risky |
| 314 | + 'php_unit_mock' => true, |
| 315 | + // risky |
| 316 | + 'php_unit_mock_short_will_return' => true, |
| 317 | + // risky |
| 318 | + 'php_unit_namespaced' => true, |
| 319 | + // risky |
| 320 | + 'php_unit_no_expectation_annotation' => true, |
| 321 | + // risky |
| 322 | + 'php_unit_set_up_tear_down_visibility' => true, |
| 323 | + // risky |
272 | 324 | 'php_unit_size_class' => false, |
273 | | - 'php_unit_strict' => false, // risky |
274 | | - 'php_unit_test_annotation' => ['style' => 'annotation'], // risky |
275 | | - 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], // risky |
| 325 | + 'php_unit_strict' => false, |
| 326 | + // risky |
| 327 | + 'php_unit_test_annotation' => ['style' => 'annotation'], |
| 328 | + // risky |
| 329 | + 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], |
| 330 | + // risky |
276 | 331 | 'php_unit_test_class_requires_covers' => true, |
277 | 332 | /* |
278 | 333 | * PHPDoc |
|
344 | 399 | /* |
345 | 400 | * Strict |
346 | 401 | */ |
347 | | - 'declare_strict_types' => true, // risky |
348 | | - 'strict_comparison' => false, // risky |
349 | | - 'strict_param' => false, // risky |
| 402 | + 'declare_strict_types' => true, |
| 403 | + // risky |
| 404 | + 'strict_comparison' => false, |
| 405 | + // risky |
| 406 | + 'strict_param' => false, |
| 407 | + // risky |
350 | 408 | /* |
351 | 409 | * String Notation |
352 | 410 | */ |
353 | 411 | 'escape_implicit_backslashes' => ['single_quoted' => false, 'double_quoted' => true, 'heredoc_syntax' => true], |
354 | 412 | 'explicit_string_variable' => true, |
355 | 413 | 'heredoc_to_nowdoc' => true, |
356 | 414 | 'no_binary_string' => true, |
357 | | - 'no_trailing_whitespace_in_string' => false, // risky |
| 415 | + 'no_trailing_whitespace_in_string' => false, |
| 416 | + // risky |
358 | 417 | 'simple_to_complex_string_variable' => true, |
359 | 418 | 'single_quote' => true, |
360 | 419 | 'string_length_to_empty' => true, |
361 | | - 'string_line_ending' => false, // risky |
| 420 | + 'string_line_ending' => false, |
| 421 | + // risky |
362 | 422 | /* |
363 | 423 | * Whitespace |
364 | 424 | */ |
|
0 commit comments