-
Notifications
You must be signed in to change notification settings - Fork 151
/
phpcs.xml
244 lines (221 loc) · 10.6 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
<?xml version="1.0"?>
<!DOCTYPE ruleset [
<!ELEMENT ruleset (file|description|rule)*>
<!ATTLIST ruleset
name CDATA #REQUIRED>
<!ELEMENT file (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT rule (exclude|severity|properties|type|message)*>
<!ATTLIST rule
ref CDATA #REQUIRED>
<!ELEMENT exclude (#PCDATA)>
<!ATTLIST exclude
name CDATA #REQUIRED>
<!ELEMENT severity (#PCDATA)>
<!ELEMENT properties (property)*>
<!ELEMENT property (#PCDATA)>
<!ATTLIST property
name CDATA #REQUIRED
value CDATA #REQUIRED>
<!ELEMENT type (#PCDATA)>
<!ELEMENT message (#PCDATA)>
]>
<ruleset name="Custom Standard">
<!-- Paths to check -->
<file>./siberian</file>
<!--
The name attribute of the ruleset tag is displayed
when running PHP_CodeSniffer with the -v command line
argument. The description tag below is not displayed anywhere
except in this file, so it can contain information for
developers who may change this file in the future.
-->
<description>An awesome coding standard</description>
<!-- Include the whole PEAR standard -->
<rule ref="PEAR">
<exclude name="PEAR.NamingConventions.ValidFunctionName" />
<exclude name="PEAR.NamingConventions.ValidVariableName" />
<exclude name="PEAR.Commenting.ClassComment" />
<exclude name="PEAR.Commenting.FileComment.Missing" />
<exclude name="PEAR.Commenting.FileComment.MissingCategoryTag" />
<exclude name="PEAR.Commenting.FileComment.MissingPackageTag" />
<exclude name="PEAR.Commenting.FileComment.MissingLinkTag" />
<exclude name="PEAR.Commenting.FileComment.MissingVersion" />
<exclude name="PEAR.Classes.ClassDeclaration.OpenBraceNewLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
<exclude name="PEAR.Functions.FunctionCallSignature.CloseBracketLine" />
<exclude name="Generic.Files.LineLength" />
</rule>
<rule ref="Squiz">
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed" />
<exclude name="Squiz.PHP.CommentedOutCode"/>
<exclude name="Squiz.Commenting.FileComment.Missing"/>
<exclude name="Squiz.Commenting.ClassComment.Missing"/>
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed"/>
<exclude name="Squiz.Commenting.VariableComment.Missing"/>
<exclude name="Squiz.Commenting.ClosingDeclarationComment.Missing"/>
<exclude name="Squiz.Files.FileExtension.ClassFound"/>
<exclude name="Squiz.Classes.ClassDeclaration.OpenBraceNewLine"/>
<exclude name="Squiz.Operators.ComparisonOperatorUsage.ImplicitTrue"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
<exclude name="Squiz.Strings.ConcatenationSpacing.PaddingFound"/>
<exclude name="Squiz.Objects.ObjectInstantiation.NotAssigned"/>
<exclude name="Squiz.WhiteSpace.ObjectOperatorSpacing.Before"/>
<exclude name="Squiz.WhiteSpace.FunctionClosingBraceSpace.SpacingBeforeClose"/>
</rule>
<rule ref="Generic">
<exclude name="Generic.Commenting.DocComment.MissingShort" />
<exclude name="Generic.Commenting.DocComment.SpacingBeforeTags" />
<exclude name="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed" />
<exclude name="Generic.Files.LowercasedFilename.NotFound" />
<exclude name="Generic.Files.EndFileNoNewline.Found" />
<exclude name="Generic.PHP.ClosingPHPTag.NotFound" />
<exclude name="Generic.PHP.UpperCaseConstant.Found" />
<exclude name="Generic.Arrays.DisallowShortArraySyntax.Found" />
<exclude name="Generic.Formatting.NoSpaceAfterCast.SpaceFound" />
<exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.Found" />
<exclude name="Generic.Files.LineLength.MaxExceeded" />
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="Generic.Files.LineLength" />
</rule>
<rule ref="Zend">
<exclude name="Generic.Files.LineLength" />
</rule>
<!-- Include some sniffs from other standards that don't conflict with PEAR -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing" />
<rule ref="Squiz.Arrays.ArrayDeclaration" />
<rule ref="Squiz.Commenting.ClosingDeclarationComment" />
<rule ref="Squiz.ControlStructures.ControlSignature" />
<rule ref="Squiz.ControlStructures.ElseIfDeclaration" />
<rule ref="Squiz.Commenting.BlockComment" />
<rule ref="Squiz.Commenting.DocCommentAlignment" />
<rule ref="Squiz.Commenting.EmptyCatchComment" />
<rule ref="Squiz.Commenting.InlineComment" />
<rule ref="Squiz.Commenting.LongConditionClosingComment" />
<rule ref="Squiz.Commenting.PostStatementComment" />
<rule ref="Squiz.Commenting.VariableComment" />
<rule ref="Squiz.Formatting.OperatorBracket" />
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing" />
<rule ref="Squiz.Operators.ComparisonOperatorUsage" />
<rule ref="Squiz.PHP.DisallowInlineIf" />
<rule ref="Squiz.Strings.ConcatenationSpacing" />
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing" />
<rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace" />
<rule ref="Squiz.WhiteSpace.FunctionSpacing" />
<rule ref="Squiz.WhiteSpace.OperatorSpacing" />
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.LowerCaseKeyword"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="Zend.Files.ClosingTag"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Check var names, but we don't want leading underscores for private vars -->
<rule ref="Squiz.NamingConventions.ValidVariableName" />
<rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore">
<severity>0</severity>
</rule>
<!-- Only one argument per line in multi-line function calls -->
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="false"/>
</properties>
</rule>
<!-- Have 12 chars padding maximum and always show as errors -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="12"/>
<property name="error" value="true"/>
</properties>
</rule>
<!-- Private methods MUST not be prefixed with an underscore -->
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<type>error</type>
</rule>
<!-- Private properties MUST not be prefixed with an underscore -->
<rule ref="PSR2.Classes.PropertyDeclaration.Underscore">
<type>error</type>
</rule>
<!--
Include some specific sniffs from the Generic standard.
Note again that the name of the sniff is the code that
PHP_CodeSniffer gives it.
-->
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<!--
Here we are including a specific sniff but also changing
the error message of a specific message inside the sniff.
Note that the specific code for the message, which is
CommentFound in this case, is defined by the sniff developer.
You can display these codes by using the -s command line
argument when checking a file.
Also note that this message has a variable inside it,
which is why it is important that sniffs use a printf style
format for their error messages.
We also drop the severity of this message from the
default value (5) so that it is hidden by default. It can be
displayed by setting the minimum severity on the PHP_CodeSniffer
command line. This is great if you want to use some messages
only in code reviews and not have them block code commits.
-->
<rule ref="Generic.Commenting.Todo.CommentFound">
<message>Please review this TODO comment: %s</message>
<severity>3</severity>
</rule>
<!--
Another useful example of changing sniff settings is
to specify the end of line character that your standard
should check for.
-->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!--
Boolean values should be specified by using the strings
"true" and "false" rather than the integers 0 and 1.
-->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="ignoreMultiLine" value="true"/>
<property name="error" value="false"/>
</properties>
</rule>
<!--
If you want to completely disable an error message in a sniff
but you don't want to exclude the whole sniff, you can
change the severity of the message to 0. In this case, we
want the Squiz DoubleQuoteUsage sniff to be included in our
standard, but we don't want the ContainsVar error message to
ever be displayed.
-->
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<severity>0</severity>
</rule>
<!--
There is a special internal error message produced by PHP_CodeSniffer
when it is unable to detect code in a file, possible due to
the use of short open tags even though php.ini disables them.
You can disable this message in the same way as sniff messages.
Again, the code here will be displayed in the PHP_CodeSniffer
output when using the -s command line argument while checking a file.
-->
<rule ref="Internal.NoCodeFound">
<severity>0</severity>
</rule>
</ruleset>