fix wrong type send to withHeader PSR response method - #79
Merged
Conversation
This comment was marked as spam.
This comment was marked as spam.
|
Yes this is polluting my logs at the moment! Would love to see it merged. |
clue
requested changes
Jul 27, 2026
clue
left a comment
Member
There was a problem hiding this comment.
@Triplkrypl Thanks for the fix, PSR-7 documents string|string[] for header values, so passing the string is the right call.
The same applies to ClientNegotiator, which hands getVersion() to withHeader() the same way. Mind covering that one too so this is complete?
Note this only shows up with guzzle, other PSR-7 implementations coerce it silently. Not a fan of how this is handled, but guzzle 3.0 now throws outright and it is common enough that we should pass a string.
clue
approved these changes
Jul 28, 2026
clue
left a comment
Member
There was a problem hiding this comment.
@Triplkrypl Thanks for the update, changes LGTM! ![]()
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.
Type
intfromgetVersionNumberis not compatible with PSR interface method parameter with typestring|array<string>.Guzzle PSR-7 implementation start triggering deprecated error: https://github.com/guzzle/psr7/blob/640e2897bbee822dbc8af761d49e1a29b1f2a6b1/src/MessageTrait.php#L93.
I highly recommend you start using https://phpstan.org/ or https://psalm.dev/ dev tool to automatically detect errors like this.