Skip to content

Commit e25f882

Browse files
committed
Update PHPCS fixer rules
1 parent adc6cfe commit e25f882

File tree

1 file changed

+146
-10
lines changed

1 file changed

+146
-10
lines changed

.php-cs-fixer.dist.php

+146-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
<?php
22

3+
/*
4+
* This file is part of Monsieur Biz' Search plugin for Sylius.
5+
*
6+
* (c) Monsieur Biz <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE.txt
9+
* file that was distributed with this source code.
10+
*/
11+
312
declare(strict_types=1);
413

514
$header = <<<'HEADER'
615
This file is part of Monsieur Biz' Search plugin for Sylius.
716
817
(c) Monsieur Biz <[email protected]>
918
10-
For the full copyright and license information, please view the LICENSE
19+
For the full copyright and license information, please view the LICENSE.txt
1120
file that was distributed with this source code.
1221
HEADER;
1322

1423
$finder = PhpCsFixer\Finder::create()
1524
->in(__DIR__)
1625
->exclude(
1726
[
18-
'tests/Application/var',
19-
'tests/Application/bin',
20-
'tests/Application/config',
21-
'generated',
27+
'tests/Application',
2228
]
2329
)
2430
;
@@ -40,52 +46,138 @@
4046
'array_syntax' => [
4147
'syntax' => 'short',
4248
],
49+
'binary_operator_spaces' => true,
50+
'blank_line_after_opening_tag' => true,
51+
'blank_line_after_namespace' => true,
52+
'blank_line_before_statement' => true,
53+
'braces' => [
54+
'allow_single_line_closure' => true,
55+
],
56+
'cast_spaces' => true,
57+
'class_attributes_separation' => true,
58+
'class_definition' => [
59+
'single_item_single_line' => true,
60+
'multi_line_extends_each_single_line' => true,
61+
],
62+
'combine_consecutive_issets' => true,
63+
'combine_consecutive_unsets' => true,
4364
'comment_to_phpdoc' => true,
4465
'compact_nullable_typehint' => true,
4566
'concat_space' => [
4667
'spacing' => 'one',
4768
],
69+
'constant_case' => [
70+
'case' => 'lower',
71+
],
72+
'declare_equal_normalize' => true,
73+
'dir_constant' => true,
74+
'declare_strict_types' => true,
4875
'doctrine_annotation_array_assignment' => [
4976
'operator' => '=',
5077
],
5178
'doctrine_annotation_spaces' => [
5279
'after_array_assignments_equals' => false,
5380
'before_array_assignments_equals' => false,
5481
],
82+
'elseif' => true,
83+
'encoding' => true,
84+
'ereg_to_preg' => true,
85+
'error_suppression' => true,
5586
'explicit_indirect_variable' => true,
87+
'full_opening_tag' => true,
5688
'fully_qualified_strict_types' => true,
57-
'function_declaration' => [
58-
'closure_function_spacing' => 'none',
59-
],
89+
'function_declaration' => true,
90+
'function_to_constant' => true,
91+
'function_typehint_space' => true,
92+
'general_phpdoc_tag_rename' => true,
6093
'header_comment' => [
6194
'header' => $header,
6295
'location' => 'after_open',
6396
],
97+
'include' => true,
98+
'increment_style' => [
99+
'style' => 'pre',
100+
],
101+
'indentation_type' => true,
102+
'is_null' => true,
103+
'line_ending' => true,
104+
'list_syntax' => [
105+
'syntax' => 'short',
106+
],
64107
'logical_operators' => true,
108+
'lowercase_cast' => true,
109+
'lowercase_keywords' => true,
110+
'lowercase_static_reference' => true,
111+
'magic_constant_casing' => true,
112+
'method_argument_space' => true,
113+
'modernize_types_casting' => true,
65114
'multiline_comment_opening_closing' => true,
66115
'multiline_whitespace_before_semicolons' => [
67116
'strategy' => 'new_line_for_chained_calls',
68117
],
118+
'native_constant_invocation' => true,
119+
'native_function_casing' => true,
120+
'new_with_braces' => true,
121+
'no_alias_functions' => true,
69122
'no_alternative_syntax' => true,
123+
'no_blank_lines_after_class_opening' => true,
124+
'no_blank_lines_after_phpdoc' => true,
125+
'no_break_comment' => true,
126+
'no_closing_tag' => true,
127+
'no_empty_comment' => true,
128+
'no_empty_phpdoc' => true,
129+
'no_empty_statement' => true,
70130
'no_extra_blank_lines' => [
71131
'tokens' => [
72132
'break',
133+
'case',
73134
'continue',
74135
'curly_brace_block',
136+
'default',
75137
'extra',
76138
'parenthesis_brace_block',
77139
'return',
78140
'square_brace_block',
141+
'switch',
79142
'throw',
80143
'use',
81144
],
82145
],
146+
'no_homoglyph_names' => true,
147+
'no_leading_import_slash' => true,
148+
'no_leading_namespace_whitespace' => true,
149+
'no_mixed_echo_print' => [
150+
'use' => 'echo',
151+
],
152+
'no_multiline_whitespace_around_double_arrow' => true,
153+
'no_null_property_initialization' => true,
154+
'no_php4_constructor' => true,
155+
'no_singleline_whitespace_before_semicolons' => true,
156+
'no_short_bool_cast' => true,
157+
'no_spaces_after_function_name' => true,
158+
'no_spaces_around_offset' => true,
159+
'no_spaces_inside_parenthesis' => true,
83160
'no_superfluous_elseif' => true,
84-
'no_superfluous_phpdoc_tags' => false,
161+
'no_superfluous_phpdoc_tags' => [
162+
'allow_mixed' => true,
163+
],
85164
'no_unset_cast' => true,
165+
'no_unneeded_control_parentheses' => true,
166+
'no_unneeded_curly_braces' => true,
167+
'no_unneeded_final_method' => true,
86168
'no_unset_on_property' => true,
169+
'no_unused_imports' => true,
87170
'no_useless_else' => true,
88171
'no_useless_return' => true,
172+
'no_trailing_comma_in_list_call' => true,
173+
'no_trailing_comma_in_singleline_array' => true,
174+
'no_trailing_whitespace' => true,
175+
'no_trailing_whitespace_in_comment' => true,
176+
'no_whitespace_before_comma_in_array' => true,
177+
'no_whitespace_in_blank_line' => true,
178+
'non_printable_character' => true,
179+
'normalize_index_brace' => true,
180+
'object_operator_without_whitespace' => true,
89181
'ordered_imports' => [
90182
'imports_order' => [
91183
'class',
@@ -94,6 +186,8 @@
94186
],
95187
'sort_algorithm' => 'alpha',
96188
],
189+
'php_unit_dedicate_assert' => true,
190+
'php_unit_fqcn_annotation' => true,
97191
'php_unit_method_casing' => [
98192
'case' => 'camel_case',
99193
],
@@ -107,21 +201,63 @@
107201
'phpdoc_add_missing_param_annotation' => [
108202
'only_untyped' => true,
109203
],
204+
'phpdoc_indent' => true,
205+
'phpdoc_inline_tag_normalizer' => true,
206+
'phpdoc_no_access' => true,
207+
'phpdoc_no_alias_tag' => true,
208+
'phpdoc_no_empty_return' => true,
209+
'phpdoc_no_package' => true,
210+
'phpdoc_no_useless_inheritdoc' => true,
110211
'phpdoc_order' => true,
212+
'phpdoc_return_self_reference' => true,
213+
'phpdoc_scalar' => true,
214+
'phpdoc_separation' => true,
111215
'phpdoc_single_line_var_spacing' => true,
216+
'phpdoc_tag_type' => true,
112217
'phpdoc_to_comment' => false,
218+
'phpdoc_trim' => true,
113219
'phpdoc_trim_consecutive_blank_line_separation' => true,
220+
'phpdoc_types' => true,
221+
'phpdoc_types_order' => [
222+
'null_adjustment' => 'always_last',
223+
'sort_algorithm' => 'none',
224+
],
114225
'phpdoc_var_annotation_correct_order' => true,
226+
'phpdoc_var_without_name' => true,
227+
'pow_to_exponentiation' => true,
228+
'protected_to_private' => true,
115229
'return_assignment' => true,
230+
'return_type_declaration' => true,
231+
'self_accessor' => true,
232+
'short_scalar_cast' => true,
233+
'single_blank_line_at_eof' => true,
234+
'single_blank_line_before_namespace' => true,
235+
'single_class_element_per_statement' => true,
236+
'single_import_per_statement' => true,
237+
'single_line_after_imports' => true,
238+
'single_line_comment_style' => true,
239+
'single_quote' => true,
240+
'space_after_semicolon' => true,
241+
'standardize_not_equals' => true,
116242
'strict_param' => true,
243+
'switch_case_semicolon_to_colon' => true,
244+
'switch_case_space' => true,
245+
'ternary_operator_spaces' => true,
246+
'ternary_to_null_coalescing' => true,
247+
'trailing_comma_in_multiline' => [
248+
'elements' => ['arrays'],
249+
],
250+
'trim_array_spaces' => true,
251+
'unary_operator_spaces' => true,
117252
'visibility_required' => [
118253
'elements' => [
119254
'const',
120-
'method',
121255
'property',
256+
'method',
122257
],
123258
],
124259
'void_return' => true,
260+
'whitespace_after_comma_in_array' => true, // alerady in symfony set
125261
])
126262
->setFinder($finder)
127263
;

0 commit comments

Comments
 (0)