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

PHP 8.4 Compatibility #5946

Open
swissspidy opened this issue May 6, 2024 · 0 comments
Open

PHP 8.4 Compatibility #5946

swissspidy opened this issue May 6, 2024 · 0 comments

Comments

@swissspidy
Copy link
Member

swissspidy commented May 6, 2024

This is a general tracking issue for PHP 8.4 compatibility throughout WP-CLI.

Some known issues / blockers:

Broken unit/Behat tests

Unit tests and Behat tests are currently not working on PHP 8.4 due to the bundled Requests v1 triggering an error:

Update: looks like this was fixed in PHP 8.4, so there is no longer any fatal error.

Details
TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_HEADERFUNCTION, no array or string given

/home/runner/work/wp-cli/wp-cli/bundle/rmccue/requests/src/Transport/Curl.php:223
/home/runner/work/wp-cli/wp-cli/bundle/rmccue/requests/src/Requests.php:469

Maybe a good time to migrate to Requests v2?

This is also an issue in v2 though:

TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_HEADERFUNCTION, no array or string given

/tmp/wordpress/wp-includes/Requests/src/Transport/Curl.php:223
/tmp/wordpress/wp-includes/Requests/src/Requests.php:469

So this needs to get fixed in https://github.com/WordPress/Requests

Related:

Deprecation notices in Composer

Some examples:

Deprecation Notice: Composer\Pcre\Preg::replace(): Implicitly marking parameter $count as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/bin/composer/vendor/composer/pcre/src/Preg.php:150
Deprecation Notice: Composer\Pcre\Preg::replaceCallback(): Implicitly marking parameter $count as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/bin/composer/vendor/composer/pcre/src/Preg.php:177
Deprecation Notice: Composer\Pcre\Preg::replaceCallbackArray(): Implicitly marking parameter $count as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/bin/composer/vendor/composer/pcre/src/Preg.php:207
Deprecation Notice: JsonSchema\Constraints\BaseConstraint::__construct(): Implicitly marking parameter $factory as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php:41
Deprecation Notice: JsonSchema\Constraints\BaseConstraint::addError(): Implicitly marking parameter $path as nullable is deprecated, the explicit nullable type must be used instead in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/BaseConstraint.php:46

Question is whether those are only shown during development or also when using wp package *.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants