|
10 | 10 | $config
|
11 | 11 | ->setRiskyAllowed(true)
|
12 | 12 | ->setFinder($finder)
|
13 |
| - ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) |
| 13 | + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect(null, 600)) |
14 | 14 | ->setCacheFile(sys_get_temp_dir() . '/php-cs-fixer' . preg_replace('~\W~', '-', __DIR__))
|
15 | 15 | ->setRules([
|
16 | 16 | 'align_multiline_comment' => true,
|
|
19 | 19 | 'backtick_to_shell_exec' => true,
|
20 | 20 | 'binary_operator_spaces' => true,
|
21 | 21 | 'blank_line_after_namespace' => true,
|
| 22 | + 'blank_lines_before_namespace' => ['max_line_breaks' => 2, 'min_line_breaks' => 2], // we want 1 blank line before namespace |
22 | 23 | 'blank_line_after_opening_tag' => true,
|
23 | 24 | 'blank_line_before_statement' => true,
|
24 |
| - 'braces' => true, |
25 | 25 | 'cast_spaces' => true,
|
26 | 26 | 'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const
|
27 | 27 | 'class_definition' => false, // phpcs disagree
|
28 |
| - 'class_keyword_remove' => false, // Deprecated, and ::class keyword gives us better support in IDE |
29 | 28 | 'combine_consecutive_issets' => true,
|
30 | 29 | 'combine_consecutive_unsets' => true,
|
31 | 30 | 'combine_nested_dirname' => true,
|
32 | 31 | 'comment_to_phpdoc' => false, // interferes with annotations
|
33 |
| - 'compact_nullable_typehint' => true, |
| 32 | + 'compact_nullable_type_declaration' => true, |
34 | 33 | 'concat_space' => ['spacing' => 'one'],
|
35 | 34 | 'constant_case' => true,
|
36 | 35 | 'date_time_immutable' => false, // Break our unit tests
|
|
47 | 46 | 'encoding' => true,
|
48 | 47 | 'ereg_to_preg' => true,
|
49 | 48 | 'error_suppression' => false, // it breaks \PhpOffice\PhpSpreadsheet\Helper\Handler
|
50 |
| - 'escape_implicit_backslashes' => true, |
51 | 49 | 'explicit_indirect_variable' => false, // I feel it makes the code actually harder to read
|
52 | 50 | 'explicit_string_variable' => false, // I feel it makes the code actually harder to read
|
53 | 51 | 'final_class' => false, // We need non-final classes
|
|
59 | 57 | 'fully_qualified_strict_types' => true,
|
60 | 58 | 'function_declaration' => true,
|
61 | 59 | 'function_to_constant' => true,
|
62 |
| - 'function_typehint_space' => true, |
63 | 60 | 'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright']],
|
64 | 61 | 'general_phpdoc_tag_rename' => true,
|
65 | 62 | 'global_namespace_import' => true,
|
|
93 | 90 | 'native_constant_invocation' => false, // Micro optimization that look messy
|
94 | 91 | 'native_function_casing' => true,
|
95 | 92 | 'native_function_invocation' => false, // I suppose this would be best, but I am still unconvinced about the visual aspect of it
|
96 |
| - 'native_function_type_declaration_casing' => true, |
97 |
| - 'new_with_braces' => true, |
| 93 | + 'new_with_parentheses' => ['anonymous_class' => true, 'named_class' => true], |
98 | 94 | 'no_alias_functions' => true,
|
99 | 95 | 'no_alias_language_construct_call' => true,
|
100 | 96 | 'no_alternative_syntax' => true,
|
101 | 97 | 'no_binary_string' => true,
|
102 | 98 | 'no_blank_lines_after_class_opening' => true,
|
103 | 99 | 'no_blank_lines_after_phpdoc' => true,
|
104 |
| - 'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace |
105 | 100 | 'no_break_comment' => true,
|
106 | 101 | 'no_closing_tag' => true,
|
107 | 102 | 'no_empty_comment' => true,
|
|
121 | 116 | 'no_space_around_double_colon' => true,
|
122 | 117 | 'no_spaces_after_function_name' => true,
|
123 | 118 | 'no_spaces_around_offset' => true,
|
124 |
| - 'no_spaces_inside_parenthesis' => true, |
125 | 119 | 'no_superfluous_elseif' => false, // Might be risky on a huge code base
|
126 | 120 | 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
|
127 |
| - 'no_trailing_comma_in_list_call' => true, |
128 |
| - 'no_trailing_comma_in_singleline_array' => true, |
| 121 | + 'no_trailing_comma_in_singleline' => ['elements' => ['arguments', 'array_destructuring', 'array', 'group_import']], |
129 | 122 | 'no_trailing_whitespace' => true,
|
130 | 123 | 'no_trailing_whitespace_in_comment' => true,
|
131 | 124 | 'no_trailing_whitespace_in_string' => false, // Too dangerous
|
132 | 125 | 'no_unneeded_control_parentheses' => true,
|
133 |
| - 'no_unneeded_curly_braces' => true, |
| 126 | + 'no_unneeded_braces' => true, |
134 | 127 | 'no_unneeded_final_method' => true,
|
135 | 128 | 'no_unreachable_default_argument_value' => true,
|
136 | 129 | 'no_unset_cast' => true,
|
|
175 | 168 | 'phpdoc_align' => false, // Waste of time
|
176 | 169 | 'phpdoc_annotation_without_dot' => true,
|
177 | 170 | 'phpdoc_indent' => true,
|
178 |
| - //'phpdoc_inline_tag' => true, |
179 | 171 | 'phpdoc_line_span' => false, // Unfortunately our old comments turn even uglier with this
|
180 | 172 | 'phpdoc_no_access' => true,
|
181 | 173 | 'phpdoc_no_alias_tag' => true,
|
|
215 | 207 | 'simplified_if_return' => false, // Even if technically correct we prefer to be explicit
|
216 | 208 | 'simplified_null_return' => false, // Even if technically correct we prefer to be explicit
|
217 | 209 | 'single_blank_line_at_eof' => true,
|
218 |
| - 'single_blank_line_before_namespace' => true, |
219 | 210 | 'single_class_element_per_statement' => true,
|
220 | 211 | 'single_import_per_statement' => true,
|
221 | 212 | 'single_line_after_imports' => true,
|
222 | 213 | 'single_line_comment_style' => true,
|
223 | 214 | 'single_line_throw' => false, // I don't see any reason for having a special case for Exception
|
224 | 215 | 'single_quote' => true,
|
225 |
| - 'single_space_after_construct' => true, |
226 | 216 | 'single_trait_insert_per_statement' => true,
|
227 | 217 | 'space_after_semicolon' => true,
|
| 218 | + 'spaces_inside_parentheses' => ['space' => 'none'], |
228 | 219 | 'standardize_increment' => true,
|
229 | 220 | 'standardize_not_equals' => true,
|
230 | 221 | 'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()`
|
231 | 222 | 'strict_comparison' => false, // No, too dangerous to change that
|
| 223 | + 'string_implicit_backslashes' => false, // was escape_implicit_backslashes, too confusing |
232 | 224 | 'strict_param' => false, // No, too dangerous to change that
|
233 | 225 | 'string_length_to_empty' => true,
|
234 | 226 | 'string_line_ending' => true,
|
|
240 | 232 | 'ternary_to_null_coalescing' => true,
|
241 | 233 | 'trailing_comma_in_multiline' => true,
|
242 | 234 | 'trim_array_spaces' => true,
|
| 235 | + 'type_declaration_spaces' => ['elements' => ['function', 'property']], // was function_typehint_space |
243 | 236 | 'types_spaces' => true,
|
244 | 237 | 'unary_operator_spaces' => true,
|
245 | 238 | 'use_arrow_functions' => true,
|
|
0 commit comments