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

Add __debugInfo() magic method #403

Merged
merged 1 commit into from
Dec 20, 2017
Merged

Add __debugInfo() magic method #403

merged 1 commit into from
Dec 20, 2017

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries

Adds a __debugInfo() method to StripeObject. This is a magic method that is called by var_dump and returns the array of values that should be displayed. Returning $this->_values makes the output much more legible and avoids inadvertently leaking credentials (the secret API keys is stored in $this->_opts and displayed by default).

This is similar to what we do in other libraries, e.g. stripe-ruby or stripe-python.

@brandur-stripe
Copy link
Contributor

Good call. LGTM.

@brandur-stripe brandur-stripe merged commit dc8d5ba into master Dec 20, 2017
@brandur-stripe brandur-stripe deleted the ob-debug-info branch December 20, 2017 21:30
@brandur-stripe
Copy link
Contributor

Released as 5.8.0.

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

2 participants