This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpcs.xml
230 lines (211 loc) · 10.1 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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<?xml version="1.0"?>
<ruleset>
<!-- Add some rulesets -->
<config name="installed_paths" value="vendor/slevomat/coding-standard"/>
<!-- Directories -->
<file>app/</file>
<file>bootstrap/</file>
<file>config/</file>
<file>database/</file>
<file>routes/</file>
<file>tests/</file>
<!-- Ignore some dependency paths -->
<exclude-pattern type="relative">^/vendor/</exclude-pattern>
<exclude-pattern type="relative">^/node_modules/</exclude-pattern>
<!-- Exclude storage and caches -->
<exclude-pattern>*/cache/*</exclude-pattern>
<exclude-pattern>/library/</exclude-pattern>
<exclude-pattern type="relative">^/storage/</exclude-pattern>
<!-- We just use PSR-12, with a fix for migrations not having namespaces -->
<rule ref="PSR12">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
</rule>
<!-- Database files don't have a namespace. -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern type="relative">^/database/</exclude-pattern>
</rule>
<!-- Never use "else if". -->
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
<type>error</type>
</rule>
<!-- Slevomatic Coding Standard: Functional -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint" /> -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint" /> -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint" /> -->
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint" />
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" type="int" value="2" />
<property name="spacesCountAroundEqualsSign" type="int" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation" />
<rule ref="SlevomatCodingStandard.Classes.ClassStructure">
<properties>
<property name="groups" type="array">
<element value="uses"/>
<element value="public constants"/>
<element value="protected constants"/>
<element value="private constants"/>
<element value="public static properties"/>
<element value="protected static properties"/>
<element value="private static properties"/>
<element value="static constructors"/>
<element value="public static methods"/>
<element value="protected static methods"/>
<element value="private static methods"/>
<element value="public static abstract methods"/>
<element value="protected static abstract methods"/>
<element value="public properties"/>
<element value="protected properties"/>
<element value="private properties"/>
<element value="constructor"/>
<element value="destructor"/>
<element value="public methods"/>
<element value="protected methods"/>
<element value="private methods"/>
<element value="public abstract methods"/>
<element value="protected abstract methods"/>
<element value="magic methods"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit" />
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
<rule ref="SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall" />
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
<!-- Slevomatic Coding Standard: Cleaning -->
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter">
<type>warning</type>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.PHP.ForbiddenClasses">
<properties>
<property name="forbiddenClasses" type="array">
<element key="Carbon directly" value="Carbon\Carbon"/>
<element key="Carbon alias" value="Carbon"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.PHP.RequireExplicitAssertion" />
<rule ref="SlevomatCodingStandard.PHP.RequireNowdoc" />
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
<properties>
<property name="ignoreComplexTernaryConditions" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable" />
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable" />
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch" />
<!-- Slevomatic Coding Standard: Formatting -->
<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement" />
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace" />
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma" />
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing">
<properties>
<property name="linesCountBetweenMembers" type="int" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition" />
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference" />
<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature">
<properties>
<property name="minLineLength" type="int" value="100" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.TraitUseDeclaration" />
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBeforeFirstUseWhenFirstInClass" type="int" value="0" />
<property name="linesCountBetweenUses" type="int" value="0" />
<property name="linesCountAfterLastUse" type="int" value="1" />
<property name="linesCountAfterLastUseWhenLastInClass" type="int" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses" />
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties>
<property name="spacesCountAfterKeyword" type="int" value="1" />
<property name="spacesCountBeforeArrow" type="int" value="1" />
<property name="spacesCountAfterArrow" type="int" value="1" />
<property name="allowMultiLine" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.DisallowEmptyFunction" />
<!-- <rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" /> -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses" />
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile" />
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration" />
<rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax">
<properties>
<property name="traversableTypeHints" type="array">
<element key="cake" value="Illuminate\Support\Collection"/>
<element key="cake2" value="Illuminate\Database\Eloquent\Collection"/>
</property>
</properties>
</rule>
<!-- <rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint" /> -->
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition" />
<rule ref="SlevomatCodingStandard.PHP.ShortList" />
<rule ref="SlevomatCodingStandard.PHP.TypeCast" />
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<!-- Exclude directories -->
<include-pattern type="relative">^/app/</include-pattern>
<include-pattern type="relative">^/tests/</include-pattern>
<!-- Properties -->
<properties>
<property name="rootNamespaces" type="array">
<element key="app" value="App"/>
<element key="tests" value="Tests"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing" />
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" />
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine" />
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="author"/>
<element value="created"/>
<element value="version"/>
<element value="package"/>
<element value="copyright"/>
<element value="license"/>
</property>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" type="int" value="0" />
<property name="linesCountBetweenDescriptionAndAnnotations" type="int" value="1" />
<property name="linesCountBetweenDifferentAnnotationsTypes" type="int" value="0" />
<property name="linesCountAfterLastContent" type="int" value="0" />
</properties>
</rule>
</ruleset>