fix(deps): add PHP 8.5 compatibility patch for mpdf/psr-http-message-shim#352
fix(deps): add PHP 8.5 compatibility patch for mpdf/psr-http-message-shim#352superdav42 wants to merge 1 commit intomainfrom
Conversation
…shim - Add type declarations to Request class methods to match PSR-7 interfaces - Fixes fatal error: Declaration of getRequestTarget() must be compatible with RequestInterface::getRequestTarget(): string - Patch adds return types and parameter types for all public methods - Compatible with PHP 7.4+ (uses PHP 7.0+ type hint features) - Automatically applied via composer patches plugin
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA patch entry for the mpdf/psr-http-message-shim library is added to composer.json, enabling PHP 8 type hint compatibility through a dedicated patch file. The patch adds explicit scalar and object type declarations to the Request class public methods and return types without modifying runtime behavior. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
Summary
Problem
The
mpdf/psr-http-message-shimpackage was written for PHP 5.6 and lacks type declarations. In PHP 8.x, the PSR-7 interfaces require strict type hints, causing this fatal error:Solution
Created a comprehensive patch that adds:
:string,:array,:bool, etc.)string $header,bool $preserveHost):RequestInterface,:MessageInterface,:StreamInterface)Compatibility
Testing
Summary by CodeRabbit