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

Resolve PHP Deprecation Notice in PHP 8.2: Creation of dynamic property #32

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

Conversation

anthonywschmidt
Copy link
Contributor

In PHP 8.2, the creation of dynamic properties will emit a deprecation notice. For more information see https://php.watch/versions/8.2/dynamic-properties-deprecated

By default the existing behavior was a public variable so adding this public declaration is in line with existing functionality.

WePay PHP SDK Version
v0.3.1

Behavior before this change
Deprecated: Creation of dynamic property WePayRequestException::$response is deprecated in /vendor/wepay/php-sdk/wepay.php on line 370

Behavior after this change
No deprecation notice

Additional Notes
I don't see this variable used anywhere but since it was dynamically created, it was created as a public variable so other developers could have technically used this in their projects. Removing line 370 would also resolve the deprecation notice but it would break anyone currently referencing this variable. This is why I selected to use a public variable to be consistent with existing functionality.

In PHP 8.2, the creation of dynamic properties will emit a deprecation notice. For more information see https://php.watch/versions/8.2/dynamic-properties-deprecated

By default the existing behavior was a public variable so adding this public declaration is in line with existing functionality.
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.

None yet

1 participant