[TASK] Use name-resolution instead of strings where possible: 13 69/34869/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 1 Dec 2014 13:20:19 +0000 (14:20 +0100)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Fri, 5 Dec 2014 11:35:40 +0000 (12:35 +0100)
(part for extensions starting with "t")

Use name-resolution with ...::class instead of strings where
possible.
(needs PHP 5.5, which is meanwhile required for master)

Change-set Iedbb896607adddce2b23ab67f990fa2296c0d1bb
first introduced usage of ::class in master. We now add it
in various more places.

Change-Id: I2201123b7b2d888a1d90916e81027fd6bf490651
Resolves: #63477
Releases: master
Reviewed-on: http://review.typo3.org/34869
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/t3editor/Configuration/TCA/Overrides/tt_content.php
typo3/sysext/t3editor/ext_localconf.php
typo3/sysext/t3editor/ext_tables.php
typo3/sysext/t3skin/ext_localconf.php
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/taskcenter/ext_tables.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/tstemplate/ext_tables.php

index b565c2c..12f9311 100644 (file)
@@ -5,7 +5,7 @@ defined('TYPO3_MODE') or die();
 $GLOBALS['TCA']['tt_content']['columns']['bodytext']['config']['wizards']['t3editor'] = array(
        'enableByTypeConfig' => 1,
        'type' => 'userFunc',
-       'userFunc' => 'TYPO3\\CMS\\T3editor\\FormWizard->main',
+       'userFunc' => \TYPO3\CMS\T3editor\FormWizard::class . '->main',
        'title' => 't3editor',
        'icon' => 'wizard_table.gif',
        'module' => array(
index 8739b7d..7a98a3c 100644 (file)
@@ -3,11 +3,11 @@ defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE == 'BE') {
        // Register hooks for tstemplate module
-       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = 'TYPO3\\CMS\\T3editor\\Hook\\TypoScriptTemplateInfoHook->preStartPageHook';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'][] = 'TYPO3\\CMS\\T3editor\\Hook\\TypoScriptTemplateInfoHook->postOutputProcessingHook';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['tx_tstemplateinfo'] = 'TYPO3\\CMS\\T3editor\\Hook\\TypoScriptTemplateInfoHook->save';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['file_edit'] = 'TYPO3\\CMS\\T3editor\\Hook\\FileEditHook->save';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = 'TYPO3\\CMS\\T3editor\\Hook\\FileEditHook->preStartPageHook';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'][] = 'TYPO3\\CMS\\T3editor\\Hook\\FileEditHook->preOutputProcessingHook';
-       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'][] = 'TYPO3\\CMS\\T3editor\\Hook\\FileEditHook->postOutputProcessingHook';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->preStartPageHook';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'][] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->postOutputProcessingHook';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['tx_tstemplateinfo'] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->save';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['file_edit'] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->save';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->preStartPageHook';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'][] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->preOutputProcessingHook';
+       $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'][] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->postOutputProcessingHook';
 }
index de3facb..abe38ba 100644 (file)
@@ -3,9 +3,9 @@ defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
        // Register AJAX handlers:
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor::saveCode', 'TYPO3\\CMS\\T3editor\\T3editor->ajaxSaveCode');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor::getPlugins', 'TYPO3\\CMS\\T3editor\\T3editor->getPlugins');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor_TSrefLoader::getTypes', 'TYPO3\\CMS\\T3editor\\TypoScriptReferenceLoader->processAjaxRequest');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor_TSrefLoader::getDescription', 'TYPO3\\CMS\\T3editor\\TypoScriptReferenceLoader->processAjaxRequest');
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('CodeCompletion::loadTemplates', 'TYPO3\\CMS\\T3editor\\CodeCompletion->processAjaxRequest');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor::saveCode', \TYPO3\CMS\T3editor\T3editor::class . '->ajaxSaveCode');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor::getPlugins', \TYPO3\CMS\T3editor\T3editor::class . '->getPlugins');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor_TSrefLoader::getTypes', \TYPO3\CMS\T3editor\TypoScriptReferenceLoader::class . '->processAjaxRequest');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('T3Editor_TSrefLoader::getDescription', \TYPO3\CMS\T3editor\TypoScriptReferenceLoader::class . '->processAjaxRequest');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('CodeCompletion::loadTemplates', \TYPO3\CMS\T3editor\CodeCompletion::class . '->processAjaxRequest');
 }
index e5453f7..54f8fcb 100644 (file)
@@ -7,14 +7,14 @@ defined('TYPO3_MODE') or die();
 ');
 
 \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)->connect(
-       'TYPO3\\CMS\\Backend\\Utility\\IconUtility',
+       \TYPO3\CMS\Backend\Utility\IconUtility::class,
        'buildSpriteHtmlIconTag',
-       'TYPO3\\CMS\\T3skin\\Slot\\IconStyleModifier',
+       \TYPO3\CMS\T3skin\Slot\IconStyleModifier::class,
        'buildSpriteHtmlIconTag'
 );
 \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)->connect(
-       'TYPO3\\CMS\\Backend\\Utility\\IconUtility',
+       \TYPO3\CMS\Backend\Utility\IconUtility::class,
        'buildSpriteIconClasses',
-       'TYPO3\\CMS\\T3skin\\Slot\\IconStyleModifier',
+       \TYPO3\CMS\T3skin\Slot\IconStyleModifier::class,
        'buildSpriteIconClasses'
 );
index 8b712c0..ec76754 100644 (file)
@@ -122,7 +122,7 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                }
                        } else {
                                // Error if the task is not an instance of \TYPO3\CMS\Taskcenter\TaskInterface
-                               $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($GLOBALS['LANG']->getLL('error_no-instance', TRUE), $taskClass, 'TYPO3\\CMS\\Taskcenter\\TaskInterface'), $GLOBALS['LANG']->getLL('error_header'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
+                               $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, sprintf($GLOBALS['LANG']->getLL('error_no-instance', TRUE), $taskClass, \TYPO3\CMS\Taskcenter\TaskInterface::class), $GLOBALS['LANG']->getLL('error_header'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                                $actionContent .= $flashMessage->render();
                        }
                } else {
index 190288f..b94f38b 100644 (file)
@@ -15,11 +15,11 @@ if (TYPO3_MODE === 'BE') {
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler(
                'Taskcenter::saveCollapseState',
-               'TYPO3\\CMS\\Taskcenter\\TaskStatus->saveCollapseState'
+               \TYPO3\CMS\Taskcenter\TaskStatus::class . '->saveCollapseState'
        );
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler(
                'Taskcenter::saveSortingState',
-               'TYPO3\\CMS\\Taskcenter\\TaskStatus->saveSortingState'
+               \TYPO3\CMS\Taskcenter\TaskStatus::class . '->saveSortingState'
        );
 }
index 1e75e07..94daefb 100644 (file)
@@ -246,7 +246,7 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
                if ($this->id && $this->access) {
                        // View page
                        $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
-                       if ($this->extClassConf['name'] == 'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController') {
+                       if ($this->extClassConf['name'] == \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController::class) {
                                // NEW button
                                $urlParameters = array(
                                        'id' => $this->id,
@@ -269,10 +269,10 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
                                        $url = BackendUtility::getModuleUrl('web_ts', array('id' => $this->id));
                                        $buttons['close'] = '<a href="' . htmlspecialchars($url) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) . '">' .  IconUtility::getSpriteIcon('actions-document-close') .'</a>';
                                }
-                       } elseif ($this->extClassConf['name'] == 'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController' && count($this->MOD_MENU['constant_editor_cat'])) {
+                       } elseif ($this->extClassConf['name'] === \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController::class && count($this->MOD_MENU['constant_editor_cat'])) {
                                // SAVE button
                                $buttons['save'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' . 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" ' . 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" ' . '/>'));
-                       } elseif ($this->extClassConf['name'] == 'TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController') {
+                       } elseif ($this->extClassConf['name'] === \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController::class) {
                                if (!empty($this->sObj)) {
                                        // BACK
                                        $urlParameters = array(
@@ -336,7 +336,7 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
                if ($newStandardTemplate) {
                        // Hook to change output, implemented for statictemplates
                        if (isset(
-                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateView']
+                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class]['newStandardTemplateView']
                        )) {
                                $selector = '';
                                $staticsText = '';
@@ -345,7 +345,7 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
                                        'staticsText' => &$staticsText
                                );
                                GeneralUtility::callUserFunction(
-                                       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateView'],
+                                       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class]['newStandardTemplateView'],
                                        $reference,
                                        $this
                                );
@@ -421,14 +421,14 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
                        $recData = array();
                        // Hook to handle row data, implemented for statictemplates
                        if (isset(
-                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateHandler']
+                               $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class]['newStandardTemplateHandler']
                        )) {
                                $reference = array(
                                        'recData' => &$recData,
                                        'id' => $id,
                                );
                                GeneralUtility::callUserFunction(
-                                       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateModuleController']['newStandardTemplateHandler'],
+                                       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateModuleController::class]['newStandardTemplateHandler'],
                                        $reference,
                                        $this
                                );
index e41fa34..ffe75e5 100644 (file)
@@ -13,28 +13,28 @@ if (TYPO3_MODE === 'BE') {
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_ts',
-               'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateConstantEditorModuleFunctionController',
+               \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateConstantEditorModuleFunctionController::class,
                NULL,
                'LLL:EXT:tstemplate/ts/locallang.xlf:constantEditor'
        );
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_ts',
-               'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController',
+               \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController::class,
                NULL,
                'LLL:EXT:tstemplate/ts/locallang.xlf:infoModify'
        );
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_ts',
-               'TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateObjectBrowserModuleFunctionController',
+               \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateObjectBrowserModuleFunctionController::class,
                NULL,
                'LLL:EXT:tstemplate/ts/locallang.xlf:objectBrowser'
        );
 
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_ts',
-               'TYPO3\\CMS\\Tstemplate\\Controller\\TemplateAnalyzerModuleFunctionController',
+               \TYPO3\CMS\Tstemplate\Controller\TemplateAnalyzerModuleFunctionController::class,
                NULL,
                'LLL:EXT:tstemplate/ts/locallang.xlf:templateAnalyzer'
        );