Skip to content
Snippets Groups Projects
Commit cb355fa5 authored by Benni Mack's avatar Benni Mack
Browse files

[TASK] Do not use custom "getInstance()" methods on Singleton interfaces

There was a time when new code for TYPO3 Core was introduced
by using "MyClass::getInstance()" to act as a factory for this
class, which _would_ be OK if these classes are actually prototypes
and not services (or singleton services), as GeneralUtility::makeInstance()
or DI via Services.yaml works as well.

This change deprecates all getInstance methods around such code
with GeneralUtility::makeInstance() calls. At a later point, proper DI
can be introduced in these cases.

* TYPO3\CMS\Core\Resource\Index\ExtractorRegistry::getInstance()
* TYPO3\CMS\Core\Resource\Index\FileIndexRepository::getInstance()
* TYPO3\CMS\Core\Resource\Index\MetaDataRepository::getInstance()
* TYPO3\CMS\Core\Resource\OnlineMedia\Helpers\OnlineMediaHelperRegistry::getInstance()
* TYPO3\CMS\Core\Resource\Rendering\RendererRegistry::getInstance()
* TYPO3\CMS\Core\Resource\TextExtraction\TextExtractorRegistry::getInstance()
* TYPO3\CMS\Form\Service\TranslationService::getInstance()
* TYPO3\CMS\T3editor\Registry\AddonRegistry::getInstance()
* TYPO3\CMS\T3editor\Registry\ModeRegistry::getInstance()

Resolves: #95326
Releases: master
Change-Id: Ie3160c67792e115cf5488dc800bd717c0b913ab9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71178


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
parent beb53574
No related branches found
No related tags found
Loading
Showing
with 83 additions and 21 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment