Add support for Guzzle 8 - #21
Conversation
We do not ignore any errors. And it is better to specify it for individual errors with custom explanation for each. If we introduce baseline, it should only contain universal errors. https://phpstan.org/user-guide/baseline
It will allow us to make some exceptions conditional.
With Guzzle 8, `TooManyRedirectsException` extends `ResponseException`,
which expects a third `$response` parameter, making PHPStan fail with:
Class GuzzleHttp\Exception\TooManyRedirectsException constructor invoked with 2 parameters, 3-4 required.
This also matches what Guzzle 7 itself does:
https://github.com/guzzle/guzzle/blob/7.10.0/src/RedirectMiddleware.php#L155
This will make it easier to notice discrepancies. Had to add some ignores to suppress errors from differences between versions.
This is a bit stricter but mostly compatible so not much reason to create a new project. Changes affecting us involve improved type annotations and splitting out `ResponseException`. https://github.com/guzzle/guzzle/releases/8.0.0
|
the pattern we thought of (and documented) is that one requires just the adapter and gets the right version of guzzle. i think we should create a new repository. however, the approach of separate repos seems weird to me now. i don't expect to have major versions of just the adapter. i think what i want to do is create just php-http/guzzle-adapter and have a branch 7.x and 8.x in there. and chosing the version is from chosing the desired adapter version. then each adapter branch supports only one guzzle version and we have no need to if checks in the code. but can still fix things in the 7.x branch if needed and merge 7.x to 8.x to have fixes in both branches. wdyt, does that sound good? |
|
One potential issue I see is when we release a hypothetical httplug 3.0, we would need to have branches |
What's in this PR?
Add support for Guzzle 8
This is a bit stricter but mostly compatible so not much reason to create a new project.
Changes affecting us involve improved type annotations and splitting out
ResponseException.https://github.com/guzzle/guzzle/releases/8.0.0
I also enable PHPStan on tests to increase certainty that it works.
Why?
Allows using HTTPlug with Guzzle 8.
Example Usage
Same as before, just install
guzzlehttp/guzzle ^8.0.0Checklist
To Do