-
Notifications
You must be signed in to change notification settings - Fork 763
Description
I have an issue with AbstractProvider method parseResponse: GitHub
PHP docs say that the method always returns array, but it's not true.
As you can see the method throws UnexpectedValueException only if it cannot parse JSON response with a correct header or if response status code is 500. In all other cases if JSON response cannot be parsed/decoded, the method returns the original response body that is a string value.
Now if the next method that is called by my code is prepareAccessTokenResponse, then a TypeError exception is thrown, because that method accepts only arrays, and we have a clear contradiction here!
My suggestion is that parseResponse method should always re-throw UnexpectedValueException when it cannot parse/decode the response regardless of the reason (with a different message explaining the reason).