-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpcs.xml
209 lines (195 loc) · 8.47 KB
/
phpcs.xml
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
199
200
201
202
203
204
205
206
207
208
209
<?xml version="1.0"?>
<ruleset name="MariaStan">
<ini name="memory_limit" value="256M"/>
<config name="php_version" value="80100"/>
<arg name="basepath" value="."/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="encoding" value="utf-8"/>
<arg name="tab-width" value="4"/>
<arg name="cache" value="tmp/cache/phpcs"/>
<arg value="s"/>
<file>src/</file>
<file>tests/</file>
<rule ref="PSR12">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="1" />
</properties>
</rule>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
</rule>
<rule ref="./vendor/slevomat/coding-standard/SlevomatCodingStandard/ruleset.xml">
<exclude name="SlevomatCodingStandard.Files.LineLength.LineTooLong"/>
<exclude name="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions" />
<exclude name="SlevomatCodingStandard.Classes.RequireAbstractOrFinal" />
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions"/>
<exclude name="SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces" />
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming" />
<exclude name="SlevomatCodingStandard.ControlStructures.RequireYodaComparison" />
<exclude name="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint" />
<exclude name="SlevomatCodingStandard.Functions.FunctionLength" />
<exclude name="SlevomatCodingStandard.Functions.DisallowArrowFunction.DisallowedArrowFunction" />
<exclude name="SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator.DisallowedNumericLiteralSeparator"/>
<exclude name="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion.DisallowedConstructorPropertyPromotion"/>
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator.DisallowedNullSafeObjectOperator"/>
<exclude name="SlevomatCodingStandard.Functions.DisallowNamedArguments"/>
<exclude name="SlevomatCodingStandard.Classes.RequireAbstractOrFinal"/>
<exclude name="SlevomatCodingStandard.Exceptions.DisallowNonCapturingCatch"/>
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostIncrementOperator"/>
<exclude name="SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators.DisallowedPostDecrementOperator"/>
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowShortTernaryOperator" />
<exclude name="SlevomatCodingStandard.ControlStructures.NewWithoutParentheses" />
<exclude name="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousErrorNaming"/>
<exclude name="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
<exclude name="SlevomatCodingStandard.Complexity.Cognitive"/>
<exclude name="SlevomatCodingStandard.Files.FileLength"/>
<exclude name="SlevomatCodingStandard.Classes.ClassLength"/>
<!-- It interferes with test data providers etc -->
<exclude name="SlevomatCodingStandard.Arrays.AlphabeticallySortedByKeys"/>
<!-- it's not safe, its fixes can have different semantics -->
<exclude name="SlevomatCodingStandard.PHP.UselessParentheses"/>
<!-- I'm using public readonly extensively and currently there's no way to enable just public readonly -->
<exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty" />
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="src" value="MariaStan"/>
<element key="tests" value="MariaStan"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties>
<property name="linesCountAfterOpeningBrace" value="0" />
<property name="linesCountBeforeClosingBrace" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="namespacesRequiredToUse" type="array">
<element value="MariaStan" />
</property>
<property name="allowPartialUses" value="true"/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFallbackGlobalConstants" value="false"/>
<property name="allowFullyQualifiedExceptions" value="false"/>
<property name="allowFullyQualifiedNameForCollidingClasses" value="true"/>
<property name="allowFullyQualifiedNameForCollidingFunctions" value="true"/>
<property name="allowFullyQualifiedNameForCollidingConstants" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
<property name="groups" type="array">
<element value="uses"/>
<element value="enum cases"/>
<element value="constants"/>
<element value="properties"/>
<element value="constructor"/>
<element value="methods"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBetweenUseTypes" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="linesCountBeforeDeclare" value="1" />
<property name="linesCountAfterDeclare" value="1"/>
<property name="spacesCountAroundEqualsSign" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
<properties>
<property name="controlStructures" type="array">
<!-- disregard case, default -->
<element value="if"/>
<element value="do"/>
<element value="while"/>
<element value="for"/>
<element value="foreach"/>
<element value="try"/>
<element value="switch"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing">
<properties>
<property name="jumpStatements" type="array">
<!-- disregard break, continue -->
<element value="goto"/>
<element value="return"/>
<element value="throw"/>
<element value="yield"/>
<element value="yield_from"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<exclude-pattern>tests</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter">
<exclude-pattern>src/Database/FunctionInfo/</exclude-pattern>
<exclude-pattern>src/PHPStan</exclude-pattern>
<exclude-pattern>tests/PHPStan</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.PHP.DisallowReference.DisallowedInheritingVariableByReference">
<exclude-pattern>tests/</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit">
<properties>
<property name="ignoreTrailingIfWithOneInstruction" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBeforeFirstUseWhenFirstInClass" value="0" />
<property name="linesCountAfterLastUseWhenLastInClass" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireSingleLineCondition">
<properties>
<property name="maxLineLength" value="120" />
<property name="alwaysForSimpleConditions" value="false" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall">
<properties>
<property name="onlySingleLine" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInClosureUse">
<properties>
<property name="onlySingleLine" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
<properties>
<property name="onlySingleLine" value="true" />
</properties>
</rule>
</ruleset>