-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathphpcs.xml
More file actions
executable file
·80 lines (71 loc) · 2.62 KB
/
Copy pathphpcs.xml
File metadata and controls
executable file
·80 lines (71 loc) · 2.62 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
<?xml version="1.0"?>
<ruleset name="rules">
<description>Codesniffer rules for the Koko Analytics plugin</description>
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="8"/>
<arg value="ns"/>
<config name="testVersion" value="7.4-"/>
<config name="minimum_wp_version" value="6.2" />
<file>.</file>
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>assets/</exclude-pattern>
<exclude-pattern>\.git</exclude-pattern>
<exclude-pattern>tests/benchmarks/*</exclude-pattern>
<!-- Generic PHP sniffs -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax.Found"/>
<rule ref="Generic.PHP.Syntax" />
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="create_function" value="null" />
<element key="eval" value="null" />
<element key="sizeof" value="count" />
<element key="delete" value="unset" />
<element key="print" value="echo" />
<element key="mt_rand" value="random_int"/>
<element key="rand" value="random_int"/>
<!-- Debugging functions -->
<element key="var_dump" value="null" />
<element key="each" value="null" />
<element key="ray" value="null" />
<element key="dd" value="null" />
<element key="die" value="null" />
<!-- Type checking and converting function -->
<element key="boolval" value="(bool)"/>
<element key="doubleval" value="(float)"/>
<element key="doubleval" value="floatval"/>
<element key="floatval" value="(float)"/>
<element key="intval" value="(int)"/>
<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="strval" value="(string)"/>
</property>
</properties>
</rule>
<!-- PSR12 formatting -->
<rule ref="PSR12">
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
</rule>
<!-- WordPress sniffs -->
<rule ref="WordPress.Security">
<exclude name="WordPress.Security.ValidatedSanitizedInput.InputNotSanitized"/>
<exclude-pattern>code-snippets/</exclude-pattern>
</rule>
<rule ref="WordPress.DB"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="koko-analytics" />
</property>
</properties>
</rule>
<rule ref="WordPress.NamingConventions"/>
<!-- PHP compatibility sniffs -->
<rule ref="PHPCompatibilityWP"/>
</ruleset>