|
1 | 1 | <?php
|
2 | 2 |
|
| 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 | + |
3 | 12 | declare(strict_types=1);
|
4 | 13 |
|
5 | 14 | $header = <<<'HEADER'
|
6 | 15 | This file is part of Monsieur Biz' Search plugin for Sylius.
|
7 | 16 |
|
8 | 17 | (c) Monsieur Biz <[email protected]>
|
9 | 18 |
|
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 |
11 | 20 | file that was distributed with this source code.
|
12 | 21 | HEADER;
|
13 | 22 |
|
14 | 23 | $finder = PhpCsFixer\Finder::create()
|
15 | 24 | ->in(__DIR__)
|
16 | 25 | ->exclude(
|
17 | 26 | [
|
18 |
| - 'tests/Application/var', |
19 |
| - 'tests/Application/bin', |
20 |
| - 'tests/Application/config', |
21 |
| - 'generated', |
| 27 | + 'tests/Application', |
22 | 28 | ]
|
23 | 29 | )
|
24 | 30 | ;
|
|
40 | 46 | 'array_syntax' => [
|
41 | 47 | 'syntax' => 'short',
|
42 | 48 | ],
|
| 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, |
43 | 64 | 'comment_to_phpdoc' => true,
|
44 | 65 | 'compact_nullable_typehint' => true,
|
45 | 66 | 'concat_space' => [
|
46 | 67 | 'spacing' => 'one',
|
47 | 68 | ],
|
| 69 | + 'constant_case' => [ |
| 70 | + 'case' => 'lower', |
| 71 | + ], |
| 72 | + 'declare_equal_normalize' => true, |
| 73 | + 'dir_constant' => true, |
| 74 | + 'declare_strict_types' => true, |
48 | 75 | 'doctrine_annotation_array_assignment' => [
|
49 | 76 | 'operator' => '=',
|
50 | 77 | ],
|
51 | 78 | 'doctrine_annotation_spaces' => [
|
52 | 79 | 'after_array_assignments_equals' => false,
|
53 | 80 | 'before_array_assignments_equals' => false,
|
54 | 81 | ],
|
| 82 | + 'elseif' => true, |
| 83 | + 'encoding' => true, |
| 84 | + 'ereg_to_preg' => true, |
| 85 | + 'error_suppression' => true, |
55 | 86 | 'explicit_indirect_variable' => true,
|
| 87 | + 'full_opening_tag' => true, |
56 | 88 | '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, |
60 | 93 | 'header_comment' => [
|
61 | 94 | 'header' => $header,
|
62 | 95 | 'location' => 'after_open',
|
63 | 96 | ],
|
| 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 | + ], |
64 | 107 | '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, |
65 | 114 | 'multiline_comment_opening_closing' => true,
|
66 | 115 | 'multiline_whitespace_before_semicolons' => [
|
67 | 116 | 'strategy' => 'new_line_for_chained_calls',
|
68 | 117 | ],
|
| 118 | + 'native_constant_invocation' => true, |
| 119 | + 'native_function_casing' => true, |
| 120 | + 'new_with_braces' => true, |
| 121 | + 'no_alias_functions' => true, |
69 | 122 | '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, |
70 | 130 | 'no_extra_blank_lines' => [
|
71 | 131 | 'tokens' => [
|
72 | 132 | 'break',
|
| 133 | + 'case', |
73 | 134 | 'continue',
|
74 | 135 | 'curly_brace_block',
|
| 136 | + 'default', |
75 | 137 | 'extra',
|
76 | 138 | 'parenthesis_brace_block',
|
77 | 139 | 'return',
|
78 | 140 | 'square_brace_block',
|
| 141 | + 'switch', |
79 | 142 | 'throw',
|
80 | 143 | 'use',
|
81 | 144 | ],
|
82 | 145 | ],
|
| 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, |
83 | 160 | 'no_superfluous_elseif' => true,
|
84 |
| - 'no_superfluous_phpdoc_tags' => false, |
| 161 | + 'no_superfluous_phpdoc_tags' => [ |
| 162 | + 'allow_mixed' => true, |
| 163 | + ], |
85 | 164 | 'no_unset_cast' => true,
|
| 165 | + 'no_unneeded_control_parentheses' => true, |
| 166 | + 'no_unneeded_curly_braces' => true, |
| 167 | + 'no_unneeded_final_method' => true, |
86 | 168 | 'no_unset_on_property' => true,
|
| 169 | + 'no_unused_imports' => true, |
87 | 170 | 'no_useless_else' => true,
|
88 | 171 | '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, |
89 | 181 | 'ordered_imports' => [
|
90 | 182 | 'imports_order' => [
|
91 | 183 | 'class',
|
|
94 | 186 | ],
|
95 | 187 | 'sort_algorithm' => 'alpha',
|
96 | 188 | ],
|
| 189 | + 'php_unit_dedicate_assert' => true, |
| 190 | + 'php_unit_fqcn_annotation' => true, |
97 | 191 | 'php_unit_method_casing' => [
|
98 | 192 | 'case' => 'camel_case',
|
99 | 193 | ],
|
|
107 | 201 | 'phpdoc_add_missing_param_annotation' => [
|
108 | 202 | 'only_untyped' => true,
|
109 | 203 | ],
|
| 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, |
110 | 211 | 'phpdoc_order' => true,
|
| 212 | + 'phpdoc_return_self_reference' => true, |
| 213 | + 'phpdoc_scalar' => true, |
| 214 | + 'phpdoc_separation' => true, |
111 | 215 | 'phpdoc_single_line_var_spacing' => true,
|
| 216 | + 'phpdoc_tag_type' => true, |
112 | 217 | 'phpdoc_to_comment' => false,
|
| 218 | + 'phpdoc_trim' => true, |
113 | 219 | '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 | + ], |
114 | 225 | 'phpdoc_var_annotation_correct_order' => true,
|
| 226 | + 'phpdoc_var_without_name' => true, |
| 227 | + 'pow_to_exponentiation' => true, |
| 228 | + 'protected_to_private' => true, |
115 | 229 | '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, |
116 | 242 | '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, |
117 | 252 | 'visibility_required' => [
|
118 | 253 | 'elements' => [
|
119 | 254 | 'const',
|
120 |
| - 'method', |
121 | 255 | 'property',
|
| 256 | + 'method', |
122 | 257 | ],
|
123 | 258 | ],
|
124 | 259 | 'void_return' => true,
|
| 260 | + 'whitespace_after_comma_in_array' => true, // alerady in symfony set |
125 | 261 | ])
|
126 | 262 | ->setFinder($finder)
|
127 | 263 | ;
|
|
0 commit comments