-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
189 lines (160 loc) · 8.8 KB
/
phpcs.xml.dist
File metadata and controls
189 lines (160 loc) · 8.8 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?xml version="1.0"?>
<ruleset name="MethorZ OpenAPI Generator Coding Standard">
<description>Coding standard for MethorZ OpenAPI Generator package</description>
<!-- Paths to check -->
<file>src</file>
<file>tests</file>
<!-- Use colors in output -->
<arg name="colors"/>
<!-- Show progress -->
<arg value="p"/>
<!-- Show sniff codes -->
<arg value="s"/>
<!-- Use parallel processing (150 files at once) -->
<arg name="parallel" value="150"/>
<!-- Base rule: PSR-12 -->
<rule ref="PSR12"/>
<!-- Slevomat Coding Standard -->
<config name="installed_paths" value="../../slevomat/coding-standard"/>
<rule ref="SlevomatCodingStandard">
<!-- Disable ClassStructure sniff (too complex to configure) -->
<exclude name="SlevomatCodingStandard.Classes.ClassStructure"/>
<!-- Disable deprecated UnionTypeHintFormat (replaced by DNFTypeHintFormat) -->
<exclude name="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat"/>
<!-- Disable conflicting sniffs -->
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses"/>
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseSpacing"/>
<!-- Disable some overly strict rules -->
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/>
<exclude name="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming"/>
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowEmpty"/>
<exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<exclude name="SlevomatCodingStandard.Files.TypeNameMatchesFileName"/>
<exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces"/>
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
<exclude name="SlevomatCodingStandard.PHP.RequireExplicitAssertion"/>
<exclude name="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/>
<exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/>
</rule>
<!-- Unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- Attributes order (alphabetically) -->
<rule ref="SlevomatCodingStandard.Attributes.AttributesOrder">
<properties>
<property name="orderAlphabetically" value="true"/>
</properties>
</rule>
<!-- Strict types declaration -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="false"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<!-- Cyclomatic complexity -->
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="15"/>
<property name="absoluteComplexity" value="15"/>
</properties>
</rule>
<!-- Disable cognitive complexity (covered by cyclomatic complexity) -->
<rule ref="SlevomatCodingStandard.Complexity.Cognitive">
<exclude name="SlevomatCodingStandard.Complexity.Cognitive"/>
</rule>
<!-- Disable function length (covered by complexity metrics) -->
<rule ref="SlevomatCodingStandard.Functions.FunctionLength">
<exclude name="SlevomatCodingStandard.Functions.FunctionLength"/>
</rule>
<!-- Disable constructor property promotion rule (we use it extensively) -->
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion">
<exclude name="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion">
<exclude name="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion"/>
</rule>
<!-- Allow useless parentheses in new (modern PHP style) -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn">
<exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/>
</rule>
<!-- Disable strict empty line rules (cosmetic preference) -->
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<exclude name="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces"/>
</rule>
<!-- Disable alphabetical array key sorting (too strict) -->
<rule ref="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys">
<exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys"/>
</rule>
<!-- Disable one-line docblock requirement (allow multi-line for clarity) -->
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLineDocComment">
<exclude name="SlevomatCodingStandard.Commenting.RequireOneLineDocComment"/>
</rule>
<!-- Disable ternary operator requirement (readability preference) -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator">
<exclude name="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"/>
</rule>
<!-- Allow named arguments (PHP 8+ feature) -->
<rule ref="SlevomatCodingStandard.Functions.DisallowNamedArguments">
<exclude name="SlevomatCodingStandard.Functions.DisallowNamedArguments"/>
</rule>
<!-- Allow trailing commas in function calls (PHP 8+ feature) -->
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall">
<exclude name="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall"/>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
<exclude name="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration"/>
</rule>
<!-- Allow multi-line function calls for readability -->
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall">
<exclude name="SlevomatCodingStandard.Functions.RequireSingleLineCall"/>
</rule>
<!-- Allow single-line method signatures -->
<rule ref="SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature">
<exclude name="SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature"/>
</rule>
<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature">
<exclude name="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature"/>
</rule>
<!-- Allow flexible ternary operator formatting -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator">
<exclude name="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator"/>
</rule>
<!-- Allow flexible if condition formatting -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireMultiLineCondition">
<exclude name="SlevomatCodingStandard.ControlStructures.RequireMultiLineCondition"/>
</rule>
<!-- Allow passing by reference when needed -->
<rule ref="SlevomatCodingStandard.PHP.DisallowReference">
<exclude name="SlevomatCodingStandard.PHP.DisallowReference"/>
</rule>
<!-- Disable public properties rule for tests (test fixtures need them) -->
<rule ref="SlevomatCodingStandard.Classes.ForbiddenPublicProperty">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Disable unused parameter for tests (closures with unused params) -->
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Disable inline doc comment check for tests -->
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- Exclude vendor and cache directories -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/.phpunit.cache/*</exclude-pattern>
<exclude-pattern>*/tests/Fixtures/*</exclude-pattern>
</ruleset>