-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
68 lines (55 loc) · 3.48 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
68 lines (55 loc) · 3.48 KB
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
<?xml version="1.0"?>
<ruleset name="c975L">
<description>PSR-12 coding standard for the c975L bundles</description>
<file>src</file>
<file>tests</file>
<!-- VariableAnalysis below is a Composer package rather than a sniff phpcs ships, and this is what puts its classes within reach of whichever phpcs binary runs - the phar on the development machine as much as vendor's own -->
<autoload>./vendor/autoload.php</autoload>
<!-- Generated, third-party and non-PHP template files are not ours to lint -->
<exclude-pattern>*/public/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*.tpl.php</exclude-pattern>
<rule ref="PSR12">
<!-- PSR-12 states the line length as a recommendation, not a requirement -->
<exclude name="Generic.Files.LineLength"/>
</rule>
<!-- Packagist requires the c975L vendor prefix, which is not PascalCase -->
<rule ref="Squiz.Classes.ValidClassName.NotPascalCase">
<exclude-pattern>*c975L*</exclude-pattern>
</rule>
<!-- Test doubles stay in the file of the test case that uses them -->
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- A test case may pull in a fixture the tests' PSR-4 autoloader cannot reach -->
<rule ref="PSR1.Files.SideEffects">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- A debug call or an exit() forgotten in the code, what phpmd reported under DevelopmentCodeFragment. Stated here rather than left to phpmd's own rule, which reads a function image together with its namespace and therefore never matched a single call in namespaced code -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="var_dump" value="null"/>
<element key="print_r" value="null"/>
<element key="debug_zval_dump" value="null"/>
<element key="debug_print_backtrace" value="null"/>
<element key="exit" value="null"/>
<element key="die" value="null"/>
</property>
</properties>
</rule>
<!-- eval() needs its own sniff, being a construct and not a function ForbiddenFunctions could name -->
<rule ref="Squiz.PHP.Eval"/>
<!-- A catch left empty swallows the error it catches, and the empty block is the one place where that does not show on reading (phpmd's EmptyCatchBlock) -->
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<!-- goto: nobody writes any, which is precisely why the rule costs nothing (phpmd's GotoStatement) -->
<rule ref="Generic.PHP.DiscourageGoto"/>
<!-- A count() in the test of a for is called again on every turn (phpmd's CountInLoopExpression) -->
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<!-- A local variable assigned and never read, the last of the phpmd rules phpcs has no sniff of its own for - hence the standard in require-dev. Parameters are left out: an interface implementation and a test double both name arguments they have no use for, which is what phpmd's UnusedFormalParameter reported and this gate never did -->
<rule ref="./vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php">
<properties>
<property name="allowUnusedFunctionParameters" value="true"/>
</properties>
</rule>
</ruleset>