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

Update AbstractGateway.php #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

warioishere
Copy link

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.

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.
@ndeet
Copy link
Collaborator

ndeet commented Nov 22, 2024

Hey @warioishere thanks and sorry for the late reply, did miss the notification for it and not check in here for a while. Good catch, not sure why the diff is so weird as you seem to have the same identation, do you maybe have tabs instead of spaces? We use 4 spaces indentation here. The diff should only show the two new properties, you can also remove the comment above them about the deprecation warning.

Can you please try to update the PR otherwise I will merge and fix indentation myself. Thank you.

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