Skip to content

Add support for Guzzle 8 - #2

Open
jtojnar wants to merge 2 commits into
php-http:initfrom
jtojnar:guzzle8
Open

Add support for Guzzle 8#2
jtojnar wants to merge 2 commits into
php-http:initfrom
jtojnar:guzzle8

Conversation

@jtojnar

@jtojnar jtojnar commented Aug 14, 2026

Copy link
Copy Markdown

This is a bit stricter but mostly compatible.

Changes affecting us involve improved type annotations and splitting out ResponseException.

https://github.com/guzzle/guzzle/releases/8.0.0

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets fixes #X, partially #Y, mentioned in #Z
Documentation if this is a new feature, link to pull request in https://github.com/php-http/documentation that adds relevant documentation
License MIT

What's in this PR?

Explain what the changes in this PR do.

Why?

Which problem does the PR fix? (remove this section if you linked an issue above)

Example Usage

// If you added new features, show examples of how to use them here
// (remove this section if not a new feature)

$foo = new Foo();

// Now we can do
$foo->doSomething();

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix
  • Documentation pull request created (if not simply a bugfix)

To Do

  • If the PR is not complete but you want to discuss the approach, list what remains to be done here

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 is a bit stricter but mostly compatible.

Changes affecting us involve improved type annotations and splitting out `ResponseException`.

https://github.com/guzzle/guzzle/releases/8.0.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.

1 participant