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.1 Deprecation notice: WP_Rocket\Engine\Common\Queue\RUCSSQueueRunner::__construct(): Implicitly marking parameter $store as nullable is deprecated, the explicit nullable type must be used instead #7219

Open
alfonso100 opened this issue Jan 8, 2025 · 0 comments
Milestone

Comments

@alfonso100
Copy link
Contributor

Describe the bug
A customer using PHP 8.4.1 reported the following Deprecation notices:

Deprecated WP_Rocket\Engine\Common\Queue\RUCSSQueueRunner::__construct(): Implicitly marking parameter $async_request as nullable is deprecated, the explicit nullable type must be used instead
wp-content/plugins/wp-rocket/inc/Engine/Common/Queue/RUCSSQueueRunner.php:63
Composer\Autoload\includeFile()
/var/www/html/waf/vendor/composer/ClassLoader.php:322
Composer\Autoload\ClassLoader->loadClass()
wp-content/plugins/wp-rocket/inc/Engine/Common/JobManager/Cron/Subscriber.php:93
WP_Rocket\E\C\J\C\Subscriber->initialize_rucss_queue_runner()
wp-includes/class-wp-hook.php:324
do_action('init')
wp-settings.php:704

To Reproduce
Steps to reproduce the behavior:

  1. Update to PHP 8.4.1
  2. See the deprecation notice

Expected behavior
We should update the code to prevent the deprecation notice
according to @wordpressfan :

That's a valid point that needs github issue, that deprecation was explained here: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated we just need to add ? here:

public function __construct( \ActionScheduler_Store $store = null, \ActionScheduler_FatalErrorMonitor $monitor = null, Cleaner $cleaner = null, \ActionScheduler_AsyncRequest_QueueRunner $async_request = null ) {
to be

public function __construct( ?\ActionScheduler_Store $store = null, \ActionScheduler_FatalErrorMonitor $monitor = null, Cleaner $cleaner = null, \ActionScheduler_AsyncRequest_QueueRunner $async_request = null ) {

Additional context
Ticket: https://secure.helpscout.net/conversation/2813601201/533978?viewId=2683093
Slack Thread: https://wp-media.slack.com/archives/C43T1AYMQ/p1736350050088929

@piotrbak piotrbak added this to the 3.18.1 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants