Review main Merged Breaking

95499[!!!][TASK] Drop SingletonInterface from DI-only classes

Benni Mack CR +2 V +2 Hard +164 −107 updated 09/01/26, 10:59

Commit message

SingletonInterface is autoconfigured with the "typo3.singleton"
tag, and SingletonPass turns every tagged service into a shared
and public one, so GeneralUtility::makeInstance() can still reach
it. Where a service is reachable without that marker, it has no
effect and is removed from:

* TYPO3\CMS\Scheduler\Scheduler
* TYPO3\CMS\Install\Service\SessionService
* TYPO3\CMS\Workspaces\Service\Dependency\CollectionService
* TYPO3\CMS\Core\PageTitle\PageTitleProviderManager
* TYPO3\CMS\Core\Resource\Processing\TaskTypeRegistry
* TYPO3\CMS\Core\Resource\Rendering\RendererRegistry
* TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry
* TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\OnlineMediaHelperRegistry
* TYPO3\CMS\Core\MetaTag\MetaTagManagerRegistry
* TYPO3\CMS\Backend\View\BackendLayout\DataProviderCollection
* TYPO3\CMS\Adminpanel\Service\ProcessedImageCollector
* TYPO3\CMS\Adminpanel\Service\ConfigurationService
* TYPO3\CMS\Core\Localization\Locales
* TYPO3\CMS\Core\Messaging\FlashMessageService
* TYPO3\CMS\Core\Cache\CacheManager
* TYPO3\CMS\Core\Console\CommandRegistry

CacheManager, CommandRegistry, FlashMessageService, Locales and
SessionService keep being registered in a ServiceProvider and
ProcessedImageCollector through the event listener pass, so they
stay public and every makeInstance() call site keeps working. The
remaining classes are only ever injected and become private.

OnlineMediaHelperRegistry keeps its makeInstance() call sites for
now: it has no constructor and reads its helpers from
TYPO3_CONF_VARS on every call, so a fresh instance behaves exactly
like the shared one.

No Core class consumes TextExtractorRegistry, only extensions do.
It would be dropped from the container as an unused private
service and is therefore declared public explicitly.

GridDataService built the CollectionService through
GeneralUtility::makeInstance() and uses constructor injection now.

The MetaPluginController test fixture picked up the
MetaTagManagerRegistry and its page title provider through
GeneralUtility::makeInstance() and would have silently received a
fresh, empty registry. It uses constructor injection now, is
declared public since user functions are resolved through
makeInstance(), and takes the request as an argument instead of
reading it from $GLOBALS.

Three unit tests substituted the CacheManager with
GeneralUtility::setSingletonInstance(), which only accepts a
SingletonInterface. Two of them use addInstance() now, the third
never resolved a CacheManager in the first place.

Five more unit test classes set up a singleton instance that the
code under test never resolved, those calls and their now unused
mocks are removed as well.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 30

Show 10 more files

Review log 812

  1. Benni Mack uploaded patch set 1 08/31/26, 21:23

  2. core-ci voted on patch set 1 V +1 08/31/26, 21:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107443

  3. Benni Mack uploaded patch set 2 V +1 09/01/26, 09:32

  4. Benni Mack marked it ready for review 09/01/26, 09:32

  5. core-ci voted on patch set 2 V +1 09/01/26, 09:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107475

  6. Benni Mack uploaded patch set 3 V +1 09/01/26, 10:07

  7. core-ci voted on patch set 3 V +1 09/01/26, 10:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107477

  8. Benni Mack updated the commit message in patch set 4 V +1 09/01/26, 10:18

  9. Garvin Hicking voted on patch set 4 CR +1 V +1 09/01/26, 10:25

  10. core-ci voted on patch set 4 V +1 09/01/26, 10:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107479

  11. Georg Ringer voted on patch set 4 CR +2 V +2 09/01/26, 10:59

  12. Georg Ringer merged patch set 5 09/01/26, 10:59