-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathruleset.xml
More file actions
executable file
·135 lines (129 loc) · 6.64 KB
/
ruleset.xml
File metadata and controls
executable file
·135 lines (129 loc) · 6.64 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
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
<?xml version="1.0"?>
<ruleset name="WebimpressCodingStandard"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Webimpress Coding Standard</description>
<!-- PSR-2 base -->
<rule ref="PSR2">
<!-- Below 2 rules are covered by Generic.PHP.LowerCaseKeyword -->
<exclude name="Squiz.ControlStructures.LowercaseDeclaration"/>
<exclude name="Squiz.Functions.LowercaseFunctionKeywords"/>
<!-- Replaced by WebimpressCodingStandard.WhiteSpace.ScopeIndent -->
<exclude name="Generic.WhiteSpace.ScopeIndent"/>
<exclude name="PSR2.Methods.FunctionCallSignature.Indent"/>
<exclude name="PSR2.Methods.FunctionCallSignature.OpeningIndent"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.Indent"/>
<exclude name="Squiz.WhiteSpace.ScopeClosingBrace.Indent"/>
<!-- Replaced by WebimpressCodingStandard.WhiteSpace.BraceBlankLine -->
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/>
<exclude name="PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen"/>
<exclude name="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose"/>
<!-- Replaced by WebimpressCodingStandard.WhiteSpace.CommaSpacing -->
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpaceBeforeComma"/>
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.NoSpaceBeforeArg"/>
<!-- Replaced by WebimpressCodingStandard.Formatting.Reference.UnexpectedSpace -->
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterReference"/>
<!-- Replaced by WebimpressCodingStandard.Formatting.NoSpaceAfterSplat.SpaceFound -->
<exclude name="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterVariadic"/>
<!-- Replaced by WebimpressCodingStandard.NamingConventions.ValidVariableName -->
<exclude name="PSR2.Classes.PropertyDeclaration.Underscore"/>
<!-- Replaced by Generic.NamingConventions.CamelCapsFunctionName -->
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
</rule>
<!-- Only one space after type in property declaration - PHP 7.4+ -->
<rule ref="PSR2.Classes.PropertyDeclaration.SpacingAfterType">
<severity>5</severity>
</rule>
<!-- Generic Rules -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.ControlStructures.DisallowYodaConditions"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment">
<properties>
<property name="maxPadding" value="1"/>
<property name="error" value="true"/>
</properties>
</rule>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
<rule ref="Generic.PHP.DiscourageGoto"/>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="chop" value="rtrim"/>
<element key="close" value="closedir"/>
<element key="compact" value="null"/>
<element key="delete" value="unset"/>
<element key="doubleval" value="floatval"/>
<element key="extract" value="null"/>
<element key="fputs" value="fwrite"/>
<element key="ini_alter" value="ini_set"/>
<element key="is_double" value="is_float"/>
<element key="is_integer" value="is_int"/>
<element key="is_long" value="is_int"/>
<element key="is_null" value="null"/>
<element key="is_real" value="is_float"/>
<element key="is_writeable" value="is_writable"/>
<element key="join" value="implode"/>
<element key="key_exists" value="array_key_exists"/>
<element key="pos" value="current"/>
<element key="settype" value="null"/>
<element key="show_source" value="highlight_file"/>
<element key="sizeof" value="count"/>
<element key="strchr" value="strstr"/>
</property>
</properties>
</rule>
<rule ref="Generic.Strings.UnnecessaryStringConcat">
<properties>
<property name="allowMultiline" value="true"/>
</properties>
</rule>
<rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/>
<!-- PEAR Rules -->
<rule ref="PEAR.Commenting.InlineComment"/>
<!-- PSR-12 Rules -->
<rule ref="PSR12.Classes.ClassInstantiation"/>
<rule ref="PSR12.Functions.NullableTypeDeclaration"/>
<!-- Squiz Rules -->
<rule ref="Squiz.Classes.ClassFileName"/>
<rule ref="Squiz.Classes.SelfMemberReference"/>
<rule ref="Squiz.Operators.IncrementDecrementUsage"/>
<rule ref="Squiz.Operators.ValidLogicalOperators"/>
<rule ref="Squiz.PHP.DisallowMultipleAssignments">
<exclude name="Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure"/>
</rule>
<rule ref="Squiz.PHP.LowercasePHPFunctions"/>
<rule ref="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.Strings.DoubleQuoteUsage"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar">
<message>Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead</message>
</rule>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
</ruleset>