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

Allow CaseInsensitiveArray to be traversed #735

Closed
pbowyer opened this issue Sep 13, 2019 · 2 comments · Fixed by #736
Closed

Allow CaseInsensitiveArray to be traversed #735

pbowyer opened this issue Sep 13, 2019 · 2 comments · Fixed by #736
Assignees

Comments

@pbowyer
Copy link

pbowyer commented Sep 13, 2019

Stripe's exceptions return a lot of extra information about the HTTP request, which is awesome when debugging problems.

The HTTP Headers are held in a Stripe\Util\CaseInsensitiveArray collection. This makes it easy to get individual headers, but there's no way to get all of them, either via a ->all() method or by iterating:

foreach ($exception->getHttpHeaders() as $k => $v) {
   // This is never entered
}

When handling the exception I would like to record all headers, so getting them would be very handy.

@ob-stripe
Copy link
Contributor

Hi @pbowyer, thanks for the suggestion! We just released stripe-php 7.1.0. CaseInsensitiveArray is now countable and traversable.

@pbowyer
Copy link
Author

pbowyer commented Sep 13, 2019

Brilliant, 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 a pull request may close this issue.

2 participants