Skip to content

tests: Add missing response to exception - #23

Merged
dbu merged 1 commit into
php-http:1.xfrom
jtojnar:redirects-test-fix
Aug 20, 2026
Merged

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

Conversation

@jtojnar

@jtojnar jtojnar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor
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
@dbu
dbu merged commit a036346 into php-http:1.x Aug 20, 2026
10 of 12 checks passed
@jtojnar
jtojnar deleted the redirects-test-fix branch August 20, 2026 10:36
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.

2 participants