-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruleset.xml
144 lines (138 loc) · 6.91 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
144
<?xml version="1.0"?>
<ruleset name="jonlink">
<description>Custom PSR2 Standard for jonlink</description>
<config name="installed_paths" value="vendor/slevomat/coding-standard/SlevomatCodingStandard/"/>
<rule ref="PSR2">
<exclude name="Generic.Files.LineLength"/>
<exclude name="PSR2.Classes.ClassDeclaration"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration"/>
</rule>
<!-- Enforce whitespace -->
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1" />
<property name="spacingBeforeFirst" value="0" />
<property name="spacingAfterLast" value="0" />
</properties>
</rule>
<rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing"/>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Generic.Formatting.SpaceAfterCast">
<properties>
<property name="spacing" value="1"/>
</properties>
</rule>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
<property name="spacing" value="1"/>
</properties>
</rule>
<rule ref="Generic.Formatting.SpaceAfterNot">
<properties>
<property name="spacing" value="0" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing">
<properties>
<property name="linesCountBeforeNamespace" value="0"/>
<property name="linesCountAfterNamespace" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/>
<!-- imports -->
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/> <!-- forbid uses of the same namespace -->
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> <!-- require alphabetic order of imports -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"> <!-- require empty newlines before and after uses -->
<properties>
<property name="linesCountAfterLastUse" value="1"/>
<property name="linesCountBeforeFirstUse" value="1"/>
<property name="linesCountBetweenUseTypes" value="0"/>
</properties>
</rule>
<!-- no dead code -->
<rule ref="Squiz.PHP.GlobalKeyword"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<rule ref="SlevomatCodingStandard.Functions.UnusedParameter">
<severity>4</severity>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UselessParameterDefaultValue"/>
<rule ref="SlevomatCodingStandard.Variables.UnusedVariable">
<properties>
<property name="ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure"/>
<rule ref="SlevomatCodingStandard.Exceptions.DeadCatch"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<!-- formatting, styles, & other standards -->
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod">
<severity>1</severity>
</rule>
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration" />
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Squiz.Arrays.ArrayDeclaration">
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"/><!-- don't require closing brace at the same level as opening brace -->
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"/><!-- don't require value to be aligned with opening brace -->
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"/><!-- don't require key's to be aligned with opening brace -->
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed"/><!-- don't require multiline arrays -->
<exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed"/><!-- don't require singleline arrays -->
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned"/><!-- required, but low level (handled below) -->
<exclude name="Squiz.Arrays.ArrayDeclaration.NoKeySpecified"/><!-- in some rare cases we break this rule -->
<exclude name="Squiz.Arrays.ArrayDeclaration.KeySpecified"/><!-- in some rare cases we break this rule -->
</rule>
<rule ref="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned">
<severity>3</severity>
</rule>
<rule ref="SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<severity>1</severity>
</rule>
<rule ref="SlevomatCodingStandard.Variables.DuplicateAssignmentToVariable"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"/> <!-- required where possible -->
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses">
<severity>2</severity>
<properties>
<property name="ignoreComplexTernaryConditions" value="true"/>
</properties>
<severity>1</severity>
</rule>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>
<rule ref="SlevomatCodingStandard.Variables.UselessVariable"/>
<rule ref="SlevomatCodingStandard.Commenting.EmptyComment"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<!-- gut checks -->
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="error" value="false"/>
</properties>
</rule>
<rule ref="Generic.PHP.NoSilencedErrors">
<properties>
<property name="error" value="false"/>
</properties>
</rule>
<rule ref="Squiz.PHP.DiscouragedFunctions">
<properties>
<property name="error" value="true"/>
</properties>
</rule>
</ruleset>