Use the response factory instead of Guzzle for error response - #80
Merged
Merged
Conversation
clue
requested changes
Jul 27, 2026
clue
left a comment
Member
There was a problem hiding this comment.
@mbabker Thanks for tracking this down, fix looks right to me.
This finishes off #34 which converted the other branches to the PSR-17 factory but missed this one after catching up with #23.
Could you add a test for it before we merge? That branch has no coverage today, and because the suite injects Guzzle's own HttpFactory a plain status assertion passes either way, so it has to assert the factory is actually used. This goes red on master and green with your change:
$responseFactory = $this->createMock(ResponseFactoryInterface::class);
$responseFactory->expects($this->exactly(2))
->method('createResponse')
->willReturnOnConsecutiveCalls(
(new HttpFactory())->createResponse(),
(new HttpFactory())->createResponse(400, 'server_max_window_bits must have a value between 8 and 15.')
);paired with a request carrying Sec-WebSocket-Extensions: permessage-deflate; server_max_window_bits=99.
mbabker
force-pushed
the
fix-incorrect-dev-dependency
branch
from
July 27, 2026 12:30
84a1df8 to
3981ec5
Compare
Contributor
Author
|
Tests updated |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This package declares
guzzlehttp/psr7as a dev-only dependency, yet, theRatchet\RFC6455\Handshake\ServerNegotiatorclass is directly using it in an error handling branch to create a new response. This PR replaces the incorrect use of the dev-only dependency with the response factory in this code branch.