-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
phpcs.xml
195 lines (180 loc) · 7.73 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Squiz" xsi:noNamespaceSchemaLocation="../../../phpcs.xsd">
<description>The JsPhp Coding standard</description>
<arg name="tab-width" value="4"/>
<arg name="encoding" value="utf-8"/>
<exclude-pattern>./bin/*</exclude-pattern>
<exclude-pattern>./vendor</exclude-pattern>
<exclude-pattern>./tests/*</exclude-pattern>
<exclude-pattern>./src/Assets/*</exclude-pattern>
<rule ref="Generic.ControlStructures.InlineControlStructure" />
<rule ref="Generic.Files.EndFileNewline" />
<!-- Use Unix newlines -->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n" />
</properties>
</rule>
<!-- Lines can be 150 chars long, but never show errors -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="150" />
<property name="absoluteLineLimit" value="0" />
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements" />
<rule ref="Generic.Formatting.SpaceAfterCast" />
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
<!-- This message is not required as spaces are allowed for alignment -->
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
<severity>0</severity>
</rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
<rule ref="Generic.PHP.DisallowShortOpenTag" />
<rule ref="Generic.PHP.DeprecatedFunctions" />
<rule ref="Generic.PHP.ForbiddenFunctions" />
<rule ref="Generic.PHP.LowerCaseConstant" />
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<!-- Include some additional sniffs from the PEAR standard -->
<rule ref="PEAR.Classes.ClassDeclaration" />
<rule ref="PEAR.Commenting.InlineComment" />
<rule ref="PEAR.ControlStructures.MultiLineCondition">
<properties>
<property name="indent" value="4"/>
</properties>
<exclude name="PEAR.ControlStructures.MultiLineCondition.NewlineBeforeOpenBrace"/>
<exclude name="PEAR.ControlStructures.MultiLineCondition.SpaceBeforeOpenBrace"/>
<exclude name="PEAR.ControlStructures.MultiLineCondition.CloseBracketNewLine"/>
</rule>
<rule ref="PEAR.ControlStructures.MultiLineCondition.Alignment">
<properties>
<property name="indent" value="4"/>
</properties>
<message>Multi-line IF statement not indented correctly; expected %s spaces but found %s. Note: the autofixer will convert spaces to tabs</message>
</rule>
<rule ref="PEAR.Formatting.MultiLineAssignment" />
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="indent" value="4"/>
</properties>
<exclude name="PEAR.Functions.FunctionDeclaration.BraceOnNewLine" />
<exclude name="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket" />
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
<properties>
<property name="indent" value="4"/>
</properties>
<message>Multi-line function call not indented correctly; expected %s spaces but found %s. Note: the autofixer will convert spaces to tabs</message>
</rule>
<rule ref="PEAR.Functions.FunctionDeclaration">
<properties>
<property name="indent" value="4"/>
</properties>
<exclude name="PEAR.Functions.FunctionDeclaration.NewlineBeforeOpenBrace" />
</rule>
<rule ref="PEAR.Functions.FunctionDeclaration.Indent">
<properties>
<property name="indent" value="4"/>
</properties>
<message>Multi-line function declaration not indented correctly; expected %s spaces but found %s. Note: the autofixer will convert spaces to tabs</message>
</rule>
<rule ref="PEAR.Functions.ValidDefaultValue" />
<rule ref="PEAR.NamingConventions.ValidClassName" />
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent">
<properties>
<property name="indent" value="4"/>
</properties>
</rule>
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent.Incorrect">
<properties>
<property name="indent" value="4"/>
</properties>
<message>Object operator not indented correctly; expected %s spaces but found %s. Note: the autofixer will convert spaces to tabs</message>
</rule>
<!-- Include some additional sniffs from the PSR2 standard -->
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed">
<type>error</type>
</rule>
<!-- Include some additional sniffs from the Squiz standard -->
<rule ref="Squiz.CSS.ColonSpacing" />
<rule ref="Squiz.CSS.DuplicateClassDefinition" />
<rule ref="Squiz.CSS.EmptyClassDefinition" />
<rule ref="Squiz.CSS.EmptyStyleDefinition" />
<rule ref="Squiz.CSS.MissingColon" />
<rule ref="Squiz.CSS.SemicolonSpacing" />
<rule ref="Squiz.Classes.SelfMemberReference" />
<rule ref="Squiz.Commenting.BlockComment">
<exclude name="Squiz.Commenting.BlockComment.FirstLineIndent"/>
<exclude name="Squiz.Commenting.BlockComment.LineIndent"/>
<exclude name="Squiz.Commenting.BlockComment.LastLineIndent"/>
<exclude name="Squiz.Commenting.BlockComment.HasEmptyLineBefore"/>
<exclude name="Squiz.Commenting.BlockComment.NoEmptyLineBefore"/>
<exclude name="Squiz.Commenting.BlockComment.NoEmptyLineAfter"/>
<exclude name="Squiz.Commenting.BlockComment.WrongStart"/>
</rule>
<rule ref="Squiz.Commenting.ClassComment">
<exclude name="Squiz.Commenting.ClassComment.TagNotAllowed" />
</rule>
<rule ref="Squiz.Commenting.DocCommentAlignment" />
<rule ref="Squiz.Commenting.VariableComment">
<exclude name="Squiz.Commenting.VariableComment.TagNotAllowed" />
</rule>
<rule ref="Squiz.Operators.IncrementDecrementUsage">
<exclude name="Squiz.Operators.IncrementDecrementUsage.processAssignment" />
</rule>
<rule ref="Squiz.PHP.GlobalKeyword">
<message>Do not use global variables. Use static class properties or constants instead of globals.</message>
</rule>
<rule ref="Squiz.Scope.StaticThisUsage" />
<rule ref="Squiz.Scope.MemberVarScope" />
<rule ref="Squiz.Scope.MethodScope">
<message>No scope modifier specified for function "%s</message>
</rule>
<rule ref="Squiz.Scope.StaticThisUsage" />
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1" />
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace" />
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent">
<message>Closing brace indented incorrectly; expected %s spaces, found %s. Note: the autofixer will convert spaces to tabs</message>
</rule>
<rule ref="Squiz.WhiteSpace.CastSpacing" />
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing">
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.LineAfterClose" />
</rule>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
<properties>
<property name="spacingBeforeFirst" value="0" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
<rule ref="Squiz.WhiteSpace.SemicolonSpacing" />
<!-- Include some additional sniffs from the Zend standard -->
<rule ref="Zend.Files.ClosingTag" />
<rule ref="Squiz.Commenting.FunctionComment.Missing"/>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamTag"/>
<rule ref="Squiz.Commenting.FunctionComment.MissingParamName"/>
<rule ref="Squiz.Commenting.FunctionComment.ParamNameNoMatch"/>
<rule ref="Squiz.Commenting.FunctionComment.IncorrectTypeHint"/>
<rule ref="Squiz.Commenting.FunctionComment.MissingReturn"/>
</ruleset>