Skip to content

Commit 15ca42b

Browse files
Detect use of PHP 8 functionalities
1 parent c2e2609 commit 15ca42b

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

phpcs.xml.dist

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@
55
<rule ref="PHPCompatibilityWP"/>
66
<!-- For help in understanding this testVersion:
77
https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
8-
<config name="testVersion" value="5.6-"/>
8+
<config name="testVersion" value="7.4-"/>
9+
10+
<!-- Re-enable PHP 8.0 function checks excluded by PHPCompatibilityWP.
11+
Their WP polyfills only exist in WP 5.9+, but we support WP 5.6+. -->
12+
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_containsFound">
13+
<severity>5</severity>
14+
</rule>
15+
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_starts_withFound">
16+
<severity>5</severity>
17+
</rule>
18+
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.str_ends_withFound">
19+
<severity>5</severity>
20+
</rule>
21+
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.array_key_firstFound">
22+
<severity>5</severity>
23+
</rule>
24+
<rule ref="PHPCompatibility.FunctionUse.NewFunctions.array_key_lastFound">
25+
<severity>5</severity>
26+
</rule>
927

1028
<config name="ignore_warnings_on_exit" value="1" /><!-- Ignore warnings for now. -->
1129

0 commit comments

Comments
 (0)