-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpcs.xml.dist
84 lines (69 loc) · 3.05 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
<?xml version="1.0"?>
<ruleset name="Gedachtegoed">
<description>Gedachtegoed PHP CS rules for PHP packages</description>
<file>src</file>
<!-- <file>config</file> -->
<file>tests</file>
<description>Gedachtegoed PHP CS rules for PHP packages</description>
<!-- Ignore normal Laravel files and folders -->
<exclude-pattern>*/cache/*</exclude-pattern>
<exclude-pattern>*/*.js</exclude-pattern>
<exclude-pattern>*/*.css</exclude-pattern>
<exclude-pattern>*/*.xml</exclude-pattern>
<exclude-pattern>*/*.blade.php</exclude-pattern>
<exclude-pattern>*/autoload.php</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/docs/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/migrations/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<!-- Hard-code command-line parameters -->
<arg name="colors"/>
<arg value="p"/>
<!-- PSR1 2.3 Side Effects -->
<rule ref="PSR1.Files.SideEffects">
<!-- Disable side effects for index file -->
<exclude-pattern>/public/index.php</exclude-pattern>
<!-- Disable side effects for tests (Pest) -->
<exclude-pattern>/tests</exclude-pattern>
</rule>
<!-- PSR1 3 Namespaces and classes MUST follow PSR-0. -->
<rule ref="PSR1.Classes.ClassDeclaration"/>
<!-- Disable missing namespace rule for tests and database files -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/database/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- PSR1 3 Class names MUST be declared in StudlyCaps. -->
<rule ref="Squiz.Classes.ValidClassName"/>
<!-- PSR1 4.1 Class constants MUST be declared in all upper case with underscore separators. -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<!-- PSR1 4.3 Method names MUST be declared in camelCase(). -->
<rule ref="PSR1.Methods.CamelCapsMethodName"/>
<!-- Disable camel caps rule for tests -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<!-- No compact() and no 'dumps' -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="compact" value="null"/>
<element key="dd" value="null"/>
<element key="dump" value="null"/>
<element key="var_dump" value="null"/>
<element key="ray" value="null"/>
</property>
</properties>
</rule>
<rule ref="Generic.PHP.ForbiddenFunctions">
<exclude-pattern>/config/*</exclude-pattern>
<properties>
<property name="forbiddenFunctions" type="array">
<element key="env" value="null"/>
</property>
</properties>
</rule>
<!-- Class name should match the file name -->
<rule ref="Squiz.Classes.ClassFileName"/>
</ruleset>