Explicitly mark parameters as nullable#788
Merged
agibson-godaddy merged 2 commits intorelease/6.0.0from Sep 25, 2025
Merged
Conversation
1 task
Contributor
There was a problem hiding this comment.
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 (
?Typeinstead ofType = 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
added a commit
that referenced
this pull request
Dec 1, 2025
* Version 6.0.0 * Fix PHP 8.2 deprecation warnings caused by dynamic properties on the $order object (#786) * Add Dynamic_Props class to store dynamic properties for order object. * Replace dynamic props usage with Dynamic_Props class. * Minor doc updates. * Docs improvements. * Update namespace to use v6_0_0 * Added "sv_wc_plugin_framework_use_dynamic_props_class" filter to make use of Dynamic_Props class opt-in only. * Add OrderHelper Class to simplify property get/set on order object. * Update OrderHelper methods to follow the WP case. * Explicitly mark parameters as nullable (#788) * Explicitly mark parameters as nullable * Update changelog * Update changelog * PHP compatibility fixes (#789) * Use modern default flags for htmlspecialchars(). * Remove mixed type declarations for PHP 7.4 compat. * Explicitly mark parameters as nullable. * Ignore conditional use of WeakMap. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dharmesh Patel <dspatel44@gmail.com> Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com> Co-authored-by: Ashley Gibson <agibson@godaddy.com> Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Before merge