-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathruleset.xml
More file actions
executable file
·140 lines (125 loc) · 5.59 KB
/
ruleset.xml
File metadata and controls
executable file
·140 lines (125 loc) · 5.59 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
136
137
138
139
140
<?xml version="1.0"?>
<ruleset name="Shoptet">
<description>Setup for Shoptet API SDK in PHP</description>
<file>src</file>
<file>tests</file>
<block>Standards</block>
<rule ref="PSR12">
<exclude name="PSR12.Files.FileHeader"/>
<exclude name="PSR12.Namespaces.CompoundNamespaceDepth"/>
<exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody" />
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace" />
<exclude name="PSR1.Files.SideEffects" />
<exclude name="Generic.Files.LineLength.TooLong" />
<exclude name="Generic.NamingConventions.UpperCaseConstantName.ClassConstantNotUpperCase" />
</rule>
<rule ref="PSR2.Methods.FunctionCallSignature">
<properties>
<property name="allowMultipleArguments" value="true" />
</properties>
</rule>
<rule ref="Squiz.Classes.ValidClassName">
<severity>0</severity>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<note>Exclude check for multiple classes within tests</note>
</rule>
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<note>Exclude camelCaps method check for tests</note>
</rule>
<block>Arrays</block>
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
<rule ref="Squiz.Arrays.ArrayDeclaration">
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.KeyNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.SingleLineNotAllowed" />
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline" />
<exclude name="Squiz.Arrays.ArrayDeclaration.CommaAfterLast" />
<exclude name="Squiz.Arrays.ArrayDeclaration.DoubleArrowNotAligned" />
<exclude name="Squiz.Arrays.ArrayDeclaration.MultiLineNotAllowed" />
<note>Forces no space in empty array and comma after last element</note>
</rule>
<rule ref="Generic.Arrays.ArrayIndent" />
<block>PHP generic</block>
<rule ref="Generic.PHP.ForbiddenFunctions" type="array" note="sizeof=>count,delete=>unset,print=>null,is_null=>null,create_function=>null">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="sizeof" value="count"/>
<element key="is_null" value="null"/>
<element key="delete" value="unset"/>
<element key="print" value="echo"/>
<element key="create_function" value="null"/>
</property>
</properties>
</rule>
<rule ref="Generic.PHP.CharacterBeforePHPOpeningTag" />
<rule ref="Generic.PHP.NoSilencedErrors">
<properties>
<property name="error" value="true" />
</properties>
</rule>
<rule ref="Generic.PHP.BacktickOperator" />
<rule ref="Generic.PHP.DeprecatedFunctions" />
<rule ref="Squiz.PHP.DiscouragedFunctions" note="error_log(), print_r(), var_dump()" />
<rule ref="Squiz.PHP.LowercasePHPFunctions" />
<rule ref="Squiz.PHP.NonExecutableCode" />
<rule ref="PSR12.Files.OpenTag" />
<block>Formatting</block>
<rule ref="Generic.Formatting.SpaceAfterCast" />
<block>Whitespace</block>
<fixme>
- Opening of array should increase indentation,
- double opening of anything should increase indentation just once
</fixme>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing" note="No space before semicolon" />
<block>Commenting</block>
<rule ref="Generic.Commenting.Fixme" />
<rule ref="Squiz.Commenting.EmptyCatchComment" />
<block>Strings</block>
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1" />
<property name="ignoreNewlines" value="true" />
</properties>
</rule>
<rule ref="Squiz.Strings.EchoedStrings" />
<block>Namespace</block>
<rule ref="PSR2.Namespaces.NamespaceDeclaration" />
<rule ref="PSR2.Namespaces.UseDeclaration">
<note>Generates wrong code in some cases, using custom sniff</note>
<exclude name="PSR2.Namespaces.UseDeclaration.MultipleDeclarations" />
</rule>
<block>Naming</block>
<rule ref="Generic.NamingConventions.ConstructorName" />
<block>Operators</block>
<rule ref="Squiz.Operators.ValidLogicalOperators" note="Forbids use or 'and' and 'or' operators" />
<block>Slevomat Coding Standard</block>
<config name="installed_paths" value="../../slevomat/coding-standard" /><!-- relative path from PHPCS source location -->
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse" />
<rule ref="SlevomatCodingStandard.Namespaces.MultipleUsesPerLine" />
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceDeclaration" />
<rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing">
<properties>
<property name="linesCountBeforeNamespace" type="int" value="1" />
<property name="linesCountAfterNamespace" type="int" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile" />
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" type="bool" value="true" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
<property name="linesCountBeforeFirstUse" type="int" value="1" />
<property name="linesCountBetweenUseTypes" type="int" value="0" />
<property name="linesCountAfterLastUse" type="int" value="1" />
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UselessAlias" />
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
<exclude-pattern>*/vendor/*</exclude-pattern>
</ruleset>