-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml.dist
597 lines (479 loc) · 24.9 KB
/
phpcs.xml.dist
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
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="App" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>The encoding standard used in this APP.</description>
<ini name="memory_limit" value="128M" />
<!-- Arguments -->
<arg name="basepath" value="."/>
<arg name="tab-width" value="4"/>
<arg name="extensions" value="php"/>
<arg name="encoding" value="utf-8"/>
<arg name="parallel" value="4"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<!-- <arg name="report" value="summary|code|full"/> -->
<!-- <arg name="report-width" value="auto"/> -->
<arg name="ignore" value="server.php,resources/views,*.blade.php*"/>
<!-- -n - Do not print warnings (shortcut for -\-warning-severity=0) -->
<!-- -p - Show progress of the run @see https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage#printing-progress-information -->
<!-- -s - Show sniff codes in all reports -->
<arg value="nps"/>
<!-- Folders that will be tracked -->
<file>app</file>
<file>config</file>
<file>database</file>
<file>lang</file>
<file>routes</file>
<file>tests</file>
<!-- Excludes -->
<exclude-pattern>*/database/migrations/*</exclude-pattern>
<exclude-pattern>*.(css|js|json|html|yml|yaml)</exclude-pattern>
<!-- ###### -->
<!-- SNIFFS -->
<!-- ###### -->
<rule ref="PSR12"/>
<!-- ######################## -->
<!-- Slevomat Coding Standard -->
<!-- ######################## -->
<!-- Enforces reasonable end bracket placement for multi-line arrays -->
<rule ref="SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement"/>
<!-- Checks whitespaces around commas or between brackets(e.g. []) on single line arrays-->
<rule ref="SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace"/>
<!-- Require a comma after the last element in multi-line array -->
<rule ref="SlevomatCodingStandard.Arrays.TrailingArrayComma"/>
<!-- Require public/private/protected visibility on constants -->
<rule ref="SlevomatCodingStandard.Classes.ClassConstantVisibility"/>
<!-- Reports useless late static binding -->
<rule ref="SlevomatCodingStandard.Classes.UselessLateStaticBinding"/>
<!-- Checks lines count between class members -->
<rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing"/>
<!-- Checks if the class members are structured in the correct order-->
<rule ref="SlevomatCodingStandard.Classes.ClassStructure"/>
<!-- Checks if constants have blank lines between then -->
<rule ref="SlevomatCodingStandard.Classes.ConstantSpacing"/>
<!-- Forbid empty lines around type declarations -->
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties>
<property name="linesCountAfterOpeningBrace" value="0"/>
<property name="linesCountBeforeClosingBrace" value="0"/>
</properties>
</rule>
<!-- Require no spacing after spread operator -->
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing">
<properties>
<property name="spacesCountAfterOperator" value="0"/>
</properties>
</rule>
<!-- Require usage of ::class whenever possible -->
<!-- Require usage of ::class instead of __CLASS__, get_class(), get_class($this), get_called_class() and get_parent_class() -->
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<!-- Require no spaces before trait use, between trait uses and one space after trait uses -->
<rule ref="SlevomatCodingStandard.Classes.TraitUseSpacing">
<properties>
<property name="linesCountBetweenUses" value="0"/>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="0"/>
<property name="linesCountAfterLastUseWhenLastInClass" value="0"/>
</properties>
</rule>
<!-- Force phpDocs separation between diferrent annotations and remove extra `*` -->
<!-- Require specific order of phpDoc annotations with empty newline between specific groups -->
<rule ref="SlevomatCodingStandard.Commenting.DocCommentSpacing">
<properties>
<property name="linesCountBetweenDifferentAnnotationsTypes" value="1"/>
</properties>
</rule>
<!-- Forbid useless annotations - Git and LICENCE file provide more accurate information -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@api"/>
<element value="@author"/>
<element value="@category"/>
<element value="@copyright"/>
<element value="@created"/>
<element value="@license"/>
<element value="@package"/>
<element value="@since"/>
<element value="@subpackage"/>
<element value="@version"/>
</property>
</properties>
</rule>
<!-- 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>
<!-- Forbid empty comments -->
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<!-- Forbid comments with single line written as one-liners -->
<rule ref="SlevomatCodingStandard.Commenting.DisallowOneLinePropertyDocComment"/>
<!-- Checks if `parent` object calls have blank lines around then -->
<rule ref="SlevomatCodingStandard.Classes.ParentCallSpacing"/>
<!-- Checks if properties have blank lines between then -->
<rule ref="SlevomatCodingStandard.Classes.PropertySpacing"/>
<!-- Enforces method signature to be spllited into multilines when method signature is too large -->
<rule ref="SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature">
<properties>
<property name="minLineLength" value="140"/>
</properties>
</rule>
<!-- Requires use of early exit when there is useless else and elseif on code-->
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit.UselessElse"/>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit.UselessElseIf"/>
<!-- Enforces blank line around jump statements like continue or return -->
<rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"/>
<!-- Require language constructs with parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
<!-- Require new instances with parentheses -->
<rule ref="SlevomatCodingStandard.ControlStructures.NewWithParentheses"/>
<!-- Requires multiline ternary when line is too large-->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireMultiLineTernaryOperator">
<properties>
<property name="lineLengthLimit" value="80"/>
</properties>
</rule>
<!-- Require usage of null coalesce operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/>
<!-- Require short ternary operator `?:` when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator"/>
<!-- Requires ternary operator when possible -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"/>
<!-- Force yoda conditions -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/>
<!-- Forbid useless unreachable catch blocks -->
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<!-- Enforces function calls to be spllited in more lines when the funcion call is too large -->
<rule ref="SlevomatCodingStandard.Functions.RequireMultiLineCall">
<properties>
<property name="minLineLength" value="140"/>
</properties>
</rule>
<!-- Enforces function calls to be on single line when function call is short -->
<rule ref="SlevomatCodingStandard.Functions.RequireSingleLineCall">
<properties>
<property name="maxLineLength" value="80"/>
</properties>
</rule>
<!-- Checks if references to \Throwable interface was made, instead of references to concrete class \Exception -->
<!-- <rule ref="SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException">
<type>warning</type>
</rule> -->
<!-- Looks for unused inherited variables passed to closure via `use` -->
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<!-- Checks against unused parameters -->
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
<!-- Checks against useless parameter default value -->
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<!-- Forbid fancy group uses -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<!-- Forbid multiple use statements on same line -->
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine"/>
<!-- Forbid using absolute class name references (except global ones) -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
<!-- Forbid multiples namespaces in one file -->
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile"/>
<!-- Enforces one space after namespace, disallows content between namespace name and semicolon and disallows use of bracketed syntax -->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration"/>
<!-- Require newlines around namespace declaration -->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing">
<properties>
<property name="linesCountBeforeNamespace" value="1"/>
<property name="linesCountAfterNamespace" value="1"/>
</properties>
</rule>
<!-- Require empty newlines before and after uses -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="1"/>
</properties>
</rule>
<!-- Forbid unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<!-- 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 useless alias -->
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias"/>
<!-- Checks against simple comparisons because they do not compare types, e.g. `==` or `!=` -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators">
<type>warning</type>
</rule>
<!-- Require the usage of assignment operators, eg `+=`, `.=` when possible -->
<rule ref="SlevomatCodingStandard.Operators.RequireCombinedAssignmentOperator"/>
<!-- Forbid `list(...)` syntax -->
<rule ref="SlevomatCodingStandard.PHP.ShortList"/>
<!-- Forbid use of longhand cast operators -->
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<!-- Forbid useless semicolon -->
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon"/>
<!-- Warns about possible useless parentheses. This sniff was setted as a warning because it does not work so well with complex expressions -->
<!-- <rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
<type>warning</type>
</rule> -->
<!-- Disallow `mixed` type hints in phpDocs -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/> -->
<!-- Require use of short versions of scalar types (i.e. int instead of integer) -->
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<!-- Checks if parameter with null default value is nullable-->
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"/>
<!-- Require that the `null` phpDocs must be in the last position -->
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
<!-- Checks parameter type hint -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
<type>warning</type>
</rule> -->
<!-- Require one space between typehint and variable, require no space between nullability sign and typehint -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<!-- Checks property type hint -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.UselessAnnotation"/>
</rule>
<!-- Checks return type hint -->
<!-- <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<type>warning</type>
</rule> -->
<!-- Forbid space around colon in return types -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
<!-- This rules include in PSR-12 -->
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing.WhitespaceBeforeColon"/>
</rule>
<!-- Checks useless `@var` annotations on constants, because the type of constant is always clear -->
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint.UselessVarAnnotation"/>
<!-- Checks against unnecessary duplicate spaces-->
<rule ref="SlevomatCodingStandard.Whitespaces.DuplicateSpaces">
<properties>
<property name="ignoreSpacesInComment" value="true"/>
<property name="ignoreSpacesInAnnotation" value="true"/>
</properties>
</rule>
<!-- Forbid duplicated variables assignments -->
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<!-- Forbid useless variables -->
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<!-- ############ -->
<!-- PHPCS SNIFFS -->
<!-- ############ -->
<!-- Force array element indentation with 4 spaces -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<!-- Forbid duplicate classes -->
<!-- Class and Interface names should be unique in a project. They should never be duplicated -->
<rule ref="Generic.Classes.DuplicateClassName"/>
<!-- Control Structures must have at least one statement inside of the body | Forbid empty statements -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">
<!-- But allow empty catch -->
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
</rule>
<!-- Forbid final methods in final classes -->
<!-- Methods should not be declared final inside of classes that are declared final -->
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<!-- If statements that are always evaluated should not be used -->
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<!-- Forbid useless empty method overrides -->
<!-- Methods should not be defined that only call the parent method -->
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<!-- Force whitespace after a type cast -->
<rule ref="Generic.Formatting.SpaceAfterCast">
<properties>
<property name="spacing" value="1"/>
</properties>
</rule>
<!-- Force whitespace after the not operator `!` -->
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="1"/>
</properties>
</rule>
<!-- Forbid any content before opening tag -->
<!-- The opening php tag should be the first item in the file -->
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
<!-- Forbid alias functions, i.e. `delete()`, `sizeof()` -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="chop" value="rtrim"/>
<element key="close" value="closedir"/>
<element key="delete" value="unset"/>
<element key="doubleval" value="floatval"/>
<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"/>
<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="show_source" value="highlight_file"/>
<element key="sizeof" value="count"/>
<element key="strchr" value="strstr"/>
</property>
</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>
<!-- Forbid comments starting with # -->
<rule ref="PEAR.Commenting.InlineComment"/>
<!-- Arbitrary sets of parentheses should have no spaces inside -->
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Forbid spaces around square brackets -->
<rule ref="Squiz.Arrays.ArrayBracketSpacing">
<exclude name="Squiz.Arrays.ArrayBracketSpacing.SpaceBeforeBracket"/>
</rule>
<!-- Force array declaration structure -->
<rule ref="Squiz.Arrays.ArrayDeclaration">
<!-- Does not handle wrapped content -->
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine"/>
<!-- Disable alignment of braces -->
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/>
<!-- Disable arrow alignment -->
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/>
<!-- Uses indentation of only single space -->
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/>
<!-- Disable force ever value to have a key -->
<exclude name="Squiz.Arrays.ArrayDeclaration.KeySpecified"/>
<!-- Disable force single element to be inline -->
<exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed"/>
<exclude name="Squiz.Arrays.ArrayDeclaration.NoComma"/>
<!-- Checked by SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma -->
<exclude name="Squiz.Arrays.ArrayDeclaration.NoCommaAfterLast"/>
<!-- Allow multiple values on a single line -->
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/>
<!-- Disable alignment of values -->
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline"/>
<!-- Disable alignment of values with opening brace -->
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/>
</rule>
<!-- 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">
<!-- Disable force self:: calls -->
<exclude name="Squiz.Classes.SelfMemberReference.NotUsed"/>
</rule>
<!-- Force phpDoc alignment -->
<rule ref="Squiz.Commenting.DocCommentAlignment">
<!-- Space needed for indented annotations -->
<exclude name="Squiz.Commenting.DocCommentAlignment.SpaceAfterStar"/>
</rule>
<!-- If a function throws any exceptions, they should be documented in a @throws tag -->
<rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
<!-- Forbid `AND` and `OR`, require `&&` and `||` -->
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<!-- Forbid functions inside functions -->
<rule ref="Squiz.PHP.InnerFunctions"/>
<!-- Require PHP function calls in lowercase -->
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<!-- Forbid strings in `"` unless necessary -->
<rule ref="Squiz.Strings.DoubleQuoteUsage">
<!-- Allow variables inside double quoted strings -->
<exclude name="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>
</rule>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<message>Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead</message>
</rule>
<!-- Forbid blank line after function opening brace -->
<rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace"/>
<!-- Require space after language constructs -->
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<!-- Require space around logical operators -->
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<!-- Forbid spaces around `->` operator -->
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Force one space before and after assignment -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
<property name="ignoreSpacingBeforeAssignments" value="true"/>
</properties>
</rule>
<!-- 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">
<!-- Forbid duplicated empty lines -->
<severity>5</severity>
</rule>
<!-- Forbid spaces before semicolon `;` -->
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<!-- Function declarations follow the "BSD/Allman style" -->
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<!-- Forbid `$this` inside static function -->
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
<properties>
<property name="equalsSpacing" value="1"/>
</properties>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint"/><!-- already checked by SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing.MultipleSpacesBetweenTypeHintAndParameter -->
</rule>
<!-- Force whitespace before and after concatenation -->
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
<property name="spacing" value="1"/>
</properties>
</rule>
<!-- Require 1 line before and after function, except at the top and bottom -->
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<!-- does not allow PHPUnit ignore comments -->
<!-- <exclude name="Squiz.WhiteSpace.FunctionSpacing.After"/> -->
<!-- does not allow PHPUnit ignore comments -->
<!-- <exclude name="Squiz.WhiteSpace.FunctionSpacing.AfterLast"/> -->
<properties>
<property name="spacing" value="1"/>
<property name="spacingBeforeFirst" value="0"/>
<property name="spacingAfterLast" value="0"/>
</properties>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.DuplicateReturn">
<message>Only 1 @return annotation is allowed in a function comment</message>
</rule>
<rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn">
<message>Function has no return statement, but annotation @return is present</message>
</rule>
<!-- <rule ref="Squiz.Commenting.FunctionComment.MissingParamTag">
<message>@param annotation for parameter "%s" missing</message>
</rule> -->
<!-- Allow TODO tags -->
<rule ref="Generic.Commenting.Todo.CommentFound">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.Todo.TaskFound">
<severity>0</severity>
</rule>
<rule ref="Generic.Commenting.Todo.CommentFound">
<severity phpcbf-only="true">0</severity>
</rule>
</ruleset>