55 ->in ([
66 __DIR__ . '/src ' ,
77 __DIR__ . '/tests '
8- ])
9- ->notName ('*.phpt ' );
8+ ]);
109
1110if (!\file_exists (__DIR__ . '/var ' )) {
1211 \mkdir (__DIR__ . '/var ' );
1312}
1413
15- /**
16- * This configuration was taken from https://github.com/sebastianbergmann/phpunit/blob/master/.php_cs.dist
17- * and slightly adjusted.
18- */
19- return PhpCsFixer \Config:: create ( )
14+ if (! \file_exists ( __DIR__ . ' /var/cs-fixer ' )) {
15+ \mkdir ( __DIR__ . ' /var/cs-fixer ' );
16+ }
17+
18+ return ( new PhpCsFixer \Config () )
2019 ->setRiskyAllowed (true )
21- ->setCacheFile (__DIR__ .'/var/. php_cs.cache ' )
20+ ->setCacheFile (__DIR__ .'/var/cs-fixer/ php_cs.cache ' )
2221 ->setRules ([
2322 'align_multiline_comment ' => true ,
2423 'array_indentation ' => true ,
3029 'continue ' ,
3130 'declare ' ,
3231 'default ' ,
33- 'die ' ,
3432 'do ' ,
3533 'exit ' ,
3634 'for ' ,
5048 ],
5149 'braces ' => true ,
5250 'cast_spaces ' => true ,
53- 'class_attributes_separation ' => ['elements ' => ['const ' , 'method ' , 'property ' ]],
51+ 'class_attributes_separation ' => ['elements ' => ['const ' => ' one ' , 'method ' => ' one ' , 'property ' => ' one ' ]],
5452 'combine_consecutive_issets ' => true ,
5553 'combine_consecutive_unsets ' => true ,
5654 'compact_nullable_typehint ' => true ,
8583 'lowercase_static_reference ' => true ,
8684 'magic_constant_casing ' => true ,
8785 'magic_method_casing ' => true ,
88- 'method_argument_space ' => ['ensure_fully_multiline ' => true ],
86+ 'method_argument_space ' => ['on_multiline ' => ' ensure_fully_multiline ' ],
8987 'modernize_types_casting ' => false ,
9088 'multiline_comment_opening_closing ' => true ,
9189 'multiline_whitespace_before_semicolons ' => true ,
9290 'native_constant_invocation ' => false ,
9391 'native_function_casing ' => false ,
94- 'native_function_invocation ' => true ,
92+ 'native_function_invocation ' => [ ' include ' => [ ' @all ' ]] ,
9593 'native_function_type_declaration_casing ' => true ,
9694 'new_with_braces ' => false ,
9795 'no_alias_functions ' => true ,
112110 'no_null_property_initialization ' => true ,
113111 'no_php4_constructor ' => true ,
114112 'no_short_bool_cast ' => true ,
115- 'no_short_echo_tag ' => true ,
113+ 'echo_tag_syntax ' => true ,
116114 'no_singleline_whitespace_before_semicolons ' => true ,
117115 'no_spaces_after_function_name ' => true ,
118116 'no_spaces_around_offset ' => true ,
159157 'method_protected_static ' ,
160158 'method_private_static ' ,
161159 ],
160+ 'sort_algorithm ' => 'alpha '
162161 ],
163162 'ordered_imports ' => [
164163 'imports_order ' => [
192191 'phpdoc_var_without_name ' => true ,
193192 'pow_to_exponentiation ' => true ,
194193 'protected_to_private ' => true ,
195- 'return_assignment ' => true ,
194+ 'return_assignment ' => false ,
196195 'return_type_declaration ' => ['space_before ' => 'one ' ],
197196 'self_accessor ' => true ,
198197 'self_static_accessor ' => true ,
208207 'standardize_not_equals ' => true ,
209208 'strict_param ' => true ,
210209 'ternary_to_null_coalescing ' => true ,
211- 'trailing_comma_in_multiline_array ' => true ,
210+ 'trailing_comma_in_multiline ' => true ,
212211 'trim_array_spaces ' => true ,
213212 'unary_operator_spaces ' => true ,
214213 'visibility_required ' => [
221220 'void_return ' => true ,
222221 'whitespace_after_comma_in_array ' => true ,
223222 ])
224- ->setFinder ($ finder );
223+ ->setFinder ($ finder );
0 commit comments