-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.php-cs-fixer.php
178 lines (151 loc) · 5.06 KB
/
.php-cs-fixer.php
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
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->in(__DIR__ . '/migrations')
->notPath('Kernel.php')
;
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setUsingCache(true)
->setCacheFile(__DIR__. '/var/cache/php_cs.cache')
->setFinder($finder)
->setRules([
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'@PSR2' => true,
'@PHP82Migration' => true,
'@PHP80Migration:risky' => true,
'align_multiline_comment' => [
'comment_type' => 'all_multiline',
],
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'backtick_to_shell_exec' => true,
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'curly_braces_position' => [
'classes_opening_brace' => 'same_line',
'functions_opening_brace' => 'same_line',
],
'cast_spaces' => [
'space' => 'single',
],
'class_attributes_separation' => true,
'class_keyword_remove' => false,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'combine_nested_dirname' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'date_time_immutable' => true,
'declare_strict_types' => true,
'dir_constant' => true,
'elseif' => false,
'encoding' => true,
'ereg_to_preg' => true,
'escape_implicit_backslashes' => true,
'fopen_flag_order' => true,
'fully_qualified_strict_types' => true,
'function_to_constant' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
],
'heredoc_to_nowdoc' => true,
'implode_call' => true,
'increment_style' => ['style' => 'post'],
'is_null' => true,
'line_ending' => true,
'list_syntax' => ['syntax' => 'long'],
'mb_str_functions' => true,
'modernize_types_casting' => true,
'no_extra_blank_lines' => true,
'no_mixed_echo_print' => ['use' => 'echo'],
'no_php4_constructor' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'non_printable_character' => [
'use_escape_sequences_in_strings' => true,
],
'not_operator_with_space' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_class_elements' => ['order' => [
'use_trait',
'constant',
'constant_public',
'constant_protected',
'constant_private',
'public',
'protected',
'private',
'property',
'property_static',
'property_public',
'property_protected',
'property_private',
'property_public_static',
'property_protected_static',
'property_private_static',
'construct',
'magic',
'destruct',
'method',
'method_static',
'method_private',
'method_public_static',
'method_protected_static',
'method_private_static',
'method_protected',
'method_public',
'phpunit',
]
],
'ordered_imports' => true,
'php_unit_construct' => true,
'php_unit_dedicate_assert' => [
'target' => '5.6',
],
'php_unit_dedicate_assert_internal_type' => [
'target' => '7.5',
],
'php_unit_expectation' => [
'target' => '5.6',
],
'php_unit_mock' => [
'target' => '5.5',
],
'php_unit_mock_short_will_return' => true,
'php_unit_namespaced' => [
'target' => '6.0',
],
'php_unit_no_expectation_annotation' => [
'target' => '4.3',
],
'php_unit_internal_class' => ['types' => []],
'php_unit_test_class_requires_covers' => false,
'php_unit_strict' => true,
'phpdoc_add_missing_param_annotation' => [
'only_untyped' => false
],
'phpdoc_align' => [
'align' => 'left'
],
'phpdoc_annotation_without_dot' => false,
'phpdoc_order' => true,
'random_api_migration' => true,
'return_type_declaration' => [
'space_before' => 'one'
],
'self_accessor' => true,
'self_static_accessor' => true,
'single_import_per_statement' => true,
'simplified_null_return' => true,
'strict_comparison' => true,
'strict_param' => true,
'ternary_to_null_coalescing' => true,
'void_return' => true,
]);