-
Notifications
You must be signed in to change notification settings - Fork 0
/
.php_cs
147 lines (142 loc) · 7.17 KB
/
.php_cs
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
<?php
$header = <<<EOF
This file is part of semver/semver.
(c) SemVer <https://github.com/git-pull-request>
For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules(
[
'@PSR2' => true,
'align_double_arrow' => true, // conflict with @Symfony
'align_equals' => true, // conflict with @Symfony
'binary_operator_spaces' => true, // @Symfony
// 'blank_line_after_namespace' => true, // @PSR2, @Symfony
'blank_line_after_opening_tag' => true, // @Symfony
'blank_line_before_return' => true, // @Symfony
// 'braces' => true, // @PSR2, @Symfony
'cast_spaces' => true, // @Symfony
// 'class_definition' => true, // @PSR2, @Symfony
'combine_consecutive_unsets' => true,
// 'concat_with_spaces' => false,
'concat_without_spaces' => true, // @Symfony
// 'dir_constant' => false,
// 'echo_to_print' => false,
// 'elseif' => true, // @PSR2, @Symfony
// 'encoding' => true, // @PSR1, @PSR2, @Symfony
// 'ereg_to_preg' => false,
// 'full_opening_tag' => true, // @PSR1, @PSR2, @Symfony
// 'function_declaration' => true, // @PSR2, @Symfony
'function_typehint_space' => true, // @Symfony
// 'general_phpdoc_annotation_remove' => false,
// 'general_phpdoc_annotation_rename' => false,
'hash_to_slash_comment' => true, // @Symfony
'header_comment' => ['header' => $header],
'heredoc_to_nowdoc' => true, // @Symfony
'include' => true, // @Symfony
// 'linebreak_after_opening_tag' => false,
// 'long_array_syntax' => false,
'lowercase_cast' => true, // @Symfony
// 'lowercase_constants' => true, // @PSR2, @Symfony
// 'lowercase_keywords' => true, // @PSR2, @Symfony
// 'method_argument_space' => true, // @PSR2, @Symfony
'method_separation' => true, // @Symfony
'modernize_types_casting' => true,
'native_function_casing' => true, // @Symfony
'new_with_braces' => true, // @Symfony
'no_alias_functions' => true, // @Symfony
'no_blank_lines_after_class_opening' => true, // @Symfony
'no_blank_lines_after_phpdoc' => true, // @Symfony
// 'no_blank_lines_before_namespace' => false,
// 'no_closing_tag' => true, // @PSR2, @Symfony
'no_empty_comment' => true,
'no_empty_phpdoc' => true, // @Symfony
'no_empty_statement' => true, // @Symfony
'no_extra_consecutive_blank_lines' => true, // @Symfony
'no_leading_import_slash' => true, // @Symfony
'no_leading_namespace_whitespace' => true, // @Symfony
'no_multiline_whitespace_around_double_arrow' => true, // @Symfony
// 'no_multiline_whitespace_before_semicolons' => false,
'no_php4_constructor' => true,
'no_short_bool_cast' => true, // @Symfony
'no_short_echo_tag' => true,
'no_singleline_whitespace_before_semicolons' => true, // @Symfony
// 'no_spaces_after_function_name' => true, // @PSR2, @Symfony
'no_spaces_inside_offset' => true, // @Symfony
// 'no_spaces_inside_parenthesis' => true, // @PSR2, @Symfony
// 'no_tab_indentation' => true, // @PSR2, @Symfony
'no_trailing_comma_in_list_call' => true, // @Symfony
'no_trailing_comma_in_singleline_array' => true, // @Symfony
// 'no_trailing_whitespace' => true, // @PSR2, @Symfony
// 'no_trailing_whitespace_in_comment' => true, // @PSR2, @Symfony
'no_unneeded_control_parentheses' => true, // @Symfony
'no_unreachable_default_argument_value' => true, // @Symfony
'no_unused_imports' => true, // @Symfony
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true, // @Symfony
'no_whitespace_in_blank_lines' => true, // @Symfony
// 'not_operator_with_space' => false,
// 'not_operator_with_successor_space' => false,
'object_operator_without_whitespace' => true, // @Symfony
'ordered_class_elements' => true,
'ordered_imports' => true,
// 'php_unit_construct' => false,
// 'php_unit_dedicate_assert' => false,
// 'php_unit_strict' => false,
'phpdoc_align' => true, // @Symfony
'phpdoc_indent' => true, // @Symfony
'phpdoc_inline_tag' => true, // @Symfony
'phpdoc_no_access' => true, // @Symfony
'phpdoc_no_empty_return' => true, // @Symfony
'phpdoc_no_package' => true, // @Symfony
'phpdoc_order' => true,
// 'phpdoc_property' => false,
'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_type_to_var' => true, // @Symfony
'phpdoc_types' => true, // @Symfony
// 'phpdoc_var_to_type' => false,
'phpdoc_var_without_name' => true, // @Symfony
'pre_increment' => true, // @Symfony
'print_to_echo' => true, // @Symfony
// 'psr0' => false,
// 'random_api_migration' => false,
'self_accessor' => true, // @Symfony
'short_array_syntax' => true,
'short_scalar_cast' => true, // @Symfony
'simplified_null_return' => true, // @Symfony
// 'single_blank_line_at_eof' => true, // @PSR2, @Symfony
'single_blank_line_before_namespace' => true, // @Symfony
// 'single_import_per_statement' => true, // @PSR2, @Symfony
// 'single_line_after_imports' => true, // @PSR2, @Symfony
'single_quote' => true, // @Symfony
'space_after_semicolon' => true, // @Symfony
'standardize_not_equals' => true, // @Symfony
'strict_comparison' => true,
'strict_param' => true,
// 'switch_case_semicolon_to_colon' => true, // @PSR2, @Symfony
// 'switch_case_space' => true, // @PSR2, @Symfony
'ternary_operator_spaces' => true, // @Symfony
'trailing_comma_in_multiline_array' => true, // @Symfony
'trim_array_spaces' => true, // @Symfony
// 'unalign_double_arrow' => false, // @Symfony
// 'unalign_equals' => false, // @Symfony
'unary_operator_spaces' => true, // @Symfony
// 'unix_line_endings' => true, // @PSR2, @Symfony
// 'visibility_required' => true, // @PSR2, @Symfony
'whitespace_after_comma_in_array' => true, // @Symfony
]
)
->finder($finder)
;