Skip to content

Fix PSR-7 v2.0 compatibility for systems shipping psr/http-message 2.0 - #79

Merged
Peterburnett merged 1 commit into
catalyst:masterfrom
hdagheda:fix/psr7-v2-compatibility
Jul 14, 2026
Merged

Fix PSR-7 v2.0 compatibility for systems shipping psr/http-message 2.0#79
Peterburnett merged 1 commit into
catalyst:masterfrom
hdagheda:fix/psr7-v2-compatibility

Conversation

@hdagheda

Copy link
Copy Markdown
Contributor

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

@hdagheda
hdagheda force-pushed the fix/psr7-v2-compatibility branch 4 times, most recently from a0b3c3f to 5b0488b Compare July 13, 2026 01:33
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
hdagheda force-pushed the fix/psr7-v2-compatibility branch from 5b0488b to 7a7ba3a Compare July 13, 2026 01:46
@Peterburnett
Peterburnett merged commit 81e4b30 into catalyst:master Jul 14, 2026
20 checks passed
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.

Incompatible with psr/http-message 2.0 (PHP 8.2+ / Moodle 4.x / Totara 20)

2 participants