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.
Description
This patch updates the PSR-7 minimum supported version to 1.1. PSR-7 1.1 adds parameter type declarations, but not return type declarations. Since parameters can be widened in implementations, and return types narrowed, our existing implementation (which already features return types) already complies.
For testing, I've pinned this to a branch of the PSR-7 integration test suite submitted as php-http/psr7-integration-tests#68. This ensures that we fulfill the changed expectations (raising either
InvalidArgumentException
ORTypeError
for invalid parameters), and will not need to update again once we prepare a v3 release of this library that explicitly adds parameter type declarations.After updating dependencies, Psalm flagged a number of issues. I corrected one that was easily corrected; the remainder are due to Psalm detecting the parent parameter type declarations and deciding we don't need to do some of our validations. Since at runtime, invalid data could still be passed to the implementation, I've pushed these into the Psalm baseline for now, and for removal once we prepare for v3 targeting PSR-7 v2.