1
- <?php
2
-
3
- $ finder = PhpCsFixer \Finder::create ()
4
- ->in ('src ' )
5
- ->in ('tests ' )
6
- ;
7
-
8
- return PhpCsFixer \Config::create ()
9
- ->setRiskyAllowed (true )
10
- ->setRules ([
11
- 'array_indentation ' => true ,
12
- 'array_syntax ' => ['syntax ' => 'short ' ],
13
- 'binary_operator_spaces ' => ['align_double_arrow ' =>true ],
14
- 'blank_line_after_namespace ' => true ,
15
- 'blank_line_after_opening_tag ' => true ,
16
- 'blank_line_before_statement ' => ['statements ' =>['return ' ]],
17
- 'braces ' => ['allow_single_line_closure ' => false ],
18
- 'cast_spaces ' => true ,
19
- 'class_attributes_separation ' => ['elements ' =>['method ' ]],
20
- 'class_definition ' => ['single_line ' =>true ],
21
- 'combine_consecutive_issets ' => true ,
22
- 'concat_space ' => ['spacing ' => 'one ' ],
23
- 'declare_equal_normalize ' => true ,
24
- 'elseif ' => true ,
25
- 'encoding ' => true ,
26
- 'full_opening_tag ' => true ,
27
- 'function_declaration ' => true ,
28
- 'function_typehint_space ' => true ,
29
- 'include ' => true ,
30
- 'increment_style ' => true ,
31
- 'indentation_type ' => true ,
32
- 'line_ending ' => true ,
33
- 'linebreak_after_opening_tag ' => true ,
34
- 'lowercase_cast ' => true ,
35
- 'lowercase_keywords ' => true ,
36
- 'lowercase_static_reference ' => true ,
37
- 'magic_constant_casing ' => true ,
38
- 'magic_method_casing ' => true ,
39
- 'mb_str_functions ' => false ,
40
- 'method_argument_space ' => true ,
41
- 'native_function_casing ' => true ,
42
- 'native_function_invocation ' => true ,
43
- 'native_function_type_declaration_casing ' => true ,
44
- 'new_with_braces ' => true ,
45
- 'no_blank_lines_after_class_opening ' => true ,
46
- 'no_blank_lines_after_phpdoc ' => true ,
47
- 'no_break_comment ' => true ,
48
- 'no_closing_tag ' => true ,
49
- 'no_empty_comment ' => true ,
50
- 'no_empty_phpdoc ' => true ,
51
- 'no_empty_statement ' => true ,
52
- 'no_extra_blank_lines ' => ['tokens ' =>[
53
- 'curly_brace_block ' ,
54
- 'extra ' ,
55
- 'parenthesis_brace_block ' ,
56
- 'square_brace_block ' ,
57
- 'throw ' ,
58
- 'use ' ,
59
- ]],
60
- 'no_leading_import_slash ' => true ,
61
- 'no_leading_namespace_whitespace ' => true ,
62
- 'no_mixed_echo_print ' => true ,
63
- 'no_multiline_whitespace_around_double_arrow ' => true ,
64
- 'no_null_property_initialization ' => true ,
65
- 'no_short_bool_cast ' => true ,
66
- 'no_singleline_whitespace_before_semicolons ' => true ,
67
- 'no_superfluous_elseif ' => true ,
68
- 'no_spaces_after_function_name ' => true ,
69
- 'no_spaces_around_offset ' => true ,
70
- 'no_spaces_inside_parenthesis ' => true ,
71
- 'no_superfluous_phpdoc_tags ' => ['allow_mixed ' => true , 'allow_unused_params ' => true ],
72
- 'no_trailing_comma_in_list_call ' => true ,
73
- 'no_trailing_comma_in_singleline_array ' => true ,
74
- 'no_trailing_whitespace ' => true ,
75
- 'no_trailing_whitespace_in_comment ' => true ,
76
- 'no_unneeded_control_parentheses ' => true ,
77
- 'no_unneeded_curly_braces ' => ['namespaces ' => true ],
78
- 'no_unused_imports ' => true ,
79
- 'no_useless_else ' => true ,
80
- 'no_useless_return ' => true ,
81
- 'no_whitespace_before_comma_in_array ' => true ,
82
- 'no_whitespace_in_blank_line ' => true ,
83
- 'normalize_index_brace ' => true ,
84
- 'not_operator_with_space ' => false ,
85
- 'object_operator_without_whitespace ' => true ,
86
- 'ordered_class_elements ' => true ,
87
- 'ordered_imports ' => true ,
88
- 'php_unit_fqcn_annotation ' => true ,
89
- 'phpdoc_align ' => ['tags ' => [
90
- 'method ' ,
91
- 'param ' ,
92
- 'property ' ,
93
- 'property-read ' ,
94
- 'return ' ,
95
- 'throws ' ,
96
- 'type ' ,
97
- 'var ' ,
98
- ]],
99
- 'phpdoc_add_missing_param_annotation ' => true ,
100
- 'phpdoc_annotation_without_dot ' => true ,
101
- 'phpdoc_indent ' => true ,
102
- 'phpdoc_inline_tag ' => true ,
103
- 'phpdoc_no_access ' => true ,
104
- 'phpdoc_no_alias_tag ' => false ,
105
- 'phpdoc_no_package ' => true ,
106
- 'phpdoc_no_useless_inheritdoc ' => true ,
107
- 'phpdoc_order ' => true ,
108
- 'phpdoc_return_self_reference ' => true ,
109
- 'phpdoc_scalar ' => true ,
110
- 'phpdoc_separation ' => true ,
111
- 'phpdoc_single_line_var_spacing ' => true ,
112
- 'phpdoc_summary ' => true ,
113
- 'phpdoc_to_comment ' => true ,
114
- 'phpdoc_trim ' => true ,
115
- 'phpdoc_trim_consecutive_blank_line_separation ' => true ,
116
- 'phpdoc_types ' => true ,
117
- 'phpdoc_types_order ' => ['null_adjustment ' => 'always_last ' , 'sort_algorithm ' => 'none ' ],
118
- 'phpdoc_var_without_name ' => true ,
119
- 'return_assignment ' => true ,
120
- 'return_type_declaration ' => true ,
121
- 'semicolon_after_instruction ' => true ,
122
- 'simplified_null_return ' => true ,
123
- 'short_scalar_cast ' => true ,
124
- 'single_blank_line_at_eof ' => true ,
125
- 'single_blank_line_before_namespace ' => true ,
126
- 'single_class_element_per_statement ' => true ,
127
- 'single_import_per_statement ' => true ,
128
- 'single_line_after_imports ' => true ,
129
- 'single_line_comment_style ' => ['comment_types ' => ['hash ' ]],
130
- 'single_line_throw ' => true ,
131
- 'single_quote ' => true ,
132
- 'single_trait_insert_per_statement ' => true ,
133
- 'space_after_semicolon ' => ['remove_in_empty_for_expressions ' =>true ],
134
- 'standardize_increment ' => true ,
135
- 'standardize_not_equals ' => true ,
136
- 'switch_case_semicolon_to_colon ' => true ,
137
- 'switch_case_space ' => true ,
138
- 'ternary_operator_spaces ' => true ,
139
- 'ternary_to_null_coalescing ' => true ,
140
- 'trailing_comma_in_multiline_array ' => true ,
141
- 'trim_array_spaces ' => true ,
142
- 'unary_operator_spaces ' => true ,
143
- 'visibility_required ' => true ,
144
- 'whitespace_after_comma_in_array ' => true ,
145
- 'yoda_style ' => false ,
146
- ])
147
- ->setFinder ($ finder )
148
- ->setCacheFile (__DIR__ .'/.php_cs.cache ' )
149
- ;
1
+ <?php
2
+
3
+ $ config = new PhpCsFixer \Config ();
4
+ return $ config
5
+ ->setRiskyAllowed (true )
6
+ ->setRules ([
7
+ 'array_indentation ' => true ,
8
+ 'array_syntax ' => ['syntax ' => 'short ' ],
9
+ 'binary_operator_spaces ' => true ,
10
+ 'blank_line_after_namespace ' => true ,
11
+ 'blank_line_after_opening_tag ' => true ,
12
+ 'blank_line_before_statement ' => ['statements ' =>['return ' ]],
13
+ 'braces ' => ['allow_single_line_closure ' => false ],
14
+ 'cast_spaces ' => true ,
15
+ // 'class_attributes_separation' => ['const' => 'one','method' => 'one','property' => 'one','trait_import' => 'none'],
16
+ 'class_definition ' => ['single_line ' =>true ],
17
+ 'combine_consecutive_issets ' => true ,
18
+ 'concat_space ' => ['spacing ' => 'one ' ],
19
+ 'declare_equal_normalize ' => true ,
20
+ 'elseif ' => true ,
21
+ 'encoding ' => true ,
22
+ 'full_opening_tag ' => true ,
23
+ 'function_declaration ' => true ,
24
+ 'function_typehint_space ' => true ,
25
+ 'include ' => true ,
26
+ 'increment_style ' => true ,
27
+ 'indentation_type ' => true ,
28
+ 'line_ending ' => true ,
29
+ 'linebreak_after_opening_tag ' => true ,
30
+ 'lowercase_cast ' => true ,
31
+ 'lowercase_keywords ' => true ,
32
+ 'lowercase_static_reference ' => true ,
33
+ 'magic_constant_casing ' => true ,
34
+ 'magic_method_casing ' => true ,
35
+ 'mb_str_functions ' => false ,
36
+ 'method_argument_space ' => true ,
37
+ 'native_function_casing ' => true ,
38
+ 'native_function_invocation ' => ['include ' =>['@all ' ]],
39
+ 'native_function_type_declaration_casing ' => true ,
40
+ 'new_with_braces ' => true ,
41
+ 'no_blank_lines_after_class_opening ' => true ,
42
+ 'no_blank_lines_after_phpdoc ' => true ,
43
+ 'no_break_comment ' => true ,
44
+ 'no_closing_tag ' => true ,
45
+ 'no_empty_comment ' => true ,
46
+ 'no_empty_phpdoc ' => true ,
47
+ 'no_empty_statement ' => true ,
48
+ 'no_extra_blank_lines ' =>
49
+ ['tokens ' =>
50
+ [
51
+ 'curly_brace_block ' ,
52
+ 'extra ' ,
53
+ 'parenthesis_brace_block ' ,
54
+ 'square_brace_block ' ,
55
+ 'throw ' ,
56
+ 'use ' ,
57
+ ]
58
+ ],
59
+ 'no_leading_import_slash ' => true ,
60
+ 'no_leading_namespace_whitespace ' => true ,
61
+ 'no_mixed_echo_print ' => true ,
62
+ 'no_multiline_whitespace_around_double_arrow ' => true ,
63
+ 'no_null_property_initialization ' => true ,
64
+ 'no_short_bool_cast ' => true ,
65
+ 'no_singleline_whitespace_before_semicolons ' => true ,
66
+ 'no_superfluous_elseif ' => true ,
67
+ 'no_spaces_after_function_name ' => true ,
68
+ 'no_spaces_around_offset ' => true ,
69
+ 'no_spaces_inside_parenthesis ' => true ,
70
+ 'no_superfluous_phpdoc_tags ' => ['allow_mixed ' => true , 'allow_unused_params ' => true ],
71
+ 'no_trailing_comma_in_list_call ' => true ,
72
+ 'no_trailing_comma_in_singleline_array ' => true ,
73
+ 'no_trailing_whitespace ' => true ,
74
+ 'no_trailing_whitespace_in_comment ' => true ,
75
+ 'no_unneeded_control_parentheses ' => true ,
76
+ 'no_unneeded_curly_braces ' => ['namespaces ' => true ],
77
+ 'no_unused_imports ' => true ,
78
+ 'no_useless_else ' => true ,
79
+ 'no_useless_return ' => true ,
80
+ 'no_whitespace_before_comma_in_array ' => true ,
81
+ 'no_whitespace_in_blank_line ' => true ,
82
+ 'normalize_index_brace ' => true ,
83
+ 'not_operator_with_space ' => false ,
84
+ 'object_operator_without_whitespace ' => true ,
85
+ 'ordered_class_elements ' => true ,
86
+ 'ordered_imports ' => true ,
87
+ 'php_unit_fqcn_annotation ' => true ,
88
+ 'phpdoc_align ' =>
89
+ ['tags ' =>
90
+ [
91
+ 'method ' ,
92
+ 'param ' ,
93
+ 'property ' ,
94
+ 'property-read ' ,
95
+ 'return ' ,
96
+ 'throws ' ,
97
+ 'type ' ,
98
+ 'var ' ,
99
+ ]
100
+ ],
101
+ 'phpdoc_add_missing_param_annotation ' => true ,
102
+ 'phpdoc_annotation_without_dot ' => true ,
103
+ 'phpdoc_indent ' => true ,
104
+ 'phpdoc_inline_tag_normalizer ' => true ,
105
+ 'phpdoc_no_access ' => true ,
106
+ 'phpdoc_no_alias_tag ' => false ,
107
+ 'phpdoc_no_package ' => true ,
108
+ 'phpdoc_no_useless_inheritdoc ' => true ,
109
+ 'phpdoc_order ' => true ,
110
+ 'phpdoc_return_self_reference ' => true ,
111
+ 'phpdoc_scalar ' => true ,
112
+ 'phpdoc_separation ' => true ,
113
+ 'phpdoc_single_line_var_spacing ' => true ,
114
+ 'phpdoc_summary ' => true ,
115
+ 'phpdoc_to_comment ' => true ,
116
+ 'phpdoc_trim ' => true ,
117
+ 'phpdoc_trim_consecutive_blank_line_separation ' => true ,
118
+ 'phpdoc_types ' => true ,
119
+ 'phpdoc_types_order ' => ['null_adjustment ' => 'always_last ' , 'sort_algorithm ' => 'none ' ],
120
+ 'phpdoc_var_without_name ' => true ,
121
+ 'return_assignment ' => true ,
122
+ 'return_type_declaration ' => true ,
123
+ 'semicolon_after_instruction ' => true ,
124
+ 'simplified_null_return ' => true ,
125
+ 'short_scalar_cast ' => true ,
126
+ 'single_blank_line_at_eof ' => true ,
127
+ 'single_blank_line_before_namespace ' => true ,
128
+ 'single_class_element_per_statement ' => true ,
129
+ 'single_import_per_statement ' => true ,
130
+ 'single_line_after_imports ' => true ,
131
+ 'single_line_comment_style ' => ['comment_types ' => ['hash ' ]],
132
+ 'single_line_throw ' => true ,
133
+ 'single_quote ' => true ,
134
+ 'single_trait_insert_per_statement ' => true ,
135
+ 'space_after_semicolon ' => ['remove_in_empty_for_expressions ' =>true ],
136
+ 'standardize_increment ' => true ,
137
+ 'standardize_not_equals ' => true ,
138
+ 'switch_case_semicolon_to_colon ' => true ,
139
+ 'switch_case_space ' => true ,
140
+ 'ternary_operator_spaces ' => true ,
141
+ 'ternary_to_null_coalescing ' => true ,
142
+ 'trailing_comma_in_multiline ' => true ,
143
+ 'trim_array_spaces ' => true ,
144
+ 'unary_operator_spaces ' => true ,
145
+ 'visibility_required ' => true ,
146
+ 'whitespace_after_comma_in_array ' => true ,
147
+ 'yoda_style ' => false ,
148
+ ])
149
+ ->setFinder (PhpCsFixer \Finder::create ()
150
+ ->exclude ('vendor ' )
151
+ ->in ('src ' )
152
+ ->in ('tests ' )
153
+ )
154
+ ;
0 commit comments