-
Notifications
You must be signed in to change notification settings - Fork 476
/
phpcs.xml
111 lines (92 loc) · 4.16 KB
/
phpcs.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
<?xml version="1.0"?>
<ruleset name="device-detector">
<description>Device Detector Coding Standard</description>
<file>.</file>
<exclude-pattern>vendor/</exclude-pattern>
<!-- use MO4 coding standard as base -->
<rule ref="MO4">
<exclude name="SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty"/>
<exclude name="SlevomatCodingStandard.Commenting.UselessInheritDocComment"/>
<exclude name="SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter"/>
<exclude name="Squiz.PHP.DisallowMultipleAssignments.Found"/>
<exclude name="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator"/>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator">
<properties>
<property name="ignoreMultiLine" value="true"/>
</properties>
</rule>
<rule ref="Symfony.Commenting">
<exclude-pattern>misc/</exclude-pattern>
<exclude-pattern>Tests/</exclude-pattern>
</rule>
<rule ref="Squiz.Functions.GlobalFunction.Found">
<exclude-pattern>misc/</exclude-pattern>
<exclude-pattern>autoload.php</exclude-pattern>
</rule>
<rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
<exclude-pattern>misc/</exclude-pattern>
<exclude-pattern>autoload.php</exclude-pattern>
</rule>
<!-- Disallow more than 120 chars per line -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120" />
<property name="absoluteLineLimit" value="120" />
</properties>
<exclude-pattern>misc/</exclude-pattern>
<exclude-pattern>Tests/</exclude-pattern>
</rule>
<!-- Require spaces around string concatenating -->
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1" />
</properties>
</rule>
<!-- Disallow is_null function -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="is_null=>null"/>
</properties>
</rule>
<!-- Require empty lines around control structures -->
<rule ref="SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing"/>
<!-- Require strict types -->
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="linesCountBeforeDeclare" value="1" />
<property name="spacesCountAroundEqualsSign" value="0" />
<property name="linesCountAfterDeclare" value="1" />
</properties>
</rule>
<!-- Require Yoda-Conditions -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireYodaComparison"/>
<!-- Disallow useless semicolons -->
<rule ref="SlevomatCodingStandard.PHP.UselessSemicolon" />
<!-- Disallow old type hints in comments (e.g. "int[]" should be "array<int>") -->
<rule ref="SlevomatCodingStandard.TypeHints.DisallowArrayTypeHintSyntax"/>
<!-- Disallow spaces after splat operator -->
<rule ref="SlevomatCodingStandard.Operators.SpreadOperatorSpacing"/>
<!-- Disallow empty lines around class braces -->
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties>
<property name="linesCountAfterOpeningBrace" value="0" />
<property name="linesCountBeforeClosingBrace" value="0" />
</properties>
</rule>
<!-- Require empty lines around namespace definition -->
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing">
<properties>
<property name="linesCountBeforeNamespace" value="1" />
<property name="linesCountAfterNamespace" value="1" />
</properties>
</rule>
<!-- Require empty lines around use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBeforeFirstUse" value="1" />
<property name="linesCountBetweenUseTypes" value="0" />
<property name="linesCountAfterLastUse" value="1" />
</properties>
</rule>
</ruleset>