Skip to content

Allow psr/log 3 next to psr/log 2 #599

Closed

Description

@armanist

Summary

Allow psr/log 3 next to 2 (^2.0 || ^3.0), so applications that already use psr/log 3, for example through Monolog 3, can install Quantum. Part of the PHP 8.1 update (#595).

Why

composer.json requires psr/log ^2.0. Composer reports 3.0.2 as installable on PHP 8.1 but blocked by that constraint.

Widening the constraint is not enough on its own: symfony/console 5.4, which we require, declares a conflict with psr/log 3 or newer, so Composer cannot install psr/log 3 until the console moves to 6.4 (#596). This ticket therefore comes after #596. Quantum\Logger\Logger implements Psr\Log\LoggerInterface, and PHPMailer accepts any PSR-3 logger.

Current state

  • psr/log is used in 2 files under src: Logger (implements LoggerInterface) and ExceptionSeverityResolver (uses LogLevel).
  • Logger already declares : void on all level methods and log().

Proposed change

  • composer.json: "psr/log": "^2.0 || ^3.0".
  • Run the Logger tests (and the Mailer tests that use the logger) against both versions, for example with composer update psr/log --with psr/log:^3.0.
  • Mention the wider constraint in the changelog.

Depends on

Out of scope

  • psr/simple-cache 3 (its interface adds native types to every cache adapter, which is a breaking change for custom adapters).

Acceptance criteria

  • the Logger and Mailer tests pass with psr/log 2 and with psr/log 3
  • composer cs:check, composer phpstan and composer rector:check pass with both

Notes

Relevant code: composer.json, src/Logger/Logger.php.

Activity

  1. added this to the 3.1.0 milestone on Oct 23, 2026
  2. self-assigned this
    on Oct 23, 2026
  3. added 2 commits that reference this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

tech debtTechnical debt reduction

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions