-
Notifications
You must be signed in to change notification settings - Fork 68
/
phpcs.xml.dist
81 lines (73 loc) · 2.84 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
<?xml version="1.0"?>
<ruleset name="WP Redis">
<description>Sniffs for the coding standards of the WP Redis plugin</description>
<!-- Check all PHP files in directory tree by default. -->
<arg name="extensions" value="php"/>
<file>.</file>
<!-- Show progress and sniff codes in all reports -->
<arg value="ps"/>
<rule ref="Pantheon-WP">
<!-- Rules we explicitly ignore in the object-cache.php drop-in. -->
<!-- Allow overriding WP globals -->
<exclude name="WordPress.WP.GlobalVariablesOverride.Prohibited">
<file>/object-cache.php</file>
</exclude>
<!-- Ignore snifs for unprepared $wpdb queries. -->
<exclude name="WordPress.DB.PreparedSQL.InterpolatedNotPrepared">
<file>/object-cache.php</file>
</exclude>
<!-- Allow underscored functions. -->
<exclude name="PSR2.Methods.MethodDeclaration.Underscore">
<file>/object-cache.php</file>
</exclude>
<!-- Ignore the WPVIP long timeout sniff. -->
<exclude name="WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout">
<file>/object-cache.php</file>
</exclude>
<!-- Don't warn about uncached database calls. -->
<exclude name="WordPress.DB.DirectDatabaseQuery.NoCaching">
<file>/object-cache.php</file>
</exclude>
<exclude name="WordPress.DB.DirectDatabaseQuery.DirectQuery">
<file>/object-cache.php</file>
</exclude>
<!-- Don't error on mixed function & structure declarations for object-cache.php -->
<exclude name="Universal.Files.SeparateFunctionsFromOO.Mixed">
<file>/object-cache.php</file>
</exclude>
<exclude name="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound">
<file>/object-cache.php</file>
</exclude>
<!-- Rules we ignore for WP-CLI. -->
<!-- Function comments work differently for WP-CLI functions, so don't throw CS errors on them. -->
<exclude name="Squiz.Commenting.FunctionComment.MissingParamTag">
<file>/cli.php</file>
</exclude>
</rule>
<rule ref="PHPCompatibility"/>
<!-- Minimum PHP and WP versions -->
<config name="testVersion" value="7.3-"/>
<config name="minimum_supported_wp_version" value="4.6"/>
<exclude-pattern>*/bin/*</exclude-pattern>
<exclude-pattern>*/tests/*</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<rule ref="WordPress.PHP.DevelopmentFunctions">
<properties>
<property name="exclude" value="error_log" />
</properties>
</rule>
<rule ref="WordPress.PHP.DevelopmentFunctions.error_log_error_log">
<exclude-pattern>*/tests/phpunit/bootstrap.php</exclude-pattern>
</rule>
<rule ref="WordPress.PHP.DiscouragedPHPFunctions">
<properties>
<property name="exclude" type="array" value="serialize,unserialize" />
</properties>
</rule>
<rule ref="WordPress.Files.FileName">
<properties>
<property name="strict_class_file_names" value="false" />
</properties>
</rule>
</ruleset>