|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +declare(strict_types=1); |
| 4 | + |
3 | 5 | return (new PhpCsFixer\Config()) |
4 | 6 | ->setRiskyAllowed(true) |
5 | 7 | ->setRules([ |
|
8 | 10 | 'array_syntax' => ['syntax' => 'short'], |
9 | 11 | 'assign_null_coalescing_to_coalesce_equal' => true, |
10 | 12 | 'backtick_to_shell_exec' => true, |
11 | | - 'binary_operator_spaces' => ['operators' => ['=' => 'align', 'xor' => null, '+=' => 'align_single_space', '===' => 'align_single_space_minimal', '|' => 'single_space', '=>' => 'align_single_space_minimal_by_scope']], |
| 13 | + 'binary_operator_spaces' => true, |
12 | 14 | 'blank_line_after_namespace' => true, |
13 | 15 | 'blank_line_after_opening_tag' => true, |
14 | 16 | 'blank_line_before_statement' => true, |
| 17 | + 'blank_line_between_import_groups' => true, |
15 | 18 | 'braces' => true, |
16 | 19 | 'cast_spaces' => true, |
17 | | - 'class_attributes_separation' => ['elements' => ['const' => 'only_if_meta', 'method' => 'one', 'property' => 'only_if_meta', 'trait_import' => 'one', 'case' => 'one']], |
18 | | - 'class_definition' => true, |
| 20 | + 'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one', 'trait_import' => 'one', 'case' => 'one']], |
| 21 | + 'class_definition' => ['multi_line_extends_each_single_line' => true, 'single_line' => true, 'single_item_single_line' => true, 'space_before_parenthesis' => false, 'inline_constructor_arguments' => false], |
19 | 22 | 'class_reference_name_casing' => true, |
20 | 23 | 'clean_namespace' => true, |
21 | 24 | 'combine_consecutive_issets' => true, |
|
25 | 28 | 'compact_nullable_typehint' => true, |
26 | 29 | 'concat_space' => ['spacing' => 'one'], |
27 | 30 | 'constant_case' => ['case' => 'lower'], |
| 31 | + 'curly_braces_position' => ['control_structures_opening_brace' => 'same_line', 'functions_opening_brace' => 'next_line_unless_newline_at_signature_end', 'anonymous_functions_opening_brace' => 'same_line', 'classes_opening_brace' => 'next_line_unless_newline_at_signature_end', 'anonymous_classes_opening_brace' => 'same_line', 'allow_single_line_empty_anonymous_classes' => true, 'allow_single_line_anonymous_functions' => true], |
28 | 32 | 'date_time_create_from_format_call' => true, |
| 33 | + 'date_time_immutable' => true, |
29 | 34 | 'declare_equal_normalize' => ['space' => 'none'], |
30 | 35 | 'declare_parentheses' => true, |
31 | 36 | 'declare_strict_types' => true, |
|
46 | 51 | 'explicit_string_variable' => true, |
47 | 52 | 'final_class' => true, |
48 | 53 | 'final_internal_class' => true, |
| 54 | + 'final_public_method_for_abstract_class' => true, |
49 | 55 | 'fopen_flag_order' => true, |
50 | 56 | 'fopen_flags' => true, |
51 | 57 | 'full_opening_tag' => true, |
|
76 | 82 | 'lowercase_static_reference' => true, |
77 | 83 | 'magic_constant_casing' => true, |
78 | 84 | 'magic_method_casing' => true, |
79 | | - 'mb_str_functions' => true, |
80 | | - 'method_argument_space' => true, |
| 85 | + 'mb_str_functions' => false, |
| 86 | + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'after_heredoc' => true], |
81 | 87 | 'method_chaining_indentation' => true, |
82 | 88 | 'modernize_strpos' => true, |
83 | 89 | 'modernize_types_casting' => true, |
|
138 | 144 | 'object_operator_without_whitespace' => true, |
139 | 145 | 'octal_notation' => true, |
140 | 146 | 'operator_linebreak' => true, |
141 | | - 'ordered_class_elements' => ['sort_algorithm' => 'alpha', 'order' => ['use_trait', 'case', 'constant', 'constant_private', 'constant_protected', 'constant_public', 'property_private', 'property_private_readonly', 'property_private_static', 'property_protected', 'property_protected_readonly', 'property_protected_static', 'property_public', 'property_public_readonly', 'property_public_static', 'property_static', 'protected', 'construct', 'destruct', 'magic', 'method', 'public', 'method_abstract', 'method_private', 'method_private_abstract', 'method_private_abstract_static', 'method_private_static', 'method_protected', 'method_protected_abstract', 'method_protected_abstract_static', 'method_protected_static', 'method_public', 'method_public_abstract', 'method_public_abstract_static', 'method_public_static', 'method_static', 'phpunit', 'private', 'property']], |
| 147 | + 'ordered_class_elements' => ['sort_algorithm' => 'alpha', 'order' => ['use_trait', 'case', 'constant', 'constant_private', 'constant_protected', 'constant_public', 'property_private', 'property_private_readonly', 'property_private_static', 'property_protected', 'property_protected_readonly', 'property_protected_static', 'property_public', 'property_public_readonly', 'property_public_static', 'property_static', 'protected', 'construct', 'destruct', 'magic', 'method', 'public', 'method_public', 'method_abstract', 'method_public_abstract', 'method_public_abstract_static', 'method_public_static', 'method_static', 'method_private', 'method_private_abstract', 'method_private_abstract_static', 'method_private_static', 'method_protected', 'method_protected_abstract', 'method_protected_abstract_static', 'method_protected_static', 'phpunit', 'private', 'property']], |
142 | 148 | 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['const', 'class', 'function']], |
143 | 149 | 'ordered_interfaces' => true, |
144 | 150 | 'ordered_traits' => true, |
|
191 | 197 | 'single_line_throw' => true, |
192 | 198 | 'single_quote' => true, |
193 | 199 | 'single_space_after_construct' => true, |
| 200 | + 'single_space_around_construct' => true, |
194 | 201 | 'single_trait_insert_per_statement' => true, |
195 | 202 | 'space_after_semicolon' => true, |
196 | 203 | 'standardize_increment' => true, |
|
207 | 214 | 'ternary_operator_spaces' => true, |
208 | 215 | 'ternary_to_elvis_operator' => true, |
209 | 216 | 'ternary_to_null_coalescing' => true, |
210 | | - 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'parameters']], |
| 217 | + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arguments', 'arrays', 'match', 'parameters']], |
211 | 218 | 'trim_array_spaces' => true, |
212 | | - 'types_spaces' => ['space' => 'single'], |
| 219 | + 'types_spaces' => ['space' => 'single', 'space_multiple_catch' => 'single'], |
213 | 220 | 'unary_operator_spaces' => true, |
214 | 221 | 'use_arrow_functions' => true, |
215 | 222 | 'visibility_required' => true, |
|
220 | 227 | ->setFinder( |
221 | 228 | PhpCsFixer\Finder::create() |
222 | 229 | ->exclude('vendor') |
223 | | - ->in([__DIR__.'/src/']) |
224 | | - ) |
225 | | -; |
| 230 | + ->in([__DIR__ . '/src/']), |
| 231 | + ); |
0 commit comments