Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP 6.5: account for new function polyfills #55

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
WP 6.5: account for new function polyfills
WP 6.5 contains a polyfill for `array_is_list`, which was introduced in PHP 8.1
  • Loading branch information
swissspidy committed Feb 5, 2024
commit 6904657ba05930f0bf3eb0d41a9983744744c49c
2 changes: 2 additions & 0 deletions PHPCompatibilityWP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* 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"/>
Expand All @@ -51,6 +52,7 @@
<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.
Expand Down
2 changes: 2 additions & 0 deletions Test/WPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ class ABC implements JsonSerializable {}
$a = str_ends_with( $haystack, $needle );

echo IMAGETYPE_WEBP, IMG_WEBP;

if (array_is_list($array)) {}