Skip to content

upgrade psr/log to ^3.0 and bump PHP requirement to 8.1#802

Closed
commercial-hippie wants to merge 1 commit intoUltimate-Multisite:mainfrom
Soofos:main
Closed

upgrade psr/log to ^3.0 and bump PHP requirement to 8.1#802
commercial-hippie wants to merge 1 commit intoUltimate-Multisite:mainfrom
Soofos:main

Conversation

@commercial-hippie
Copy link
Copy Markdown
Contributor

@commercial-hippie commercial-hippie commented Apr 12, 2026

  • 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.

Summary by CodeRabbit

  • Chores
    • Upgraded minimum PHP version requirement to 8.1.0
    • Updated logging dependencies and enhanced logging system compatibility

- 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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

The 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 Stringable objects alongside strings throughout the codebase.

Changes

Cohort / File(s) Summary
Dependency & Platform Upgrade
composer.json
Updated PHP platform requirement to >=8.1.0 and upgraded psr/log to ^3.0; added mpdf/psr-log-aware-trait at ^3.0.
Core Logger Type Annotations
inc/class-logger.php
Extended add(), log(), and format_message() method signatures and PHPDoc to accept string|Stringable in place of string where applicable; \WP_Error handling preserved.
Helper Function Documentation
inc/functions/helper.php
Updated wu_log_add() PHPDoc to accept string|WP_Error|Stringable for the $message parameter; no logic changes.
Gateway Method Signatures
inc/gateways/class-base-paypal-gateway.php, inc/gateways/class-paypal-webhook-handler.php
Updated log() method type hints in both gateway classes to accept string|Stringable for $message parameter; no behavioral changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hop along, dear code, to PHP's new eight,
Stringable friends now join the logging gate,
PSR-3's third act takes the stage,
Whiskers twitch with joy at this upgrade age!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary changes: upgrading psr/log to ^3.0 and bumping PHP requirement to 8.1, which are the main objectives of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
inc/class-logger.php (1)

252-257: Consider adding type hint to match PHPDoc.

The format_message() PHPDoc documents string|\Stringable for $message, but the method signature lacks the type hint. While this works correctly (since log() 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

📥 Commits

Reviewing files that changed from the base of the PR and between 78e8f9c and f517a8f.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • composer.json
  • inc/class-logger.php
  • inc/functions/helper.php
  • inc/gateways/class-base-paypal-gateway.php
  • inc/gateways/class-paypal-webhook-handler.php

@superdav42 superdav42 added do-not-merge PR should not be merged automatically by the pulse wontfix This will not be worked on labels Apr 13, 2026
@superdav42
Copy link
Copy Markdown
Collaborator

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

@commercial-hippie
Copy link
Copy Markdown
Contributor Author

All good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge PR should not be merged automatically by the pulse wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants