-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruleset.xml
560 lines (534 loc) · 26.5 KB
/
ruleset.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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
<?xml version="1.0"?>
<ruleset name="Brianvarskonst">
<description>Brianvarskonst Coding Standard</description>
<!-- Include the whole Symfony standard (which pulls in PSR2) -->
<rule ref="Symfony">
<!-- exclude sniffs that are extended by this standard -->
<exclude name="PEAR.Functions.FunctionCallSignature"/>
<exclude name="PSR2.Namespaces.UseDeclaration"/>
<!-- SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition supports autofixing -->
<exclude name="PSR2.Classes.PropertyDeclaration.Multiple"/>
<!-- exclude sniffs that are disabled on purpose by this standard -->
<exclude name="Symfony.Commenting.ClassComment.Missing"/>
<exclude name="Symfony.Commenting.License"/>
<!-- disable single line function signatures -->
<exclude name="Symfony.Functions.Arguments"/>
<exclude name="Symfony.Commenting.Annotations"/>
<!-- disable function comments -->
<exclude name="Symfony.Commenting.FunctionComment" />
<exclude name="Symfony.ControlStructure.YodaConditions.Invalid" />
</rule>
<!-- Also include PSR12 -->
<rule ref="PSR12">
<!-- exclude sniffs that are disabled on purpose by this standard -->
<exclude name="Generic.Files.LineLength.TooLong"/>
<!-- not compatible with other rules we have later on -->
<exclude name="PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword"/>
<exclude name="PSR12.ControlStructures.ControlStructureSpacing"/>
<exclude name="PSR12.Files.DeclareStatement"/>
<!-- Exclude conflicting rules -->
<exclude name="PSR12.Files.OpenTag.NotAlone" />
<exclude name="PSR12.Files.FileHeader.SpacingAfterBlock" />
<exclude name="PSR12.Files.FileHeader.IncorrectGrouping" />
</rule>
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
<exclude name="Squiz.WhiteSpace.MemberVarSpacing" />
</rule>
<rule ref="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty">
<exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty" />
</rule>
<!-- Forbid strings in `"` unless necessary -->
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/>
<!-- There must be at least one space around operators -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Split long if statements onto several lines by PEAR rules -->
<rule ref="PEAR.ControlStructures.MultiLineCondition" />
<!-- Force array element indentation with 4 spaces -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<!-- Forbid `array(...)` -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Force whitespace after a type cast -->
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<!-- Align corresponding assignment statement tokens -->
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="error" value="true"/>
</properties>
</rule>
<!-- Forbid useless inline string concatenation -->
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<!-- But multiline is useful for readability -->
<properties>
<property name="allowMultiline" value="true"/>
</properties>
</rule>
<!-- Require one blank line between methods -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="spacingAfterLast" value="0"/>
<property name="spacingBeforeFirst" value="0"/>
</properties>
</rule>
<!-- Require one blank line between properties -->
<rule ref="Squiz.WhiteSpace.MemberVarSpacing">
<properties>
<property name="spacingBeforeFirst" value="0"/>
</properties>
</rule>
<!-- Forbid spaces between parentheses and their content-->
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing">
<properties>
<property name="ignoreNewlines" value="1"/>
</properties>
</rule>
<!-- Forbid multiple assignments -->
<rule ref="Squiz.PHP.DisallowMultipleAssignments"/>
<!-- Require exactly one blank line after trait use -->
<rule ref="PSR12.Traits.UseDeclaration"/>
<rule ref="PSR12.Operators.OperatorSpacing.NoSpaceBefore">
<type>warning</type>
</rule>
<!-- Forbid whitespace between array access operator and the variable or between array access operators. -->
<rule ref="SlevomatCodingStandard.Arrays.ArrayAccess"/>
<!-- Sort attributes alphabetically -->
<rule ref="SlevomatCodingStandard.Attributes.AttributesOrder">
<properties>
<property name="orderAlphabetically" value="true"/>
</properties>
</rule>
<!-- Disallow multiple attributes inside one #[] -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
<!-- Require only one attribute per line -->
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<!-- Force Enum Spacing-->
<rule ref="SlevomatCodingStandard.Classes.BackedEnumTypeSpacing"/>
<!-- Require presence of constant visibility -->
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<!-- Forbid multi constant definition -->
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition"/>
<!-- Forbid multi property definition -->
<rule ref="SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition"/>
<!-- Forbid empty lines after class/interface/trait opening and before closing braces -->
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties>
<property name="linesCountAfterOpeningBrace" value="0"/>
<property name="linesCountBeforeClosingBrace" value="0"/>
</properties>
</rule>
<!-- Forbid empty lines around Enum cases -->
<rule ref="SlevomatCodingStandard.Classes.EnumCaseSpacing">
<properties>
<property name="minLinesCountBeforeWithComment" value="0"/>
<property name="maxLinesCountBeforeWithComment" value="0"/>
<property name="minLinesCountBeforeWithoutComment" value="0"/>
<property name="maxLinesCountBeforeWithoutComment" value="0"/>
</properties>
</rule>
<!-- Forbid properties to be public -->
<rule ref="SlevomatCodingStandard.Classes.ForbiddenPublicProperty">
<properties>
<property name="checkPromoted" value="true"/>
</properties>
</rule>
<!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<!-- report invalid format of inline phpDocs with @var -->
<rule ref="SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration"/>
<!-- Forbid useless @inheritDoc comments -->
<rule ref="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
<!-- Forbid assignments in conditions -->
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
<!-- Require consistent spacing for control structures -->
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing">
<properties>
<property name="controlStructures" type="array">
<element value="if"/>
<element value="do"/>
<element value="while"/>
<element value="for"/>
<element value="foreach"/>
<element value="switch"/>
<element value="try"/>
</property>
</properties>
</rule>
<!-- Require usage of early exit -->
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<!-- Require consistent spacing for jump statements -->
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"/>
<!-- Require new instances with parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>
<!-- Require usage of null coalesce operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
<!-- Require usage of ternary operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator">
<!-- But multiline is useful for readability -->
<properties>
<property name="ignoreMultiLine" value="true"/>
</properties>
</rule>
<!-- Enforce consistent spacing of named arguments -->
<rule ref="SlevomatCodingStandard.Functions.NamedArgumentSpacing"/>
<!-- Require static closures for microoptimization -->
<rule ref="SlevomatCodingStandard.Functions.StaticClosure"/>
<!-- Forbid unused function parameters -->
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
<!-- Forbids useless parameter default values -->
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<!-- Require global functions to be referenced via a fully qualified name -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<!-- Forbid multiple use statements on same line -->
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<!-- Require one newline around namespace declaration -->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing">
<properties>
<property name="linesCountBeforeNamespace" value="1"/>
<property name="linesCountAfterNamespace" value="1"/>
</properties>
</rule>
<!-- Forbid unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="ignoredAnnotationNames" type="array">
<element value="@group"/>
</property>
</properties>
</rule>
<!-- Forbid useless alias for classes, constants and functions -->
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<!-- Require empty newlines before and after uses -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="0"/>
<property name="linesCountAfterLastUse" value="1"/>
</properties>
</rule>
<!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
<!-- Report ++ and minus-minus operators not used standalone -->
<rule ref="SlevomatCodingStandard.Operators.RequireOnlyStandaloneIncrementAndDecrementOperators"/>
<!-- Enforce no spacing after spread operator -->
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
<!-- Report (...) used with opcode optimized builtin functions -->
<rule ref="SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking"/>
<!-- Forbid `list(...)` syntax -->
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
<!-- Forbid useless semicolon `;` -->
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<!-- Enforce generics syntax in array typehints -->
<rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/>
<!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<!-- Require ? when default value is null -->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<!-- Enforces null type hint on last position in @var, @param and @return annotations. -->
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
<!-- Require one space between typehint and variable, require no space between nullability sign and typehint -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<!-- Require one space after and no space before colon in return types -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<!-- Require parameter type hints to be declared -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<properties>
<property name="enableMixedTypeHint" value="false"/>
<property name="enableUnionTypeHint" value="false"/>
<property name="enableIntersectionTypeHint" value="false"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<!-- Require return type hints to be declared -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<properties>
<property name="enableMixedTypeHint" value="false"/>
<property name="enableUnionTypeHint" value="false"/>
<property name="enableIntersectionTypeHint" value="false"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<!-- Forbid useless @var for constants -->
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
<!-- Forbid duplicate assignments to a variable -->
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<!-- Forbid unused variables -->
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true"/>
</properties>
</rule>
<!-- These should get handled by the upstream Symfony standard later -->
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFullyQualifiedGlobalClasses" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedExceptions" value="true"/>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120" />
<property name="absoluteLineLimit" value="120" />
</properties>
</rule>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1" />
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="chop" value="rtrim"/>
<element key="close" value="closedir"/>
<element key="compact" value="null"/>
<element key="delete" value="unset"/>
<element key="doubleval" value="floatval"/>
<element key="extract" value="null"/>
<element key="fputs" value="fwrite"/>
<element key="ini_alter" value="ini_set"/>
<element key="is_double" value="is_float"/>
<element key="is_integer" value="is_int"/>
<element key="is_long" value="is_int"/>
<!-- forbid is_null(), maybe replace with mediawiki/mediawiki-codesniffer IsNullSniff -->
<!-- <element key="is_null" value="null"/>-->
<element key="is_real" value="is_float"/>
<element key="is_writeable" value="is_writable"/>
<element key="join" value="implode"/>
<element key="key_exists" value="array_key_exists"/>
<element key="pos" value="current"/>
<element key="settype" value="null"/>
<element key="show_source" value="highlight_file"/>
<element key="sizeof" value="count"/>
<element key="strchr" value="strstr"/>
</property>
</properties>
</rule>
<!-- Forbid backtick operator -->
<rule ref="Generic.PHP.BacktickOperator" />
<!-- require strict types -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="declareOnFirstLine" value="false" />
<property name="spacesCountAroundEqualsSign" value="0" />
<property name="linesCountBeforeDeclare" value="1" />
<property name="linesCountAfterDeclare" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
<!-- configure doc comment order -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBeforeFirstContent" value="0"/>
<property name="linesCountAfterLastContent" value="0"/>
<property name="linesCountBetweenDescriptionAndAnnotations" value="1"/>
<property name="linesCountBetweenAnnotationsGroups" value="1"/>
<property name="annotationsGroups" type="array">
<element value="
@internal,
@deprecated,
"/>
<element value="@template"/>
<element value="
@dataProvider,
@link,
@see,
@uses,
"/>
<element value="
@Assert\,
@Constraints\,
"/>
<element value="@ORM\"/>
<element value="
@ApiFilter,
@ApiResource,
@Groups,
"/>
<element value="@var"/>
<element value="@param"/>
<element value="@return"/>
<element value="@throws"/>
</property>
</properties>
</rule>
<!-- forbid empty comments-->
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment" />
<!-- Forbid useless comments -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenComments">
<properties>
<property name="forbiddenCommentPatterns" type="array">
<element value="~^(?:(?!private|protected|static)\S+ )?(?:con|de)structor\.\z~i"/>
<element value="~^Created by .+\.\z~i"/>
<element value="~^(User|Date|Time): \S+\z~i"/>
<element value="~^\S+ [gs]etter\.\z~i"/>
<element value="~^Class \S+\z~i"/>
</property>
</properties>
</rule>
<!-- Require language constructs without parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<!-- Require comments with single line written as one-liners -->
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"/>
<!-- forbid useless comments-->
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment" />
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation">
<severity>9</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation">
<severity>9</severity>
</rule>
<!-- require typed properties -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint" />
<!-- covered by PHPStan -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification">
<severity>0</severity>
</rule>
<rule ref="SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable" />
<!-- require Throwable instead of Exception -->
<rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly" />
<!-- forbid static:: in final class -->
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding" />
<!-- Rules for recent language features -->
<rule ref="SlevomatCodingStandard.TypeHints.UnionTypeHintFormat" />
<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch" />
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator" />
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<type>warning</type>
<properties>
<property name="allowMultiLine" value="yes"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
<!-- Forbid usage of conditions when a simple return can be used -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn"/>
<!-- Forbid usage of boolean-only ternary operator usage (e.g. $foo ? true : false) -->
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator"/>
<!-- Forbid useless unreachable catch blocks -->
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<!-- Forbid unused variables passed to closures via `use` -->
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<!-- Forbid fancy group uses -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<!-- Forbid superfluous leading backslash in use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"/>
<!-- Forbid useless uses of the same namespace -->
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<!-- Forbid weak comparisons -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<!-- Forbid useless parentheses -->
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses"/>
<!-- Require One Line Doc Comment where there's only 1 annotation present -->
<rule ref="SlevomatCodingStandard.Commenting.RequireOneLineDocComment"/>
<!-- Forbid useless variables -->
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<!-- Forbid spaces around square brackets -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
<!-- Forbid class being in a file with different name -->
<rule ref="Squiz.Classes.ClassFileName"/>
<!-- Force `self::` for self-reference, force lower-case self, forbid spaces around `::` -->
<rule ref="Squiz.Classes.SelfMemberReference"/>
<!-- Force phpDoc alignment -->
<rule ref="Squiz.Commenting.DocCommentAlignment">
<!-- Allow extra spaces after star, i.e. for indented annotations -->
<exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
</rule>
<rule ref="Squiz.Classes.LowercaseClassKeywords"/>
<rule ref="Squiz.PHP.CommentedOutCode">
<properties>
<property name="maxPercentage" value="45"/>
</properties>
</rule>
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration">
<type>warning</type>
</rule>
<!-- Forbid global functions -->
<rule ref="Squiz.Functions.GlobalFunction"/>
<!-- Forbid `global` -->
<rule ref="Squiz.PHP.GlobalKeyword"/>
<!-- Forbid functions inside functions -->
<rule ref="Squiz.PHP.InnerFunctions"/>
<!-- Require PHP function calls in lowercase -->
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<!-- Forbid dead code -->
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.PHP.Eval"/>
<rule ref="Squiz.Scope.MemberVarScope"/>
<!-- Forbid `$this` inside static function -->
<rule ref="Squiz.Scope.StaticThisUsage"/>
<!-- Require there be no space between increment/decrement operator and its operand -->
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
<rule ref="Generic.CodeAnalysis.AssignmentInCondition"/>
<rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="absoluteComplexity" value="50"/>
</properties>
</rule>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.VersionControl.GitMergeConflict"/>
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing">
<type>warning</type>
<properties>
<property name="ignoreNewlines" value="yes" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Generic.WhiteSpace.SpreadOperatorSpacingAfter"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<!-- Forbid spaces around `->` operator -->
<!-- Forbid spaces around `->` operator -->
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Forbid spaces before semicolon `;` -->
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<!-- Forbid superfluous whitespaces -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<!-- turned on by PSR2 -> turning back off -->
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
<!-- turned off by PSR2 -> turning back on -->
<severity>5</severity>
</rule>
<rule ref="Zend.NamingConventions.ValidVariableName">
<exclude name="Zend.NamingConventions.ValidVariableName.ContainsNumbers"/>
<exclude name="Zend.NamingConventions.ValidVariableName.StringVarContainsNumbers"/>
<exclude name="Zend.NamingConventions.ValidVariableName.MemberVarContainsNumbers"/>
</rule>
<rule ref="Brianvarskonst.Complexity.NestingLevel">
<properties>
<property name="warningLimit" value="4" />
<property name="errorLimit" value="8" />
</properties>
</rule>
</ruleset>