Fix PSR-7 v2.0 compatibility for systems shipping psr/http-message 2.0 - #79
Merged
Merged
Conversation
hdagheda
force-pushed
the
fix/psr7-v2-compatibility
branch
4 times, most recently
from
July 13, 2026 01:33
a0b3c3f to
5b0488b
Compare
Add return type declarations to all GuzzleHttp\Psr7 and AWS SDK stream implementations to satisfy psr/http-message 2.0 interfaces (used in Moodle 4.2+ and Totara 20). Parameter types are intentionally omitted from implementations to maintain backward compatibility with psr/http-message 1.x (Moodle 4.1 and earlier). This leverages PHP 7.4+ parameter contravariance. Fix functions_include.php guard to check describe_type instead of uri_template (removed in Guzzle 7) to prevent function redeclaration. Compatible with PHP 7.4+ and both psr/http-message 1.x and 2.x. Fixes catalyst#78
hdagheda
force-pushed
the
fix/psr7-v2-compatibility
branch
from
July 13, 2026 01:46
5b0488b to
7a7ba3a
Compare
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.
Add return type declarations to all GuzzleHttp\Psr7 classes and AWS SDK stream implementations to match psr/http-message 2.0 interfaces.
Update bundled Psr\Http\Message interfaces to v2.0.
Fix functions_include.php guard to check describe_type instead of uri_template (removed in Guzzle 7) to prevent function redeclaration.
Fixes #78