|
9 | 9 | $config |
10 | 10 | ->setRiskyAllowed(true) |
11 | 11 | ->setFinder($finder) |
| 12 | + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect(null, 600)) |
12 | 13 | ->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer' . preg_replace('~\W~', '-', __DIR__)) |
13 | 14 | ->setRules([ |
14 | 15 | 'align_multiline_comment' => true, |
|
18 | 19 | 'binary_operator_spaces' => true, |
19 | 20 | 'blank_line_after_namespace' => true, |
20 | 21 | 'blank_line_after_opening_tag' => true, |
21 | | - 'blank_line_before_statement' => true, |
| 22 | + 'blank_line_before_statement' => false, |
| 23 | + 'blank_lines_before_namespace' => ['max_line_breaks' => 2, 'min_line_breaks' => 2], // we want 1 blank line before namespace |
22 | 24 | 'cast_spaces' => true, |
23 | 25 | 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const |
24 | 26 | 'class_definition' => false, |
25 | 27 | 'combine_consecutive_issets' => true, |
26 | 28 | 'combine_consecutive_unsets' => true, |
27 | 29 | 'combine_nested_dirname' => true, |
28 | 30 | 'comment_to_phpdoc' => false, // interferes with annotations |
29 | | - 'compact_nullable_typehint' => true, |
| 31 | + 'compact_nullable_type_declaration' => true, |
30 | 32 | 'concat_space' => ['spacing' => 'one'], |
31 | 33 | 'constant_case' => true, |
32 | 34 | 'date_time_immutable' => false, // Break our unit tests |
|
40 | 42 | 'elseif' => true, |
41 | 43 | 'encoding' => true, |
42 | 44 | 'ereg_to_preg' => true, |
43 | | - 'escape_implicit_backslashes' => true, |
44 | 45 | 'explicit_indirect_variable' => false, // I feel it makes the code actually harder to read |
45 | 46 | 'explicit_string_variable' => false, // I feel it makes the code actually harder to read |
46 | 47 | 'final_class' => false, // We need non-final classes |
|
50 | 51 | 'fopen_flag_order' => true, |
51 | 52 | 'fopen_flags' => true, |
52 | 53 | 'full_opening_tag' => true, |
53 | | - 'fully_qualified_strict_types' => true, |
| 54 | + 'fully_qualified_strict_types' => false, |
54 | 55 | 'function_declaration' => true, |
55 | 56 | 'function_to_constant' => true, |
56 | | - 'function_typehint_space' => true, |
57 | 57 | 'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright']], |
58 | 58 | 'global_namespace_import' => true, |
59 | 59 | 'header_comment' => false, // We don't use common header in all our files |
|
82 | 82 | 'native_constant_invocation' => false, // Micro optimization that look messy |
83 | 83 | 'native_function_casing' => true, |
84 | 84 | 'native_function_invocation' => false, // I suppose this would be best, but I am still unconvinced about the visual aspect of it |
85 | | - 'native_function_type_declaration_casing' => true, |
86 | | - 'new_with_braces' => true, |
| 85 | + 'new_with_parentheses' => ['anonymous_class' => true, 'named_class' => true], |
87 | 86 | 'no_alias_functions' => true, |
88 | 87 | 'no_alternative_syntax' => true, |
89 | 88 | 'no_binary_string' => true, |
90 | 89 | 'no_blank_lines_after_class_opening' => true, |
91 | 90 | 'no_blank_lines_after_phpdoc' => true, |
92 | | - 'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace |
93 | 91 | 'no_break_comment' => true, |
94 | 92 | 'no_closing_tag' => true, |
95 | 93 | 'no_empty_comment' => true, |
|
108 | 106 | 'no_singleline_whitespace_before_semicolons' => true, |
109 | 107 | 'no_spaces_after_function_name' => true, |
110 | 108 | 'no_spaces_around_offset' => true, |
111 | | - 'no_spaces_inside_parenthesis' => true, |
112 | 109 | 'no_superfluous_elseif' => false, // Might be risky on a huge code base |
113 | | - 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], |
| 110 | + //'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], |
114 | 111 | 'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']], |
115 | 112 | 'no_trailing_whitespace' => true, |
116 | 113 | 'no_trailing_whitespace_in_comment' => true, |
117 | 114 | 'no_unneeded_control_parentheses' => true, |
118 | | - 'no_unneeded_curly_braces' => true, |
| 115 | + 'no_unneeded_braces' => true, |
119 | 116 | 'no_unneeded_final_method' => true, |
120 | 117 | 'no_unreachable_default_argument_value' => true, |
121 | 118 | 'no_unset_cast' => true, |
|
175 | 172 | 'phpdoc_trim' => true, |
176 | 173 | 'phpdoc_trim_consecutive_blank_line_separation' => true, |
177 | 174 | 'phpdoc_types' => true, |
178 | | - 'phpdoc_types_order' => true, |
| 175 | + 'phpdoc_types_order' => false, |
179 | 176 | 'phpdoc_var_annotation_correct_order' => true, |
180 | 177 | 'phpdoc_var_without_name' => true, |
181 | 178 | 'pow_to_exponentiation' => true, |
|
193 | 190 | 'simple_to_complex_string_variable' => false, // Would differ from TypeScript without obvious advantages |
194 | 191 | 'simplified_null_return' => false, // Even if technically correct we prefer to be explicit |
195 | 192 | 'single_blank_line_at_eof' => true, |
196 | | - 'single_blank_line_before_namespace' => true, |
197 | 193 | 'single_class_element_per_statement' => true, |
198 | 194 | 'single_import_per_statement' => true, |
199 | 195 | 'single_line_after_imports' => true, |
200 | 196 | 'single_line_comment_style' => true, |
201 | 197 | 'single_line_throw' => false, // I don't see any reason for having a special case for Exception |
202 | | - 'single_quote' => true, |
| 198 | + 'single_quote' => false, |
203 | 199 | 'single_trait_insert_per_statement' => true, |
204 | 200 | 'space_after_semicolon' => true, |
| 201 | + 'spaces_inside_parentheses' => ['space' => 'none'], |
205 | 202 | 'standardize_increment' => true, |
206 | 203 | 'standardize_not_equals' => true, |
207 | 204 | 'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()` |
208 | 205 | 'strict_comparison' => false, // No, too dangerous to change that |
209 | 206 | 'strict_param' => false, // No, too dangerous to change that |
| 207 | + 'string_implicit_backslashes' => false, // was escape_implicit_backslashes, too confusing |
210 | 208 | 'string_line_ending' => true, |
211 | 209 | 'switch_case_semicolon_to_colon' => true, |
212 | 210 | 'switch_case_space' => true, |
213 | 211 | 'ternary_operator_spaces' => true, |
214 | 212 | 'ternary_to_null_coalescing' => true, |
215 | 213 | 'trailing_comma_in_multiline' => true, |
216 | 214 | 'trim_array_spaces' => true, |
| 215 | + 'type_declaration_spaces' => ['elements' => ['function', 'property']], // was function_typehint_space |
217 | 216 | 'unary_operator_spaces' => true, |
218 | 217 | 'visibility_required' => ['elements' => ['property', 'method']], // not const |
219 | 218 | 'void_return' => true, |
|
0 commit comments