Skip to content

Conversation

@agibson-godaddy
Copy link
Contributor

@agibson-godaddy agibson-godaddy commented Sep 25, 2025

Summary

Replacement for #784

This updates method signatures to explicitly mark parameters as nullable, where previously they were implicitly declared as such. This addresses deprecation warnings in PHP 8.4+.

Story: MWC-18270

Release: #787(release PR)

Details

Additional details to expand on the summary, if needed

QA

  • Code review

Before merge

  • I have confirmed these changes in each supported minor WooCommerce version

@agibson-godaddy agibson-godaddy self-assigned this Sep 25, 2025
@agibson-godaddy agibson-godaddy changed the title Mwc 18270 v2 Explicitly mark parameters as nullable Sep 25, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses PHP 8.4+ deprecation warnings by explicitly marking nullable parameters in method signatures throughout the WooCommerce payment gateway framework. PHP 8.4 deprecated the implicit nullable parameter syntax and now requires explicit ? notation for nullable parameters.

  • Updates method signatures to use explicit nullable syntax (?Type instead of Type = null)
  • Adds corresponding PHPDoc updates to reflect nullable parameter types
  • Updates changelog to document the PHP 8.4 compatibility improvement

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
class-sv-wc-payment-gateway-payment-tokens-handler.php Updates get_token_by_core_id method to explicitly mark $environment_id as nullable
class-sv-wc-payment-gateway.php Updates credit card charge and authorization methods to explicitly mark $order parameters as nullable
class-sv-wc-payment-gateway-my-payment-methods.php Updates get_payment_method_default_html method to explicitly mark $token parameter as nullable
class-sv-wc-payment-gateway-direct.php Updates do_add_payment_method_transaction method to explicitly mark $response parameter as nullable
Abstract_Payment_Handler.php Updates multiple order processing methods to explicitly mark response parameters as nullable
Abstract_Hosted_Payment_Handler.php Updates transaction response handling methods to explicitly mark order and response parameters as nullable
changelog.txt Documents the PHP 8.4 compatibility improvement

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@agibson-godaddy agibson-godaddy merged commit 91f4801 into release/6.0.0 Sep 25, 2025
5 checks passed
@agibson-godaddy agibson-godaddy deleted the mwc-18270-v2 branch September 25, 2025 11:57
@agibson-godaddy agibson-godaddy mentioned this pull request Sep 25, 2025
5 tasks
@peterwilsoncc peterwilsoncc mentioned this pull request Oct 13, 2025
2 tasks
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

Successfully merging this pull request may close these issues.

2 participants