[TASK] Use name-resolution instead of strings where possible: 14 70/34870/6
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 3 Dec 2014 23:36:12 +0000 (00:36 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 5 Dec 2014 11:33:23 +0000 (12:33 +0100)
(part for extensions starting with "w")

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: I60f118a60fc1784ccd83f8f86cdbb6e60b0cfc1b
Resolves: #63477
Releases: master
Reviewed-on: http://review.typo3.org/34870
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
typo3/sysext/wizard_crpages/ext_tables.php
typo3/sysext/wizard_sortpages/ext_tables.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Service/GridDataService.php
typo3/sysext/workspaces/ext_localconf.php
typo3/sysext/workspaces/ext_tables.php

index 5d03f84..810deae 100644 (file)
@@ -134,7 +134,7 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
                                $theCode .= '<div class="checkbox"><label for="hidePagesInMenus"><input type="checkbox" name="hidePagesInMenus" id="hidePagesInMenus" value="1" />' . $GLOBALS['LANG']->getLL('wiz_newPages_hidePagesInMenus') . '</label></div>';
                                $theCode .= '<input type="submit" name="create" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_lCreate') . '" />&nbsp;<input type="reset" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_lReset') . '" /><br />';
 
-                               /** @var \TYPO3\CMS\Core\Page\PageRenderer */
+                               /** @var \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer */
                                $pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
                                $pageRenderer->loadJquery();
                                $pageRenderer->loadRequireJsModule('TYPO3/CMS/WizardCrpages/WizardCreatePages');
@@ -142,7 +142,7 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
                                $inlineJavaScriptCode = 'var tpl = "' . addslashes(str_replace(array(LF, TAB), array('', ''), $this->getFormLine('#'))) . '", i, line, div, bg, label;';
                                $pageRenderer->addJsInlineCode('wizard_crpages', $inlineJavaScriptCode);
 
-                               $pageRenderer->addCssInlineBlock('TYPO3\CMS\WizardCrpages\Controller\CreatePagesWizardModuleFunctionController', '
+                               $pageRenderer->addCssInlineBlock(__CLASS__, '
                                #formFieldContainer {float: left; margin: 0 0 10px 0;}
                                .clearLeft {clear: left;}
                                #formFieldContainer label {width: 70px; display: inline-block;}
index 34f0926..4680ed7 100644 (file)
@@ -4,7 +4,7 @@ defined('TYPO3_MODE') or die();
 if (TYPO3_MODE === 'BE') {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_func',
-               'TYPO3\\CMS\\WizardCrpages\\Controller\\CreatePagesWizardModuleFunctionController',
+               \TYPO3\CMS\WizardCrpages\Controller\CreatePagesWizardModuleFunctionController::class,
                NULL,
                'LLL:EXT:wizard_crpages/locallang.xlf:wiz_crMany'
        );
index ca98e41..5bca2f8 100644 (file)
@@ -4,7 +4,7 @@ defined('TYPO3_MODE') or die();
 if (TYPO3_MODE === 'BE') {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
                'web_func',
-               'TYPO3\\CMS\\WizardSortpages\\View\\SortPagesWizardModuleFunction',
+               \TYPO3\CMS\WizardSortpages\View\SortPagesWizardModuleFunction::class,
                NULL,
                'LLL:EXT:wizard_sortpages/locallang.xlf:wiz_sort'
        );
index 6c5fd23..2e73d1b 100644 (file)
@@ -107,9 +107,9 @@ class PreviewController extends AbstractController {
                        }
                }
                /** @var $uriBuilder \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder */
-               $uriBuilder = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
+               $uriBuilder = $this->objectManager->get(\TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::class);
                $wsSettingsPath = GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . 'typo3/';
-               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\ReviewController', 'workspaces', 'web_workspacesworkspaces');
+               $wsSettingsUri = $uriBuilder->uriFor('singleIndex', array(), \TYPO3\CMS\Workspaces\Controller\ReviewController::class, 'workspaces', 'web_workspacesworkspaces');
                $wsSettingsParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Review';
                $wsSettingsUrl = $wsSettingsPath . $wsSettingsUri . $wsSettingsParams;
                $viewDomain = BackendUtility::getViewDomain($this->pageId);
@@ -117,7 +117,7 @@ class PreviewController extends AbstractController {
                // @todo - handle new pages here
                // branchpoints are not handled anymore because this feature is not supposed anymore
                if (\TYPO3\CMS\Workspaces\Service\WorkspaceService::isNewPage($this->pageId)) {
-                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'TYPO3\\CMS\\Workspaces\\Controller\\PreviewController', 'workspaces', 'web_workspacesworkspaces');
+                       $wsNewPageUri = $uriBuilder->uriFor('newPage', array(), \TYPO3\CMS\Workspaces\Controller\PreviewController::class, 'workspaces', 'web_workspacesworkspaces');
                        $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
                        $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
                } else {
index 3219b89..2bf0556 100644 (file)
@@ -600,7 +600,7 @@ class GridDataService {
        protected function emitSignal($signalName) {
                // Arguments are always ($this, [method argument], [method argument], ...)
                $signalArguments = array_merge(array($this), array_slice(func_get_args(), 1));
-               $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Workspaces\\Service\\GridDataService', $signalName, $signalArguments);
+               $this->getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Workspaces\Service\GridDataService::class, $signalName, $signalArguments);
        }
 
        /**
index 61166e1..8b6a4dc 100644 (file)
@@ -2,23 +2,23 @@
 defined('TYPO3_MODE') or die();
 
 // Register the autopublishing task
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Workspaces\\Task\\AutoPublishTask'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Workspaces\Task\AutoPublishTask::class] = array(
        'extension' => $_EXTKEY,
        'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf:autopublishTask.name',
        'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf:autopublishTask.description'
 );
 
 // Register the cleanup preview links task
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Workspaces\\Task\\CleanupPreviewLinkTask'] = array(
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Workspaces\Task\CleanupPreviewLinkTask::class] = array(
        'extension' => $_EXTKEY,
        'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf:cleanupPreviewLinkTask.name',
        'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang_mod.xlf:cleanupPreviewLinkTask.description'
 );
 
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = 'TYPO3\\CMS\\Workspaces\\Hook\\DataHandlerHook';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'TYPO3\\CMS\\Workspaces\\Hook\\TypoScriptFrontendControllerHook->hook_eofe';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']['workspaces'] = 'TYPO3\\CMS\\Workspaces\\Hook\\BackendUtilityHook->makeEditForm_accessCheck';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processCmdmapClass']['workspaces'] = \TYPO3\CMS\Workspaces\Hook\DataHandlerHook::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = \TYPO3\CMS\Workspaces\Hook\BackendUtilityHook::class;
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = \TYPO3\CMS\Workspaces\Hook\TypoScriptFrontendControllerHook::class . '->hook_eofe';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']['workspaces'] = \TYPO3\CMS\Workspaces\Hook\BackendUtilityHook::class . '->makeEditForm_accessCheck';
 
 // Register workspaces cache if not already done in localconf.php or a previously loaded extension.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache'])) {
@@ -30,7 +30,7 @@ if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations
 if (TYPO3_MODE === 'BE') {
        // If publishing/swapping dependent parent-child references, consider all parents and children
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addUserTSConfig('options.workspaces.considerReferences = 1');
-       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'][] = 'TYPO3\\CMS\\Workspaces\\ExtDirect\\PagetreeCollectionsProcessor';
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/tree/pagetree/class.t3lib_tree_pagetree_dataprovider.php']['postProcessCollections'][] = \TYPO3\CMS\Workspaces\ExtDirect\PagetreeCollectionsProcessor::class;
 
-       $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'][] = 'TYPO3\\CMS\\Workspaces\\Backend\\ToolbarItems\\WorkspaceSelectorToolbarItem';
+       $GLOBALS['TYPO3_CONF_VARS']['BE']['toolbarItems'][] = \TYPO3\CMS\Workspaces\Backend\ToolbarItems\WorkspaceSelectorToolbarItem::class;
 }
index 3d088bf..d5a8050 100644 (file)
@@ -25,24 +25,24 @@ if (TYPO3_MODE === 'BE' && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_INSTALL)) {
        // register ExtDirect
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
                'TYPO3.Workspaces.ExtDirect',
-               'TYPO3\\CMS\\Workspaces\\ExtDirect\\ExtDirectServer',
+               \TYPO3\CMS\Workspaces\ExtDirect\ExtDirectServer::class,
                'web_WorkspacesWorkspaces',
                'user,group'
        );
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
                'TYPO3.Workspaces.ExtDirectActions',
-               'TYPO3\\CMS\\Workspaces\\ExtDirect\\ActionHandler',
+               \TYPO3\CMS\Workspaces\ExtDirect\ActionHandler::class,
                'web_WorkspacesWorkspaces',
                'user,group'
        );
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent(
                'TYPO3.Workspaces.ExtDirectMassActions',
-               'TYPO3\\CMS\\Workspaces\\ExtDirect\\MassActionHandler',
+               \TYPO3\CMS\Workspaces\ExtDirect\MassActionHandler::class,
                'web_WorkspacesWorkspaces',
                'user,group'
        );
 
-       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('Workspaces::setWorkspace', 'TYPO3\\CMS\\Workspaces\\Controller\\AjaxController->setWorkspace');
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerAjaxHandler('Workspaces::setWorkspace', \TYPO3\CMS\Workspaces\Controller\AjaxController::class . '->setWorkspace');
 }
 
 // todo move icons to Core sprite or keep them here and remove the todo note ;)