-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
67 lines (58 loc) · 3.21 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
67 lines (58 loc) · 3.21 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
<?xml version="1.0"?>
<ruleset name="c975L">
<description>PSR-12 coding standard for the c975L bundles</description>
<file>src</file>
<file>tests</file>
<!-- 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>
<!-- What phpmd used to report before its parser was left behind by PHP 8.4: a debug call or an exit() forgotten in the code. Stated here rather than left to phpmd's own DevelopmentCodeFragment, 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, and it is raised to an error so the severity says what the rule means -->
<rule ref="Squiz.PHP.Eval.Discouraged">
<type>error</type>
</rule>
<!-- The rest of what phpmd reported through unusedcode.xml, design.xml and naming.xml, each one stated as the sniff that covers it. UnusedLocalVariable and DepthOfInheritance leave with phpmd: no sniff replaces them, and PHPStan at level 5 does not see the first -->
<rule ref="Generic.CodeAnalysis.EmptyStatement">
<!-- A test may swallow the very exception it expects, the assertion being what was not written before it -->
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall">
<type>error</type>
</rule>
<rule ref="Generic.PHP.DiscourageGoto">
<type>error</type>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName">
<!-- The camelCase is what phpmd asked for; the leading underscore on a private member is a PEAR convention PSR-12 dropped -->
<exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/>
</rule>
</ruleset>