-
Notifications
You must be signed in to change notification settings - Fork 32
/
ruleset.xml
143 lines (140 loc) · 6.18 KB
/
ruleset.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
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
<?xml version="1.0"?>
<ruleset name="php-standard">
<!-- specific sniffs to include -->
<!-- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Customisable-Sniff-Properties -->
<!-- https://github.com/slevomat/coding-standard#sniffs-included-in-this-standard -->
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Arrays/TrailingArrayCommaSniff.php"/>
<rule ref="vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php">
<properties>
<property name="caseSensitive" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
<rule ref="SlevomatCodingStandard.ControlStructures.EarlyExit"/>
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<rule ref="SlevomatCodingStandard.Classes.ModernClassNameReference"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator"/>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<!-- <rule ref="SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint"/> -->
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.NotRequired" />
<rule ref="PSR2">
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/>
<exclude name="PSR2.Classes.ClassDeclaration"/>
<exclude name="PSR2.ControlStructures.SwitchDeclaration"/>
<exclude name="PSR2.Methods.FunctionCallSignature"/>
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="PEAR.Functions.FunctionCallSignature">
<properties>
<property name="requiredSpacesAfterOpen" value="0"/>
<property name="requiredSpacesBeforeClose" value="0"/>
</properties>
</rule>
<rule ref="PSR2.Classes.ClassDeclaration">
<properties>
<property name="tabIdent" value="true"/>
</properties>
</rule>
<rule ref="PSR2.ControlStructures.SwitchDeclaration">
<properties>
<property name="tabIdent" value="true"/>
</properties>
</rule>
<rule ref="PSR2.Methods.FunctionCallSignature">
<properties>
<property name="tabIdent" value="true"/>
<property name="requiredSpacesAfterOpen" value="1"/>
<property name="requiredSpacesBeforeClose" value="1"/>
</properties>
</rule>
<!-- Forbid some functions -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="count" value="sizeof"/>
<element key="print" value="echo"/>
<element key="is_null" value="null"/>
<element key="create_function" value="null"/>
<element key="phpinfo" value="null"/>
<element key="list" value="null"/>
<element key="array" value="null"/>
<element key="strval" value="null"/>
<element key="intval" value="null"/>
</property>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- Warn about lines longer than 100 chars, and error for lines longer than 135 chars. -->
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="120" />
<property name="absoluteLineLimit" value="120" />
</properties>
</rule>
<rule ref="Generic.Formatting.SpaceAfterCast">
<properties>
<property name="spacing" value="0"/>
</properties>
</rule>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0"/>
</properties>
</rule>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie">
<properties>
<property name="checkFunctions" value="true" />
<property name="checkClosures" value="true" />
</properties>
</rule>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="30" />
<property name="absoluteComplexity" value="30" />
</properties>
</rule>
<rule ref="PSR12.ControlStructures.BooleanOperatorPlacement">
<properties>
<property name="allowOnly" value="first" />
</properties>
</rule>
<rule ref="Squiz.ControlStructures.ControlSignature">
<properties>
<property name="requiredSpacesBeforeColon" value="0" />
</properties>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps"/>
</ruleset>