[TASK] Use magic __CLASS__ in getInstance()-methods 41/22741/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 1 Aug 2013 01:20:23 +0000 (03:20 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 6 Aug 2013 17:23:28 +0000 (19:23 +0200)
Some classes contain static getInstance()-methods that return
an instance of themselves. Instead of using the correct namespace
and classname everywhere, just use __CLASS__.

Change-Id: I22770505acded0c54b07dd0e239976ad01fdf893
Resolves: #50615
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22741
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Category/CategoryRegistry.php
typo3/sysext/core/Classes/Resource/ResourceFactory.php
typo3/sysext/form/Classes/Utility/FormUtility.php
typo3/sysext/workspaces/Classes/Hook/BackendUtilityHook.php

index 4b85152..3b77ba8 100644 (file)
@@ -50,7 +50,7 @@ class CategoryRegistry implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Core\Category\CategoryRegistry
         */
        static public function getInstance() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Category\\CategoryRegistry');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(__CLASS__);
        }
 
        /**
index 2401a9a..60af183 100644 (file)
@@ -46,7 +46,7 @@ class ResourceFactory implements \TYPO3\CMS\Core\SingletonInterface {
         * @return ResourceFactory
         */
        static public function getInstance() {
-               return GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
+               return GeneralUtility::makeInstance(__CLASS__);
        }
 
        /**
@@ -535,4 +535,4 @@ class ResourceFactory implements \TYPO3\CMS\Core\SingletonInterface {
 }
 
 
-?>
\ No newline at end of file
+?>
index 3ca6179..e860a56 100644 (file)
@@ -42,7 +42,7 @@ class FormUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Form\Utility\FormUtility
         */
        static public function getInstance() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Utility\\FormUtility');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(__CLASS__);
        }
 
        /**
index b832454..6ed43e4 100644 (file)
@@ -39,7 +39,7 @@ class BackendUtilityHook implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Workspaces\Hook\BackendUtilityHook
         */
        static public function getInstance() {
-               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook');
+               return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(__CLASS__);
        }
 
        /**