-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.php-cs-fixer.dist.php
More file actions
167 lines (162 loc) · 9.66 KB
/
Copy path.php-cs-fixer.dist.php
File metadata and controls
167 lines (162 loc) · 9.66 KB
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
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = Finder::create()
->exclude('node_modules')
->exclude('vendor')
->in(__DIR__);
$config = new Config();
return $config
->setRules(
[
// Rulesets
'@PSR12' => true,
'@PHP83Migration' => true,
'@PHP84Migration' => true,
// Individual rules
'no_multiline_whitespace_around_double_arrow' => true,
'no_trailing_comma_in_singleline' => true,
'trim_array_spaces' => true,
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'attribute_empty_parentheses' => true,
'ordered_attributes' => true,
'non_printable_character' => ['use_escape_sequences_in_strings' => true],
'class_reference_name_casing' => true,
'integer_literal_case' => true,
'magic_constant_casing' => true,
'magic_method_casing' => true,
'native_function_casing' => true,
'native_type_declaration_casing' => true,
'cast_spaces' => true,
'modernize_types_casting' => true,
'no_short_bool_cast' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'method' => 'one',
'property' => 'only_if_meta',
'trait_import' => 'none',
],
],
'ordered_interfaces' => true,
'ordered_types' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'self_static_accessor' => true,
'multiline_comment_opening_closing' => true,
'single_line_comment_spacing' => true,
'empty_loop_condition' => true,
'include' => true,
'no_alternative_syntax' => ['fix_non_monolithic_code' => false],
'no_break_comment' => ['comment_text' => 'No break'],
'no_superfluous_elseif' => true,
'no_unneeded_braces' => ['namespaces' => true],
'no_unneeded_control_parentheses' => true,
'no_useless_else' => true,
'simplified_if_return' => true,
'switch_continue_to_break' => true,
'yoda_style' => ['always_move_variable' => true],
'combine_nested_dirname' => true,
'fopen_flag_order' => true,
'implode_call' => true,
'lambda_not_used_import' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_sprintf' => true,
'nullable_type_declaration_for_default_null_value' => true,
'void_return' => true,
'fully_qualified_strict_types' => ['import_symbols' => true],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'no_unneeded_import_alias' => true,
'no_unused_imports' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'single_import_per_statement' => ['group_to_single_imports' => true],
'combine_consecutive_unsets' => true,
'declare_parentheses' => true,
'dir_constant' => true,
'explicit_indirect_variable' => true,
'function_to_constant' => true,
'get_class_to_class_keyword' => true,
'is_null' => true,
'nullable_type_declaration' => true,
'no_leading_namespace_whitespace' => true,
'concat_space' => ['spacing' => 'one'],
'logical_operators' => true,
'no_useless_nullsafe_operator' => true,
'object_operator_without_whitespace' => true,
'operator_linebreak' => ['position' => 'end', 'only_booleans' => true],
'standardize_not_equals' => true,
'ternary_to_elvis_operator' => true,
'php_unit_attributes' => true,
'php_unit_construct' => true,
'php_unit_data_provider_static' => true,
'php_unit_dedicate_assert' => ['target' => '5.6'],
'php_unit_dedicate_assert_internal_type' => ['target' => '7.5'],
'php_unit_expectation' => ['target' => '8.4'],
'php_unit_mock_short_will_return' => true,
'php_unit_set_up_tear_down_visibility' => true,
'php_unit_test_annotation' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'align_multiline_comment' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_param_order' => true,
'phpdoc_scalar' => true,
'phpdoc_separation' => [
'groups' => [
['deprecated'],
['see'],
['link'],
['author'],
['category', 'package', 'subpackage'],
['property', 'property-read', 'property-write'],
['param'],
['phpstan-param', 'psalm-param'],
['return'],
['phpstan-return', 'psalm-return'],
['throws'],
],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_tag_type' => ['tags' => ['inheritDoc' => 'inline']],
'phpdoc_to_comment' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
'no_useless_return' => true,
'return_assignment' => true,
'simplified_null_return' => true,
'multiline_whitespace_before_semicolons' => true,
'no_empty_statement' => true,
'no_singleline_whitespace_before_semicolons' => true,
'semicolon_after_instruction' => true,
'multiline_string_to_heredoc' => true,
'single_quote' => true,
'array_indentation' => true,
'method_chaining_indentation' => true,
'no_spaces_around_offset' => true,
'type_declaration_spaces' => true,
'types_spaces' => ['space_multiple_catch' => 'single'],
]
)
->setLineEnding("\n")
->setRiskyAllowed(true)
->setFinder($finder);