-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
209 lines (174 loc) · 7.55 KB
/
Copy pathphpcs.xml
File metadata and controls
209 lines (174 loc) · 7.55 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?xml version="1.0" encoding="utf-8" ?>
<ruleset name="Alterouter"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Alterouter Coding Standard</description>
<arg value="snp"/>
<arg name="colors"/>
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="80"/>
<arg name="cache" value="cache/phpcs"/>
<file>src</file>
<file>tests</file>
<rule ref="Internal.Tokenizer.Exception">
<type>error</type>
</rule>
<rule ref="PSR12"/>
<!-- https://github.com/slashfan/symfony-realworld-example-app/blob/master/phpcs.xml.dist -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation">
<type>warning</type>
</rule>
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing">
<properties>
<property name="linesCountBetweenMembers" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="1"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.MethodSpacing">
<properties>
<property name="minLinesCount" value="1"/>
<property name="maxLinesCount" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="1"/>
<property name="maxLinesCountBeforeWithComment" value="1"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/>
<rule ref="WordPress.Arrays.CommaAfterArrayItem"/>
<rule ref="PSR2">
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
</rule>
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Each class must be in a file by itself -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses"/>
<!-- Each class must be in a namespace of at least one level (a top-level vendor name) -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
<!-- Class constants must be uppercase; expected TYPES but found types -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase"/>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps"/>
<rule ref="Squiz.Scope.MethodScope.Missing"/>
<!-- Constants must be uppercase -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase">
<type>warning</type>
</rule>
<!-- Arguments with default values must be at the end of the argument list -->
<rule ref="PEAR.Functions.ValidDefaultValue.NotAtEnd">
<type>warning</type>
</rule>
<!-- Method name "_putcatalog" must not be prefixed with an underscore to indicate visibility -->
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<type>warning</type>
</rule>
<!-- There must not be more than one property declared per statement -->
<rule ref="PSR2.Classes.PropertyDeclaration.Multiple">
<type>warning</type>
</rule>
<!-- The var keyword must not be used to declare a property -->
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed">
<type>warning</type>
</rule>
<!-- Visibility must be declared on property -->
<rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing">
<type>warning</type>
</rule>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace">
<type>warning</type>
</rule>
<!-- Closing brace must not be followed by any comment or statement on the same line -->
<rule ref="PSR12.Classes.ClosingBrace.StatementAfter">
<type>warning</type>
</rule>
<!-- Add rules «no parentheses on require/include -->
<rule ref="PEAR.Files.IncludingFile.BracketsNotRequired"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120"/>
<property name="absoluteLineLimit" value="150"/>
</properties>
</rule>
<rule ref="Generic.Files.OneObjectStructurePerFile.MultipleFound">
<type>warning</type>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions.FoundWithAlternative">
<type>warning</type>
</rule>
<rule ref="Squiz.Operators.ValidLogicalOperators.NotAllowed">
<type>warning</type>
</rule>
<rule ref="Generic.PHP.DisallowShortOpenTag.PossibleFound">
<type>error</type>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.FirstParamSpacing">
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/pull/3343 -->
<type>warning</type>
</rule>
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall">
<type>error</type>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration">
<type>error</type>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<type>warning</type>
</rule>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<type>error</type>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<type>error</type>
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase">
<type>warning</type>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<type>error</type>
</rule>
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<type>error</type>
</rule>
<rule ref="Squiz.Scope.MethodScope.Missing">
<type>warning</type>
</rule>
<rule ref="Generic.Files.LineLength">
<type>warning</type>
</rule>
<rule ref="SlevomatCodingStandard.Files.TypeNameMatchesFileName">
<properties>
<property name="rootNamespaces" type="array">
<element key="src" value="Alterouter"/>
<element key="tests" value="Alterouter\Tests"/>
</property>
</properties>
</rule>
</ruleset>