Review main Merged Breaking

97531[!!!][TASK] Drop SingletonInterface from remaining core registries

Benni Mack CR +2 V +2 Normal +57 −24 updated 11/11/26, 13:12

Commit message

Follow-up to #110578. SingletonInterface only turns a class into a
shared and public service, so GeneralUtility::makeInstance() can
reach it. Sharing is the container default anyway, so the marker is
removed from:

* TYPO3\CMS\Core\Registry
* TYPO3\CMS\Core\Imaging\IconRegistry
* TYPO3\CMS\Core\Page\ImportMapFactory
* TYPO3\CMS\Core\Resource\Collection\FileCollectionRegistry
* TYPO3\CMS\Core\Resource\Driver\DriverRegistry
* TYPO3\CMS\Core\Html\DefaultSanitizerBuilder
* TYPO3\CMS\Core\Html\PreviewSanitizerBuilder
* TYPO3\CMS\Core\Routing\SiteMatcher
* TYPO3\CMS\Core\Session\SessionManager
* TYPO3\CMS\Form\Slot\FilePersistenceSlot
* TYPO3\CMS\Form\Slot\ResourcePublicationSlot

Registry, FileCollectionRegistry, DriverRegistry, SiteMatcher,
SessionManager and both sanitizer builders are fetched by class
name, through makeInstance() in Core and extensions, or as
"htmlSanitize.build" for the builders. They are declared public
explicitly instead of relying on the marker as a side effect.
IconRegistry and ImportMapFactory stay public through their
ServiceProvider registration, the form slots through the event
listener pass.

Custom sanitizer builders extending DefaultSanitizerBuilder lost the
inherited marker as well and are not shared anymore unless they are
declared public themselves.

TcaItemsProcessorFunctionsTest substituted the IconRegistry via
setSingletonInstance(), which only accepts SingletonInterface
instances. It replaces the service in the container now, and
populateCustomPermissionOptionsTest, which depends on the stub,
hands it to the subject through the constructor.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Benni Mack +2
    • Georg Ringer +1
    • Oliver Klee +1
    • core-ci +1 CI

Issues 2

Files 13

Review log 67

  1. Benni Mack uploaded patch set 1 11/11/26, 07:26

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

  3. Benni Mack marked it ready for review 11/11/26, 11:23

  4. Oliver Klee voted on patch set 1 CR +1 V +1 11/11/26, 11:53

  5. Georg Ringer voted on patch set 1 CR +1 V +1 11/11/26, 11:58

  6. Benni Mack voted on patch set 1 CR +2 V +2 11/11/26, 13:11

  7. Benni Mack merged patch set 2 11/11/26, 13:12