Review 13.4 Merged

94991[BUGFIX] Autowire `LoggerInterface` for `inject*()` methods

Stefan Bürk CR +2 V +2 Hard +661 −118 updated 07/29/26, 14:15

Commit message

TYPO3 supports service injection via `inject*()` methods in
addition to constructor injection, as long as services are
properly configured.

Symfony DI requires a default implementation for each service.
TYPO3’s logging framework dynamically creates logger instances
per class (or channel) instead of exposing a global alias for
`\Psr\Log\LoggerInterface`. This prevents automatic wiring for
`inject*()` methods.

`AutowireInjectMethodsPass` is therefore changed to detect inject
methods requesting `LoggerInterface` and configures an
appropriate argument, respecting the Channel attribute if present.

This change adds functional tests covering constructor injection,
`LoggerAwareInterface`, and `inject*()` methods, with and without
Channel overrides.

This allows `LoggerInterface` injection via inject* methods
in abstract classes, thus not requiring constructor injection,
or LoggerAwareTrait for loggers.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 20

Review log 46

  1. Stefan Bürk uploaded patch set 1 07/29/26, 14:02

  2. Stefan Bürk updated the commit message in patch set 2 07/29/26, 14:05

  3. core-ci voted on patch set 1 V +1 07/29/26, 14:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105612

  4. core-ci voted on patch set 2 V +1 07/29/26, 14:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105614

  5. Stefan Bürk voted on patch set 2 CR +2 V +2 07/29/26, 14:15

  6. Stefan Bürk merged patch set 3 07/29/26, 14:15