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.
This PR addresses deprecation warnings in PHP 8.2 regarding the creation of dynamic properties in the AbstractGateway class used in the btcpay-greenfield-for-woocommerce plugin. Problem:
PHP 8.2 introduced deprecation warnings for the creation of dynamic properties in objects that do not explicitly define them. In the AbstractGateway class, the properties $debug_php_version and $debug_plugin_version were being dynamically added in the constructor, which causes the following warning:
Creation of dynamic property BTCPayServer\WC\Gateway\DefaultGateway::$debug_plugin_version is deprecated.
Added explicit class properties for $debug_php_version and $debug_plugin_version to prevent PHP 8.2 from issuing deprecation warnings. The properties are declared as protected and their values are initialized in the constructor, as they were previously.
This change is backward-compatible and does not affect the functionality of the plugin. It simply removes the deprecation warnings in PHP 8.2 and ensures compatibility with future PHP releases.