upgrade psr/log to ^3.0 and bump PHP requirement to 8.1#802
upgrade psr/log to ^3.0 and bump PHP requirement to 8.1#802commercial-hippie wants to merge 1 commit intoUltimate-Multisite:mainfrom
Conversation
- Upgrade psr/log to ^3.0 in composer.json. - Bump PHP requirement and platform config to 8.1.0 to support Symfony 6.4+ (required for PSR-3 v3 compatibility). - Upgrade mpdf/psr-log-aware-trait to ^3.0. - Update WP_Ultimo\Logger::log signature to include string|\Stringable type hint and void return type. - Update wu_log_add helper and PayPal gateway log methods to support Stringable messages.
📝 WalkthroughWalkthroughThe changes upgrade the PHP platform requirement from 7.4.1 to 8.1.0, update the PSR-3 logging dependency from version 1 to version 3, and extend logging method type annotations to formally accept Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
inc/class-logger.php (1)
252-257: Consider adding type hint to match PHPDoc.The
format_message()PHPDoc documentsstring|\Stringablefor$message, but the method signature lacks the type hint. While this works correctly (sincelog()enforces the type before calling), adding the type hint would improve consistency and provide runtime validation.♻️ Optional: Add type hint for consistency
- protected function format_message($level, $message, $context = []) { + protected function format_message($level, string|\Stringable $message, $context = []) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@inc/class-logger.php` around lines 252 - 257, The PHPDoc for format_message() declares $message as string|\Stringable but the method signature lacks a type hint; update the format_message method signature to type-hint the $message parameter accordingly (e.g., string|\Stringable $message) to match the PHPDoc and provide runtime validation, ensuring any callers like log() remain compatible with the new signature.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@inc/class-logger.php`:
- Around line 252-257: The PHPDoc for format_message() declares $message as
string|\Stringable but the method signature lacks a type hint; update the
format_message method signature to type-hint the $message parameter accordingly
(e.g., string|\Stringable $message) to match the PHPDoc and provide runtime
validation, ensuring any callers like log() remain compatible with the new
signature.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d618ea7a-46ce-4ed1-b677-d9598996d135
⛔ Files ignored due to path filters (1)
composer.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
composer.jsoninc/class-logger.phpinc/functions/helper.phpinc/gateways/class-base-paypal-gateway.phpinc/gateways/class-paypal-webhook-handler.php
|
This will make the plugin stop working on PHP 7.4 and 8.0 which we still want to support for now. A time is coming soon when we will bump the min version to PHP 8.2 |
|
All good, thanks! |
Summary by CodeRabbit