-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathphpcs-compat.xml.dist
More file actions
65 lines (58 loc) · 3.6 KB
/
phpcs-compat.xml.dist
File metadata and controls
65 lines (58 loc) · 3.6 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCompatibilityWP" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
<description>WordPress specific ruleset which checks for PHP cross version compatibility.</description>
<!-- Once PHPCompatibility/PHPCompatibilityWP supports the targeted versions of PHP, this config file can be updated accordingly. -->
<!-- Test PHP 7.4 thru 8.4 -->
<config name="testVersion" value="7.4-8.4"/>
<file>.</file>
<arg name="extensions" value="php,inc" />
<rule ref="PHPCompatibility">
<!--
Contained in /wp-includes/compat.php.
History of the polyfills in WP:
* hash_hmac(): since WP 3.2.0.
* json_encode() and json_decode(): since unknown.
* hash_equals(): since WP 3.9.2.
* JSON_PRETTY_PRINT: since WP 4.1.0.
* json_last_error_msg(): since WP 4.4.0.
* JsonSerializable: since WP 4.4.0.
* array_replace_recursive(): since WP 4.5.3 up to 5.2.x. The polyfill was removed in WP 5.3.
* is_iterable(): since WP 4.9.6
* is_countable(): since WP 4.9.6
* IMAGETYPE_WEBP and IMG_WEBP: since WP 5.8.0.
* array_key_first(): since WP 5.9.0
* array_key_last(): since WP 5.9.0
* str_contains(): since WP 5.9.0
* str_starts_with(): since WP 5.9.0
* str_ends_with(): since WP 5.9.0
* array_is_list(): since WP 6.5.0
-->
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_hmacFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_encodeFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_decodeFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_equalsFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.json_pretty_printFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_last_error_msgFound"/>
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.jsonserializableFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_replace_recursiveFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.is_iterableFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.is_countableFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.imagetype_webpFound"/>
<exclude name="PHPCompatibility.Constants.NewConstants.img_webpFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_key_firstFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_key_lastFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_is_listFound"/>
<!--
Contained in /wp-includes/spl-autoload-compat.php.
History of the polyfills in WP:
* spl_autoload_register(), spl_autoload_unregister() and spl_autoload_functions() were
introduced in WP 4.6.0 and available up to WP 5.2.x. The polyfills were removed in WP 5.3.
-->
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_registerFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_unregisterFound"/>
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_autoload_functionsFound"/>
</rule>
</ruleset>