This repository has been archived by the owner on Feb 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
phpcs.xml.dist
180 lines (162 loc) · 6.67 KB
/
phpcs.xml.dist
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?xml version="1.0"?>
<ruleset name="Tiki Coding Standard">
<description>Tiki Coding Standard</description>
<!-- Paths to check -->
<file>.</file>
<!-- Exclude libraries and other folders that should not contain code -->
<!-- vendor folders -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/vendor_bundled/*</exclude-pattern>
<exclude-pattern>*/vendor_custom/*</exclude-pattern>
<exclude-pattern>*/vendor_extra/*</exclude-pattern>
<!-- libraries bundled with tiki -->
<exclude-pattern>*/lib/dracula/*</exclude-pattern>
<exclude-pattern>*/lib/equation/*</exclude-pattern>
<exclude-pattern>*/lib/ical/*</exclude-pattern>
<exclude-pattern>*/lib/openlayers/*</exclude-pattern>
<exclude-pattern>*/lib/sheet/excel/*</exclude-pattern>
<exclude-pattern>*/lib/sheet/include/*</exclude-pattern>
<exclude-pattern>*/lib/sheet/ole.php</exclude-pattern>
<exclude-pattern>*/lib/sheet/ole/*</exclude-pattern>
<exclude-pattern>*/lib/soap/nusoap/*</exclude-pattern>
<exclude-pattern>*/lib/swfobject/*</exclude-pattern>
<exclude-pattern>*/lib/tar.class.php</exclude-pattern>
<exclude-pattern>*/lib/tikihelp/js/*</exclude-pattern>
<exclude-pattern>*/lib/tikihelp/menu/*</exclude-pattern>
<exclude-pattern>*/lib/webmail/mimeDecode.php</exclude-pattern>
<exclude-pattern>*/lib/webmail/net_pop3.php</exclude-pattern>
<!-- any dot file -->
<exclude-pattern>*/\.*/*</exclude-pattern>
<!-- generated files / directories -->
<exclude-pattern>*/lang/*/language.php</exclude-pattern>
<exclude-pattern>*/lang/*/language.js</exclude-pattern>
<exclude-pattern>*/lib/test/language/fixtures/language_*</exclude-pattern>
<exclude-pattern>*/lib/core/JisonParser/Phraser.js</exclude-pattern>
<exclude-pattern>*/lib/core/JisonParser/Phraser.php</exclude-pattern>
<!-- other directories that should not contain core code -->
<!-- <exclude-pattern>*/doc/*</exclude-pattern> -->
<exclude-pattern>*/dump/*</exclude-pattern>
<exclude-pattern>*/img/*</exclude-pattern>
<exclude-pattern>*/storage/*</exclude-pattern>
<exclude-pattern>*/temp/*</exclude-pattern>
<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<!-- Tiki uses the Zend Coding Standards
reference: https://github.com/zendframework/zend-coding-standard/blob/master/ruleset.xml -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.Formatting.SpaceAfterNot"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Moved as override to the end of the rule set -->
<!--
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
-->
<!-- Other rules to enforce the ZF standards -->
<rule ref="Squiz.Strings.ConcatenationSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<!-- Tiki uses tabs for indentation -->
<arg name="tab-width" value="4"/>
<rule ref="PSR2">
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<!-- Change severity to be able to filter if too many lines over 120 using cli option warning-severity=5 -->
<rule ref="Generic.Files.LineLength">
<severity>4</severity>
</rule>
<!-- Exceptions to PSR-2 -->
<!-- Avoid warnings in the lang files that normally have really long lines -->
<rule ref="Generic.Files.LineLength">
<exclude-pattern>*/lang/*/language.php</exclude-pattern>
</rule>
<!-- Relax some PRS-1/PSR-2 Rules to match current status.
Instead of error, these rules will return warning, and the severity is 6 so you can
display only these warning using the cli option warning-severity=6 -->
<!-- Relax PSR -->
<!-- Namespaces and classes MUST follow PSR-0.
This means each class is in a file by itself, and is in a namespace of at least one level: a top-level vendor name. -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<message>Tiki PSR1 Relaxed: Each %s must be in a namespace of at least one level (a top-level vendor name)</message>
<type>warning</type>
<severity>6</severity>
</rule>
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
<message>Tiki PSR1 Relaxed: Each class must be in a file by itself</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- Class names MUST be declared in StudlyCaps. -->
<rule ref="Squiz.Classes.ValidClassName.NotCamelCaps">
<message>Tiki PSR1 Relaxed: %s name "%s" is not in camel caps format</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- Method names MUST be declared in camelCase(). -->
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
<message>Tiki PSR1 Relaxed: Method name "%s" is not in camel caps format</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- Visibility MUST be declared on all properties -->
<rule ref="PSR2.Classes.PropertyDeclaration.ScopeMissing">
<message>Tiki PSR2 Relaxed: Visibility must be declared on property "%s"</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- The var keyword MUST NOT be used to declare a property -->
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed">
<message>Tiki PSR2 Relaxed: The var keyword must not be used to declare a property</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- Visibility MUST be declared on all methods. -->
<rule ref="Squiz.Scope.MethodScope.Missing">
<message>Tiki PSR2 Relaxed: Visibility must be declared on method "%s"</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- ~ PSR -->
<!-- Relax ZF Coding Standards -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax">
<message>Tiki ZF CS Relaxed: Short array syntax must be used to define arrays</message>
<type>warning</type>
<severity>6</severity>
</rule>
<!-- ~ ZF Coding Standards -->
<!-- Extra rules to improve code quality and avoid deprecated code -->
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<!--
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.Files.OneClassPerFile"/>
<rule ref="Generic.Files.OneInterfacePerFile"/>
<rule ref="Generic.Files.OneTraitPerFile"/>
<rule ref="Generic.PHP.BacktickOperator"/>
-->
<!-- Overrides - at the end to make sure they are applied -->
<!-- From ZF Standards -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
</ruleset>