-
Notifications
You must be signed in to change notification settings - Fork 5
/
.php_cs.dist
198 lines (194 loc) · 9.25 KB
/
.php_cs.dist
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<?php
/*
* PHP Coding Standards Fixer Config file for PHP7.0 and up
*
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/README.rst
*/
$header = <<<'EOF'
EOF;
$finder = PhpCsFixer\Finder::create()
->exclude(['tests/Fake', 'tests/tmp', 'src-deprecated'])
->notPath('src/ClassParam.php')
->notPath('src/Invoker.php')
->in(__DIR__);
return \PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@PHP70Migration:risky' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'backtick_to_shell_exec' => true,
'binary_operator_spaces' => true, // @Symfony
'blank_line_after_opening_tag' => true, // @Symfony
'blank_line_before_return' => true,
'blank_line_before_statement' => ['statements' => ['break', 'continue', 'declare', 'return', 'throw']], // @Symfony
'braces' => true,
'cast_spaces' => true, // @Symfony
'class_attributes_separation' => ['elements' => ['const', 'method']], // @Symfony
// 'class_keyword_remove' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
// 'comment_to_phpdoc' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'], // @Symfony
'date_time_immutable' => true,
'declare_equal_normalize' => true, // @Symfony
// 'declare_strict_types' => true
'dir_constant' => true, // @Symfony:risky
'ereg_to_preg' => true, // @Symfony:risky
'error_suppression' => true, // @Symfony:risky
'escape_implicit_backslashes' => true,
'explicit_indirect_variable' => true,
'explicit_string_variable' => true,
// 'final_class' => true,
// 'final_internal_class' => true,
'fully_qualified_strict_types' => true,
// 'final_public_method_for_abstract_class' => true,
'function_to_constant' => true, // @Symfony:risky
'function_typehint_space' => true, // @Symfony
'general_phpdoc_annotation_remove' => ['author', 'category', 'package', 'copyright', 'version'],
'global_namespace_import' => ['import_classes' => true, 'import_functions' => true, 'import_constants' => true],
'header_comment' => ['header' => ''],
'heredoc_to_nowdoc' => true,
'include' => true, // @Symfony
// 'increment_style' => 'pre', // @Symfony
'indentation_type' => true,
'is_null' => ['use_yoda_style' => false], // @Symfony:risky
'linebreak_after_opening_tag' => true,
// 'list_syntax' => true,
// 'logical_operators' => true,
'lowercase_cast' => true, // @Symfony
'lowercase_static_reference' => true, // @Symfony
'magic_constant_casing' => true,
// 'mb_str_functions' => true,
'method_chaining_indentation' => true,
'method_separation' => true,
'modernize_types_casting' => true, // @Symfony:risky
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
// 'native_constant_invocation' => true,
'native_function_casing' => true, // @Symfony
// 'native_function_invocation' => true,
// 'new_with_braces' => true, // @Symfony
'no_alias_functions' => true, // @Symfony:risky
'no_alternative_syntax' => true,
'no_binary_string' => true,
'no_blank_lines_after_class_opening' => true, // @Symfony
'no_blank_lines_after_phpdoc' => true, // @Symfony
// 'no_blank_lines_before_namespace' => true,
'no_empty_comment' => true, // @Symfony
'no_empty_phpdoc' => true, // @Symfony
'no_empty_statement' => true, // @Symfony
'no_extra_blank_lines' => true,
'no_homoglyph_names' => true, // @Symfony:risky
'no_leading_import_slash' => true, // @Symfony
'no_leading_namespace_whitespace' => true, // @Symfony
'no_mixed_echo_print' => true, // @Symfony
'no_multiline_whitespace_around_double_arrow' => true, // @Symfony
'no_null_property_initialization' => true,
'no_php4_constructor' => true,
'no_short_bool_cast' => true, // @Symfony
'no_short_echo_tag' => false,
'no_singleline_whitespace_before_semicolons' => true, // @Symfony
'no_spaces_around_offset' => true, // @Symfony
'no_superfluous_elseif' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_trailing_comma_in_list_call' => true, // @Symfony
'no_trailing_comma_in_singleline_array' => true, // @Symfony
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => true, // @Symfony
'no_unneeded_curly_braces' => true, // @Symfony
'no_unneeded_final_method' => true, // @Symfony
'no_unreachable_default_argument_value' => true,
'no_unset_on_property' => false,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true, // @Symfony
'no_whitespace_in_blank_line' => true, // @Symfony
'non_printable_character' => true, // @Symfony
'normalize_index_brace' => true, // @Symfony
'not_operator_with_space' => false,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true, // @Symfony
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_construct' => true, // @Symfony:risky
'php_unit_dedicate_assert' => true,
'php_unit_dedicate_assert_internal_type' => true,
'php_unit_expectation' => true,
'php_unit_fqcn_annotation' => true, // @Symfony
// 'php_unit_internal_class' => true, // @Symfony]
// 'php_unit_mock' => true,
'php_unit_namespaced' => true,
'php_unit_no_expectation_annotation' => true,
'php_unit_ordered_covers' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_strict' => true,
// 'php_unit_test_annotation' => true,
// 'php_unit_test_case_static_method_calls' => true,
// 'php_unit_test_class_requires_covers' => true,
// 'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => ['tags' => ['param', 'return', 'throws', 'type', 'var', 'property-read', 'property-write']], // @Symfony]
'phpdoc_annotation_without_dot' => true, // @Symfony]
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_indent' => true, // @Symfony]
'phpdoc_inline_tag' => true, // @Symfony]
'phpdoc_no_access' => true, // @Symfony]
'phpdoc_no_alias_tag' => ['type' => 'var', 'link' => 'see'], // @Symfony
// 'phpdoc_no_empty_return' => true, // @Symfony
'phpdoc_no_package' => true, // @Symfony
// 'phpdoc_no_useless_inheritdoc' => true, // @Symfony
'phpdoc_order' => true,
'phpdoc_return_self_reference' => true, // @Symfony
'phpdoc_scalar' => true, // @Symfony
'phpdoc_separation' => true, // @Symfony
'phpdoc_single_line_var_spacing' => true, // @Symfony
// 'phpdoc_summary' => true, // @Symfony
// 'phpdoc_to_comment' => true, // @Symfony
'phpdoc_trim' => true, // @Symfony
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types' => true, // @Symfony
'phpdoc_types_order' => true, // @Symfony
'phpdoc_var_without_name' => true, // @Symfony
'protected_to_private' => true,
'psr0' => true,
'psr4' => true, // @Symfony:risky
'return_assignment' => false,
'return_type_declaration' => ['space_before' => 'one'],
'self_accessor' => true, // @Symfony:risky
'semicolon_after_instruction' => true, // @Symfony
'set_type_to_cast' => true, // @Symfony:risky
'short_scalar_cast' => true, // @Symfony:risky
// 'simplified_null_return' => true,
'simple_to_complex_string_variable' => true, // @Symfony
'single_blank_line_at_eof' => true, // @Symfony
'single_blank_line_before_namespace' => true, // @Symfony
// 'single_line_comment_style' => true, // @Symfony
'single_class_element_per_statement' => true,
'single_import_per_statement' => true, // @Symfony
'single_line_after_imports' => true,
'single_quote' => true, // @Symfony
'space_after_semicolon' => true, // @Symfony
'standardize_increment' => true, // @Symfony
'standardize_not_equals' => true, // @Symfony
// 'static_lambda' => true,
// 'strict_comparison' => true,
'strict_param' => true,
// 'string_line_ending' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
// 'trailing_comma_in_multiline_array' => true, // @Symfony
'trim_array_spaces' => true, // @Symfony
'unary_operator_spaces' => true, // @Symfony
'visibility_required' => ['property', 'method', 'const'],
// 'void_return' => true, // @PHP71Migration:risky
'whitespace_after_comma_in_array' => true, // @Symfony
// 'yoda_style' => true
])
->setFinder($finder);