forked from matomo-org/matomo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
53 lines (44 loc) · 1.77 KB
/
phpcs.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
<?xml version="1.0"?>
<ruleset name="matomo">
<description>Matomo Coding Standard</description>
<arg name="extensions" value="php" />
<file>core</file>
<file>plugins</file>
<file>tests/PHPUnit</file>
<exclude-pattern>tests/PHPUnit/proxy/*</exclude-pattern>
<exclude-pattern>tests/javascript/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/libs/*</exclude-pattern>
<!-- Forbid other line endings than \n -->
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n" />
</properties>
</rule>
<!-- Forbid short open tags -->
<rule ref="Generic.PHP.DisallowShortOpenTag.Found" />
<!-- Forbid inline control structures -->
<rule ref="Generic.ControlStructures.InlineControlStructure" />
<!-- Forbid unused use statements -->
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="ignoredAnnotations" type="array">
<element value="@group"/>
<element value="@api"/>
</property>
</properties>
</rule>
<!-- Forbid some functions that should not be used (directly) -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="eval" value="null"/>
<element key="create_function" value="null"/>
<element key="unserialize" value="\Piwik\Common::safe_unserialize"/>
</property>
</properties>
<!-- still allow those functions in tests -->
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
</ruleset>