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

PHP 7.2 Warnings #587

Closed
scofennell opened this issue Jan 24, 2019 · 2 comments · Fixed by #552
Closed

PHP 7.2 Warnings #587

scofennell opened this issue Jan 24, 2019 · 2 comments · Fixed by #552
Labels

Comments

@scofennell
Copy link

Hi, I when I use WP-Enginge's php 7.2 Compatibility Checker (https://wordpress.org/plugins/php-compatibility-checker/), get the following warnings:

FILE: /nas/content/staging/lxbplatform/wp-content/plugins/lxb-account/lib/stripe/lib/StripeObject.php\
---------------------------------------------------------------------------------------------------------------------------------------------------------\
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES\
---------------------------------------------------------------------------------------------------------------------------------------------------------\
 293 | WARNING | Method name "StripeObject::__toJSON" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.\
 308 | WARNING | Method name "StripeObject::__toArray" is discouraged; PHP has reserved all method names with a double underscore prefix for future use.\
---------------------------------------------------------------------------------------------------------------------------------------------------------\
@ob-stripe
Copy link
Contributor

Hi @scofennell, thanks for the report.

This is a dupe of #558, but I think maybe we should rename the methods -- neither __toJSON nor __toArray are real magic methods, we just reused the naming convention.

This would be a breaking change though since some users may be relying on these methods in their integrations, so it would have to be done in the next major version. I'll tag this issue as future so that it stays on our radar.

@ob-stripe
Copy link
Contributor

This is fixed in stripe-php 7.0.0. __toJSON has been renamed to toJSON and __toArray has been renamed to toArray.

Additionally, toArray no longer takes any parameters -- the conversion is always done recursively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants