Skip to content

tests: Add missing response to exception - #23

Open
jtojnar wants to merge 1 commit into
php-http:1.xfrom
jtojnar:redirects-test-fix
Open

tests: Add missing response to exception#23
jtojnar wants to merge 1 commit into
php-http:1.xfrom
jtojnar:redirects-test-fix

Conversation

@jtojnar

@jtojnar jtojnar commented Aug 14, 2026

Copy link
Copy Markdown
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets prevously part of #21
Documentation
License MIT

What's in this PR?

Adding $response to TooManyRedirectsException in tests.

Why?

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

Checklist

  • Updated CHANGELOG.md to describe BC breaks / deprecations | new feature | bugfix

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
@jtojnar jtojnar mentioned this pull request Aug 15, 2026
3 tasks
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