Skip to content

Commit 3ec3a91

Browse files
committed
chore: update .php-cs-fixer.php.stub
1 parent 1b184a5 commit 3ec3a91

File tree

1 file changed

+9
-45
lines changed

1 file changed

+9
-45
lines changed

src/Commands/stubs/.php-cs-fixer.php.stub

+9-45
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ declare(strict_types=1);
66
* List of available rules: https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/index.rst
77
*/
88
$rules = [
9+
'@PSR12' => true,
10+
'@PHP81Migration' => true,
911
'array_syntax' => ['syntax' => 'short'],
1012
'binary_operator_spaces' => [
1113
'default' => 'single_space',
@@ -15,8 +17,6 @@ $rules = [
1517
'|' => 'no_space'
1618
],
1719
],
18-
'blank_line_after_namespace' => true,
19-
'blank_line_after_opening_tag' => true,
2020
'blank_line_before_statement' => [
2121
'statements' => [
2222
'break',
@@ -27,7 +27,6 @@ $rules = [
2727
'try',
2828
],
2929
],
30-
'braces' => true,
3130
'cast_spaces' => true,
3231
'class_attributes_separation' => [
3332
'elements' => [
@@ -36,38 +35,23 @@ $rules = [
3635
'property' => 'one',
3736
],
3837
],
39-
'class_definition' => true,
38+
'class_definition' => ['space_before_parenthesis' => false],
4039
'concat_space' => ['spacing' => 'none'],
41-
'constant_case' => ['case' => 'lower'],
42-
'declare_equal_normalize' => true,
4340
'declare_strict_types' => true,
4441
'echo_tag_syntax' => ['format' => 'long'],
45-
'elseif' => true,
46-
'encoding' => true,
4742
'final_internal_class' => true,
48-
'full_opening_tag' => true,
4943
'fully_qualified_strict_types' => true,
50-
'function_declaration' => true,
5144
'function_typehint_space' => true,
5245
'heredoc_to_nowdoc' => true,
5346
'include' => true,
54-
'increment_style' => ['style' => 'post'],
55-
'indentation_type' => true,
47+
'increment_style' => ['style' => 'pre'],
5648
'linebreak_after_opening_tag' => true,
57-
'line_ending' => true,
58-
'lowercase_cast' => true,
59-
'lowercase_keywords' => true,
60-
'lowercase_static_reference' => true,
6149
'magic_method_casing' => true,
6250
'magic_constant_casing' => true,
63-
'method_argument_space' => true,
6451
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'],
6552
'native_function_casing' => true,
66-
'new_with_braces' => true,
6753
'no_alias_functions' => true,
68-
'no_blank_lines_after_class_opening' => true,
6954
'no_blank_lines_after_phpdoc' => true,
70-
'no_closing_tag' => true,
7155
'no_empty_phpdoc' => true,
7256
'no_empty_statement' => true,
7357
'no_extra_blank_lines' => [
@@ -78,21 +62,16 @@ $rules = [
7862
'use_trait',
7963
],
8064
],
81-
'no_leading_import_slash' => true,
8265
'no_leading_namespace_whitespace' => true,
8366
'no_mixed_echo_print' => ['use' => 'echo'],
8467
'no_multiline_whitespace_around_double_arrow' => true,
8568
'no_short_bool_cast' => true,
8669
'no_singleline_whitespace_before_semicolons' => true,
87-
'no_spaces_after_function_name' => true,
8870
'no_spaces_around_offset' => [
8971
'positions' => ['inside'],
9072
],
91-
'no_spaces_inside_parenthesis' => true,
9273
'no_trailing_comma_in_list_call' => true,
9374
'no_trailing_comma_in_singleline_array' => true,
94-
'no_trailing_whitespace' => true,
95-
'no_trailing_whitespace_in_comment' => true,
9675
'no_unneeded_control_parentheses' => [
9776
'statements' => [
9877
'break',
@@ -109,11 +88,13 @@ $rules = [
10988
'no_useless_else' => true,
11089
'no_useless_return' => true,
11190
'no_whitespace_before_comma_in_array' => true,
112-
'no_whitespace_in_blank_line' => true,
11391
'normalize_index_brace' => true,
11492
'not_operator_with_successor_space' => true,
11593
'object_operator_without_whitespace' => true,
116-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
94+
'ordered_imports' => [
95+
'imports_order' => ['class', 'function', 'const'],
96+
'sort_algorithm' => 'alpha',
97+
],
11798
'php_unit_strict' => true,
11899
'php_unit_test_class_requires_covers' => true,
119100
'phpdoc_add_missing_param_annotation' => true,
@@ -134,42 +115,26 @@ $rules = [
134115
'psr_autoloading' => true,
135116
'self_accessor' => true,
136117
'semicolon_after_instruction' => true,
137-
'short_scalar_cast' => true,
138118
'simplified_null_return' => true,
139-
'single_blank_line_at_eof' => true,
140-
'single_blank_line_before_namespace' => true,
141119
'single_class_element_per_statement' => [
142120
'elements' => [
143121
'const',
144122
'property',
145123
],
146124
],
147-
'single_import_per_statement' => true,
148-
'single_line_after_imports' => true,
149125
'single_line_comment_style' => [
150126
'comment_types' => ['hash'],
151127
],
152128
'single_quote' => true,
153-
'single_trait_insert_per_statement' => true,
154129
'space_after_semicolon' => true,
155130
'standardize_not_equals' => true,
156131
'strict_comparison' => true,
157132
'strict_param' => true,
158-
'switch_case_semicolon_to_colon' => true,
159-
'switch_case_space' => true,
160-
'ternary_operator_spaces' => true,
161133
'trailing_comma_in_multiline' => [
162134
'elements' => ['arrays'],
163135
],
164136
'trim_array_spaces' => true,
165137
'unary_operator_spaces' => true,
166-
'visibility_required' => [
167-
'elements' => [
168-
'property',
169-
'method',
170-
'const',
171-
],
172-
],
173138
'whitespace_after_comma_in_array' => true,
174139
];
175140

@@ -185,8 +150,7 @@ $finder = PhpCsFixer\Finder::create()
185150
->ignoreDotFiles(true)
186151
->ignoreVCS(true);
187152

188-
$config = new PhpCsFixer\Config();
189-
return $config
153+
return (new PhpCsFixer\Config())
190154
->setFinder($finder)
191155
->setRules($rules)
192156
->setRiskyAllowed(true)

0 commit comments

Comments
 (0)