Review main Work in progress Breaking

97630[!!!][FEATURE] Support dependency injection for routing aspects

Benni Mack CR 0 V 0 Hard +646 −61 updated 11/14/26, 08:19

Commit message

Routing aspects and enhancers received their site configuration
settings as the only constructor argument, which made dependency
injection impossible.

The new SettingsAwareInterface allows aspects and enhancers to be
retrieved from the DI container, receiving their settings via
setSettings() afterwards. Implementations are autoconfigured as
public and non-shared services.

All aspects and enhancers shipped with TYPO3 are migrated, which is
breaking for subclasses overriding the constructor. Third-party
aspects and enhancers not implementing the interface still receive
their settings as constructor argument, which is deprecated.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 1
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/30/97630/1 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/30/97630/1 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 30

Issues 1

Files 32

Show 12 more files

Review log 34

  1. Benni Mack uploaded patch set 1 11/13/26, 19:43

  2. core-ci voted on patch set 1 V +1 11/13/26, 21:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114386

  3. Chris Müller commented on patch set 1 11/14/26, 08:12

    Deprecation-97150-RoutingAspectsAndEnhancersWithSettingsAsConstructorArgument.rst:67

    ```suggestion private readonly array $settings = []; ``` As the "before" example above marks the settings as readonly, this should be also the case here ;-)
  4. Chris Müller commented on patch set 1 11/14/26, 08:19

    Deprecation-97150-RoutingAspectsAndEnhancersWithSettingsAsConstructorArgument.rst:67 Reply

    Too early in the morning, ignore this... :-(