-
Notifications
You must be signed in to change notification settings - Fork 85
Description
The new function get_wporg_data uses str_contains that is PHP 8 only: https://www.php.net/manual/en/function.str-contains.php
extension-command/src/Plugin_Command.php
Line 866 in 189e264
| if ( str_contains( $r_body, 'pubDate' ) ) { |
Newer versions of WordPress have a Pollyfill for this so maybe people are more accustom to using it without error:
But WP-CLI minimum supported version is WordPress 3.7
This should probably be replaced with a strpos($r_body, 'pubDate') !== false
A larger issue is that this wasn't caught by phpcs. Looking in the vendor dir for wp-cli-tests the last entry in the changelog for php-compatibility is 2019 😬
Is this because they haven't made a release since then? And all development is done on the develop branch? https://github.com/PHPCompatibility/PHPCompatibility/
I'm not really familiar with the details of how composer installs packages, but seems that something isn't catching these errors which should. Possible there are other PHP compatibility errors that aren't being caught.
I can submit a PR for this particular issue if that seems right