platformsh / platformsh-client-php

Platform.sh API client for PHP
https://platform.sh
MIT License
25 stars 27 forks source link

Bug/guzzle exception #53

Closed gilzow closed 2 years ago

gilzow commented 3 years ago

Updates declaration of ApiResourceBase::create to match parent GuzzleHttp\Exception\GuzzleException::create

gilzow commented 3 years ago

OH, now I see what's happening. You're requiring guzzle as "guzzlehttp/guzzle": "^6.3 || ^7.0", Between the 6.x branch of guzzle and the 7.x branch the method signature for GuzzleHttp\Exception\GuzzleException::create changed. Something in php7.3 is causing composer to choose the 6.x branch of guzzle instead of the 7.x branch

gilzow commented 3 years ago

I went back and test in a php7.3, and php7.2 and in neither of those did it switch to the 6.x version of guzzle. It wasn't until I tested in a php7.1 environment that it changed to v6.5.5 of guzzle because v7.x requires php7.2.5 or greater.

Not sure why the travis tests for php7.3 and php7.2 are switching to the 6.x version of guzzle

pjcdawkins commented 3 years ago

The ApiResponseException class doesn't make much sense, although the extra error details are useful especially for older Guzzle versions.

It says it "wraps" the Guzzle exceptions but it doesn't really, it returns an exception of the original class (so type hints have to be on Guzzle's RequestException or the GuzzleException interface, both of which are a bit messy in their own ways).

It looks like we have to stop overriding create() and do something else, which seems like it won't break anything code-wise at least because the parent method will still be there.