-
Notifications
You must be signed in to change notification settings - Fork 17
/
phpcodesniffer.xml
248 lines (204 loc) · 10.5 KB
/
phpcodesniffer.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
245
246
247
248
<?xml version="1.0"?>
<ruleset name="Stolz">
<description>Stolz's custom PSR-2 rules for Laravel</description>
<exclude-pattern>/bootstrap/cache/</exclude-pattern>
<exclude-pattern>/node_modules/</exclude-pattern>
<exclude-pattern>/public/</exclude-pattern>
<exclude-pattern>/resources/assets/bower/</exclude-pattern>
<exclude-pattern>/storage/</exclude-pattern>
<exclude-pattern>/vendor/</exclude-pattern>
<!--RULES ARE IN ALPHABETICAL ORDER-->
<rule ref="Generic.Formatting.DisallowMultipleStatements.SameLine"/>
<!--Use space after cast-->
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<!--Function name in camelCase-->
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
<!--Allow helpers with snake_case-->
<exclude-pattern>/resources/helpers.php</exclude-pattern>
</rule>
<!--PHP5 constructor syntax "function __construct()"-->
<rule ref="Generic.NamingConventions.ConstructorName"/>
<!--Check for deprecated functions-->
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<!--Force tabs identation-->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<!--Suppress warning for some files without PHP code-->
<rule ref="Internal.NoCodeFound">
<exclude-pattern>/resources/views/</exclude-pattern>
</rule>
<!--Single responsability files-->
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>/bootstrap/autoload.php</exclude-pattern>
</rule>
<rule ref="PSR2">
<!--Allow one line control structures to have no curly braces-->
<exclude name="Generic.ControlStructures.InlineControlStructure.NotAllowed"/>
<!--Allow long lines-->
<exclude name="Generic.Files.LineLength.TooLong"/>
<!--Allow tab identation-->
<exclude name="Generic.WhiteSpace.DisallowTabIndent.TabsUsed"/>
<!--Allow declaring classes without namespace-->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
<!--Allow spaces after open brace for spacing the "!" logical operator if ( ! $foo)-->
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace"/>
<!--Do not enforce control structures curly braces on the same line-->
<exclude name="Squiz.ControlStructures.ControlSignature"/>
</rule>
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
<exclude-pattern>/app/Http/Controllers/ResourceController.php</exclude-pattern>
</rule>
<!--Do not use spaces gaps for array brakets-->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<!--Use "self" instead of class name when possible-->
<rule ref="Squiz.Classes.SelfMemberReference"/>
<!--No duplicated class properties-->
<rule ref="Squiz.Classes.DuplicateProperty"/>
<!--Disallow size functions in loops"/>-->
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
<!--PHP functions in lowecase-->
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<!--Force only one space at both sides of logical operators-->
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<!--Force space at both sides of operatos-->
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<!--No whitespace before a semicolon-->
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<!--Blade files need close tags-->
<rule ref="Zend.Files.ClosingTag.NotAllowed">
<exclude-pattern>/resources/views/*.blade.php</exclude-pattern>
</rule>
<!--UNUSED RULES-->
<!--========== Generic ========================================-->
<!--<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>-->
<!--<rule ref="Generic.Commenting.Todo"/>-->
<!--<rule ref="Generic.Debug.ClosureLinter"/>-->
<!--<rule ref="Generic.Debug.ClosureLinter.ExternalToolError"/>-->
<!--<rule ref="Generic.Formatting.MultipleStatementAlignment"/>-->
<!--<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>-->
<!--<rule ref="Generic.Metrics.CyclomaticComplexity"/>-->
<!--<rule ref="Generic.Metrics.NestingLevel"/>-->
<!--<rule ref="Generic.Strings.UnnecessaryStringConcat"/>-->
<!--========== MySource ========================================-->
<!--<rule ref="MySource.Channels.ChannelException"/>-->
<!--<rule ref="MySource.Channels.DisallowSelfActions"/>-->
<!--<rule ref="MySource.Channels.IncludeSystem"/>-->
<!--<rule ref="MySource.Channels.UnusedSystem"/>-->
<!--<rule ref="MySource.Commenting.FunctionComment"/>-->
<!--<rule ref="MySource.CSS.BrowserSpecificStyles"/>-->
<!--<rule ref="MySource.Debug.DebugCode"/>-->
<!--<rule ref="MySource.Debug.FirebugConsole"/>-->
<!--<rule ref="MySource.Objects.AssignThis"/>-->
<!--<rule ref="MySource.Objects.CreateWidgetTypeCallback"/>-->
<!--<rule ref="MySource.Objects.DisallowNewWidget"/>-->
<!--<rule ref="MySource.PHP.AjaxNullComparison"/>-->
<!--<rule ref="MySource.PHP.EvalObjectFactory"/>-->
<!--<rule ref="MySource.PHP.GetRequestData"/>-->
<!--<rule ref="MySource.PHP.ReturnFunctionValue"/>-->
<!--<rule ref="MySource.Strings.JoinStrings"/>-->
<!--========== PEAR ========================================-->
<!--<rule ref="PEAR.Classes.ClassDeclaration"/>-->
<!--<rule ref="PEAR.Commenting.ClassComment"/>-->
<!--<rule ref="PEAR.Commenting.FileComment"/>-->
<!--Ensure functions have comment with proper format-->
<!--<rule ref="PEAR.Commenting.FunctionComment"/>-->
<!--<rule ref="PEAR.Commenting.InlineComment"/>-->
<!--<rule ref="PEAR.ControlStructures.ControlSignature"/>-->
<!--<rule ref="PEAR.ControlStructures.MultiLineCondition"/>-->
<!--<rule ref="PEAR.Files.IncludingFile"/>-->
<!--<rule ref="PEAR.Formatting.MultiLineAssignment"/>-->
<!--<rule ref="PEAR.Functions.FunctionCallSignature"/>-->
<!--<rule ref="PEAR.Functions.FunctionDeclaration"/>-->
<!--<rule ref="PEAR.NamingConventions.ValidClassName"/>-->
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName"/>-->
<!--<rule ref="PEAR.NamingConventions.ValidVariableName"/>-->
<!--<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>-->
<!--<rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>-->
<!--<rule ref="PEAR.WhiteSpace.ScopeIndent"/>-->
<!--========== Squiz ========================================-->
<!--<rule ref="Squiz.Arrays.ArrayDeclaration"/>-->
<!--<rule ref="Squiz.Classes.ClassDeclaration"/>-->
<!--<rule ref="Squiz.Classes.ClassFileName"/>-->
<!--<rule ref="Squiz.Classes.LowercaseClassKeywords"/>-->
<!--<rule ref="Squiz.CodeAnalysis.EmptyStatement"/>-->
<!--<rule ref="Squiz.Commenting.BlockComment"/>-->
<!--<rule ref="Squiz.Commenting.ClassComment"/>-->
<!--<rule ref="Squiz.Commenting.ClosingDeclarationComment"/>-->
<!--<rule ref="Squiz.Commenting.DocCommentAlignment"/>-->
<!--<rule ref="Squiz.Commenting.EmptyCatchComment"/>-->
<!--<rule ref="Squiz.Commenting.FileComment"/>-->
<!--<rule ref="Squiz.Commenting.FunctionComment"/>-->
<!--<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>-->
<!--<rule ref="Squiz.Commenting.InlineComment"/>-->
<!--<rule ref="Squiz.Commenting.LongConditionClosingComment"/>-->
<!--<rule ref="Squiz.Commenting.PostStatementComment"/>-->
<!--<rule ref="Squiz.Commenting.VariableComment"/>-->
<!--<rule ref="Squiz.ControlStructures.ElseIfDeclaration"/>-->
<!--<rule ref="Squiz.ControlStructures.InlineIfDeclaration"/>-->
<!--<rule ref="Squiz.ControlStructures.SwitchDeclaration"/>-->
<!--<rule ref="Squiz.CSS.ClassDefinitionClosingBraceSpace"/>-->
<!--<rule ref="Squiz.CSS.ClassDefinitionNameSpacing"/>-->
<!--<rule ref="Squiz.CSS.ClassDefinitionOpeningBraceSpace"/>-->
<!--<rule ref="Squiz.CSS.ColonSpacing"/>-->
<!--<rule ref="Squiz.CSS.ColourDefinition"/>-->
<!--<rule ref="Squiz.CSS.DisallowMultipleStyleDefinitions"/>-->
<!--<rule ref="Squiz.CSS.DuplicateClassDefinition"/>-->
<!--<rule ref="Squiz.CSS.DuplicateStyleDefinition"/>-->
<!--<rule ref="Squiz.CSS.EmptyClassDefinition"/>-->
<!--<rule ref="Squiz.CSS.EmptyStyleDefinition"/>-->
<!--<rule ref="Squiz.CSS.Indentation"/>-->
<!--<rule ref="Squiz.CSS.LowercaseStyleDefinition"/>-->
<!--<rule ref="Squiz.CSS.MissingColon"/>-->
<!--<rule ref="Squiz.CSS.Opacity"/>-->
<!--<rule ref="Squiz.CSS.SemicolonSpacing"/>-->
<!--<rule ref="Squiz.Debug.JavaScriptLint"/>-->
<!--<rule ref="Squiz.Debug.JSLint"/>-->
<!--<rule ref="Squiz.Files.FileExtension"/>-->
<!--<rule ref="Squiz.Formatting.OperatorBracket"/>-->
<!--Checks that duplicate arguments are not used in function declarations-->
<!-- <rule ref="Squiz.Functions.FunctionDuplicateArgument"/> -->
<!--<rule ref="Squiz.Functions.GlobalFunction"/>-->
<!--<rule ref="Squiz.NamingConventions.ConstantCase"/>-->
<!--<rule ref="Squiz.NamingConventions.ValidFunctionName"/>-->
<!--<rule ref="Squiz.NamingConventions.ValidVariableName"/>-->
<!--<rule ref="Squiz.Objects.DisallowObjectStringIndex"/>-->
<!--<rule ref="Squiz.Objects.ObjectInstantiation"/>-->
<!--<rule ref="Squiz.Objects.ObjectMemberComma"/>-->
<!--<rule ref="Squiz.Operators.ComparisonOperatorUsage"/>-->
<!--<rule ref="Squiz.Operators.IncrementDecrementUsage"/>-->
<!--<rule ref="Squiz.Operators.ValidLogicalOperators"/>-->
<!--<rule ref="Squiz.PHP.CommentedOutCode"/>-->
<!--<rule ref="Squiz.PHP.DisallowComparisonAssignment"/>-->
<!--<rule ref="Squiz.PHP.DisallowInlineIf"/>-->
<!--<rule ref="Squiz.PHP.DisallowMultipleAssignments"/>-->
<!--<rule ref="Squiz.PHP.DisallowObEndFlush"/>-->
<!--<rule ref="Squiz.PHP.DiscouragedFunctions"/>-->
<!--<rule ref="Squiz.PHP.EmbeddedPhp"/>-->
<!--<rule ref="Squiz.PHP.Eval"/>-->
<!--<rule ref="Squiz.PHP.ForbiddenFunctions"/>-->
<!--<rule ref="Squiz.PHP.GlobalKeyword"/>-->
<!--<rule ref="Squiz.PHP.Heredoc"/>-->
<!--<rule ref="Squiz.PHP.InnerFunctions"/>-->
<!--<rule ref="Squiz.PHP.NonExecutableCode"/>-->
<!--<rule ref="Squiz.Scope.MemberVarScope"/>-->
<!--<rule ref="Squiz.Scope.StaticThisUsage"/>-->
<!--<rule ref="Squiz.Strings.ConcatenationSpacing"/>-->
<!--<rule ref="Squiz.Strings.DoubleQuoteUsage"/>-->
<!--<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>-->
<!--<rule ref="Squiz.Strings.EchoedStrings"/>-->
<!--<rule ref="Squiz.WhiteSpace.CastSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/>-->
<!--<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>-->
<!--<rule ref="Squiz.WhiteSpace.FunctionSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.MemberVarSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"/>-->
<!--<rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>-->
<!--========== Zend ========================================-->
<!--<rule ref="Zend.Debug.CodeAnalyzer"/>-->
<!--Variable names in camelCase-->
<!-- <rule ref="Zend.NamingConventions.ValidVariableName"> -->
<!--Protected variable don't need an underscore prefix-->
<!-- <exclude name="Zend.NamingConventions.ValidVariableName.PrivateNoUnderscore"/> -->
<!-- </rule> -->
</ruleset>