|
25 | 25 | 'backtick_to_shell_exec' => true,
|
26 | 26 | 'binary_operator_spaces' => [
|
27 | 27 | 'operators' => [
|
| 28 | + '*=' => 'align_single_space_minimal', |
| 29 | + '+=' => 'align_single_space_minimal', |
| 30 | + '-=' => 'align_single_space_minimal', |
| 31 | + '/=' => 'align_single_space_minimal', |
28 | 32 | '=' => 'align_single_space_minimal',
|
29 | 33 | '=>' => 'align_single_space_minimal',
|
30 | 34 | ],
|
|
57 | 61 | 'yield_from',
|
58 | 62 | ],
|
59 | 63 | ],
|
| 64 | + 'blank_lines_before_namespace' => [ |
| 65 | + 'max_line_breaks' => 1, |
| 66 | + 'min_line_breaks' => 0, |
| 67 | + ], |
| 68 | + 'braces_position' => [ |
| 69 | + 'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end', |
| 70 | + 'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end', |
| 71 | + ], |
60 | 72 | 'cast_spaces' => true,
|
61 | 73 | 'class_attributes_separation' => [
|
62 | 74 | 'elements' => [
|
|
70 | 82 | 'combine_consecutive_issets' => true,
|
71 | 83 | 'combine_consecutive_unsets' => true,
|
72 | 84 | 'combine_nested_dirname' => true,
|
73 |
| - 'compact_nullable_typehint' => true, |
| 85 | + 'compact_nullable_type_declaration' => true, |
74 | 86 | 'concat_space' => ['spacing' => 'one'],
|
75 | 87 | 'constant_case' => true,
|
76 | 88 | 'control_structure_braces' => true,
|
77 | 89 | 'control_structure_continuation_position' => true,
|
78 |
| - 'curly_braces_position' => [ |
79 |
| - 'anonymous_functions_opening_brace' => 'next_line_unless_newline_at_signature_end', |
80 |
| - 'anonymous_classes_opening_brace' => 'next_line_unless_newline_at_signature_end', |
81 |
| - ], |
82 | 90 | 'declare_equal_normalize' => ['space' => 'none'],
|
83 | 91 | 'declare_parentheses' => true,
|
84 | 92 | 'declare_strict_types' => true,
|
|
94 | 102 | 'fully_qualified_strict_types' => true,
|
95 | 103 | 'function_declaration' => true,
|
96 | 104 | 'function_to_constant' => true,
|
97 |
| - 'function_typehint_space' => true, |
98 | 105 | 'get_class_to_class_keyword' => true,
|
99 | 106 | 'global_namespace_import' => [
|
100 | 107 | 'import_classes' => true,
|
|
106 | 113 | 'implode_call' => true,
|
107 | 114 | 'include' => true,
|
108 | 115 | 'increment_style' => [
|
109 |
| - 'style' => PhpCsFixer\Fixer\Operator\IncrementStyleFixer::STYLE_POST, |
| 116 | + 'style' => 'post', |
110 | 117 | ],
|
111 | 118 | 'indentation_type' => true,
|
| 119 | + 'integer_literal_case' => true, |
112 | 120 | 'is_null' => true,
|
113 | 121 | 'lambda_not_used_import' => true,
|
114 | 122 | 'line_ending' => true,
|
|
122 | 130 | 'method_argument_space' => [
|
123 | 131 | 'on_multiline' => 'ensure_fully_multiline',
|
124 | 132 | ],
|
| 133 | + 'method_chaining_indentation' => true, |
| 134 | + 'modernize_strpos' => true, |
125 | 135 | 'modernize_types_casting' => true,
|
126 | 136 | 'multiline_comment_opening_closing' => true,
|
127 | 137 | 'multiline_whitespace_before_semicolons' => true,
|
|
132 | 142 | '@internal',
|
133 | 143 | ],
|
134 | 144 | ],
|
135 |
| - 'native_function_type_declaration_casing' => true, |
136 |
| - 'new_with_braces' => [ |
137 |
| - 'named_class' => false, |
| 145 | + 'native_type_declaration_casing' => true, |
| 146 | + 'new_with_parentheses' => [ |
138 | 147 | 'anonymous_class' => false,
|
| 148 | + 'named_class' => false, |
139 | 149 | ],
|
140 | 150 | 'no_alias_functions' => true,
|
141 | 151 | 'no_alias_language_construct_call' => true,
|
142 | 152 | 'no_alternative_syntax' => true,
|
143 | 153 | 'no_binary_string' => true,
|
144 | 154 | 'no_blank_lines_after_class_opening' => true,
|
145 | 155 | 'no_blank_lines_after_phpdoc' => true,
|
146 |
| - 'no_blank_lines_before_namespace' => true, |
147 | 156 | 'no_break_comment' => true,
|
148 | 157 | 'no_closing_tag' => true,
|
149 | 158 | 'no_empty_comment' => true,
|
|
154 | 163 | 'no_leading_import_slash' => true,
|
155 | 164 | 'no_leading_namespace_whitespace' => true,
|
156 | 165 | 'no_mixed_echo_print' => ['use' => 'print'],
|
157 |
| - 'no_multiple_statements_per_line' => true, |
158 | 166 | 'no_multiline_whitespace_around_double_arrow' => true,
|
| 167 | + 'no_multiple_statements_per_line' => true, |
159 | 168 | 'no_null_property_initialization' => true,
|
160 | 169 | 'no_php4_constructor' => true,
|
161 | 170 | 'no_short_bool_cast' => true,
|
162 | 171 | 'no_singleline_whitespace_before_semicolons' => true,
|
| 172 | + 'no_space_around_double_colon' => true, |
163 | 173 | 'no_spaces_after_function_name' => true,
|
164 | 174 | 'no_spaces_around_offset' => true,
|
165 |
| - 'no_spaces_inside_parenthesis' => true, |
166 | 175 | 'no_superfluous_elseif' => true,
|
167 | 176 | 'no_superfluous_phpdoc_tags' => [
|
168 | 177 | 'allow_mixed' => true,
|
|
171 | 180 | 'no_trailing_whitespace' => true,
|
172 | 181 | 'no_trailing_whitespace_in_comment' => true,
|
173 | 182 | 'no_trailing_whitespace_in_string' => true,
|
| 183 | + 'no_unneeded_braces' => true, |
174 | 184 | 'no_unneeded_control_parentheses' => true,
|
175 |
| - 'no_unneeded_curly_braces' => true, |
176 | 185 | 'no_unneeded_final_method' => true,
|
177 | 186 | 'no_unneeded_import_alias' => true,
|
178 | 187 | 'no_unreachable_default_argument_value' => true,
|
179 | 188 | 'no_unset_cast' => true,
|
180 | 189 | 'no_unset_on_property' => true,
|
181 | 190 | 'no_unused_imports' => true,
|
| 191 | + 'no_useless_concat_operator' => true, |
182 | 192 | 'no_useless_else' => true,
|
| 193 | + 'no_useless_nullsafe_operator' => true, |
183 | 194 | 'no_useless_return' => true,
|
184 | 195 | 'no_useless_sprintf' => true,
|
185 | 196 | 'no_whitespace_before_comma_in_array' => true,
|
186 | 197 | 'no_whitespace_in_blank_line' => true,
|
187 | 198 | 'non_printable_character' => true,
|
188 | 199 | 'normalize_index_brace' => true,
|
189 | 200 | 'object_operator_without_whitespace' => true,
|
| 201 | + 'octal_notation' => true, |
190 | 202 | 'operator_linebreak' => [
|
191 | 203 | 'only_booleans' => true,
|
192 | 204 | 'position' => 'end',
|
|
217 | 229 | ],
|
218 | 230 | 'ordered_imports' => [
|
219 | 231 | 'imports_order' => [
|
220 |
| - PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CONST, |
221 |
| - PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_FUNCTION, |
222 |
| - PhpCsFixer\Fixer\Import\OrderedImportsFixer::IMPORT_TYPE_CLASS, |
| 232 | + 'const', |
| 233 | + 'function', |
| 234 | + 'class', |
223 | 235 | ]
|
224 | 236 | ],
|
225 | 237 | 'ordered_interfaces' => [
|
226 | 238 | 'direction' => 'ascend',
|
227 | 239 | 'order' => 'alpha',
|
228 | 240 | ],
|
229 | 241 | 'ordered_traits' => true,
|
| 242 | + 'ordered_types' => true, |
230 | 243 | 'php_unit_set_up_tear_down_visibility' => true,
|
231 | 244 | 'php_unit_test_case_static_method_calls' => [
|
232 | 245 | 'call_type' => 'this',
|
|
250 | 263 | 'uses',
|
251 | 264 | ],
|
252 | 265 | ],
|
| 266 | + 'phpdoc_param_order' => true, |
253 | 267 | 'phpdoc_return_self_reference' => true,
|
254 | 268 | 'phpdoc_scalar' => true,
|
255 | 269 | 'phpdoc_separation' => true,
|
256 | 270 | 'phpdoc_single_line_var_spacing' => true,
|
257 | 271 | 'phpdoc_summary' => true,
|
258 | 272 | 'phpdoc_tag_casing' => true,
|
259 | 273 | 'phpdoc_tag_type' => true,
|
260 |
| - 'phpdoc_to_comment' => true, |
| 274 | + 'phpdoc_to_comment' => false, |
261 | 275 | 'phpdoc_trim' => true,
|
262 | 276 | 'phpdoc_trim_consecutive_blank_line_separation' => true,
|
263 | 277 | 'phpdoc_types' => ['groups' => ['simple', 'meta']],
|
|
279 | 293 | 'single_class_element_per_statement' => true,
|
280 | 294 | 'single_import_per_statement' => true,
|
281 | 295 | 'single_line_after_imports' => true,
|
| 296 | + 'single_line_comment_spacing' => true, |
282 | 297 | 'single_quote' => true,
|
283 | 298 | 'single_space_around_construct' => true,
|
284 | 299 | 'single_trait_insert_per_statement' => true,
|
285 | 300 | 'space_after_semicolon' => true,
|
| 301 | + 'spaces_inside_parentheses' => [ |
| 302 | + 'space' => 'none', |
| 303 | + ], |
286 | 304 | 'standardize_increment' => true,
|
287 | 305 | 'standardize_not_equals' => true,
|
288 | 306 | 'statement_indentation' => true,
|
289 | 307 | 'static_lambda' => true,
|
290 | 308 | 'strict_param' => true,
|
| 309 | + 'string_length_to_empty'=> true, |
291 | 310 | 'string_line_ending' => true,
|
292 | 311 | 'switch_case_semicolon_to_colon' => true,
|
293 | 312 | 'switch_case_space' => true,
|
|
297 | 316 | 'ternary_to_null_coalescing' => true,
|
298 | 317 | 'trailing_comma_in_multiline' => [
|
299 | 318 | 'elements' => [
|
300 |
| - 'arrays' |
| 319 | + 'arguments', |
| 320 | + 'arrays', |
| 321 | + 'match', |
301 | 322 | ]
|
302 | 323 | ],
|
303 | 324 | 'trim_array_spaces' => true,
|
304 |
| - 'types_spaces' => [ |
305 |
| - 'space' => 'none', |
| 325 | + 'type_declaration_spaces' => [ |
| 326 | + 'elements' => [ |
| 327 | + 'function', |
| 328 | + ], |
306 | 329 | ],
|
| 330 | + 'types_spaces' => true, |
307 | 331 | 'unary_operator_spaces' => true,
|
308 | 332 | 'visibility_required' => [
|
309 | 333 | 'elements' => [
|
|
316 | 340 | 'whitespace_after_comma_in_array' => true,
|
317 | 341 | ]);
|
318 | 342 |
|
| 343 | +$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD')))); |
| 344 | + |
319 | 345 | return $config;
|
0 commit comments