Commit 36085f84 authored by Wouter Wolters's avatar Wouter Wolters Committed by Christian Kuhn
Browse files

[TASK] Use fully qualified name resolution in PHP 5.5

Since PHP 5.5 is a requirement, calls with the objectManager
should use the ::class construct instead of a string argument.

Resolves: #63112
Releases: master
Change-Id: Iedbb896607adddce2b23ab67f990fa2296c0d1bb
Reviewed-on: http://review.typo3.org/34414

Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent afdb42a6
......@@ -36,14 +36,14 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\About\Domain\Model\Extension>
*/
public function findAllLoaded() {
$loadedExtensions = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage');
$loadedExtensions = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\ObjectStorage::class);
$loadedExtensionsArray = $GLOBALS['TYPO3_LOADED_EXT'];
foreach ($loadedExtensionsArray as $extensionKey => $extension) {
if ((is_array($extension) || $extension instanceof \ArrayAccess) && $extension['type'] != 'S') {
$emconfPath = PATH_site . $extension['siteRelPath'] . 'ext_emconf.php';
if (file_exists($emconfPath)) {
include $emconfPath;
$extension = $this->objectManager->get('TYPO3\\CMS\\About\\Domain\\Model\\Extension');
$extension = $this->objectManager->get(\TYPO3\CMS\About\Domain\Model\Extension::class);
$extension->setKey($extensionKey);
$extension->setTitle($EM_CONF['']['title']);
$extension->setAuthor($EM_CONF['']['author']);
......
......@@ -628,7 +628,7 @@ class LoginController {
*/
protected function getSignalSlotDispatcher() {
if (!isset($this->signalSlotDispatcher)) {
$this->signalSlotDispatcher = $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
$this->signalSlotDispatcher = $this->getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
return $this->signalSlotDispatcher;
}
......
......@@ -123,7 +123,7 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
if ($constraint === NULL) {
$constraint = $this->getConstraintFromBeUserData();
if ($constraint === NULL) {
$constraint = $this->objectManager->get('TYPO3\\CMS\\Belog\\Domain\\Model\\Constraint');
$constraint = $this->objectManager->get(\TYPO3\CMS\Belog\Domain\Model\Constraint::class);
}
} else {
$this->persistConstraintInBeUserData($constraint);
......@@ -248,7 +248,7 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
// Two meta entries: 'all' and 'live'
$workspaceArray[-99] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('any', 'Belog');
$workspaceArray[0] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('live', 'Belog');
$workspaces = $this->objectManager->get('TYPO3\\CMS\\Belog\\Domain\\Repository\\WorkspaceRepository')->findAll();
$workspaces = $this->objectManager->get(\TYPO3\CMS\Belog\Domain\Repository\WorkspaceRepository::class)->findAll();
/** @var $workspace \TYPO3\CMS\Belog\Domain\Model\Workspace */
foreach ($workspaces as $workspace) {
$workspaceArray[$workspace->getUid()] = $workspace->getUid() . ': ' . $workspace->getTitle();
......
......@@ -29,7 +29,7 @@ class HistoryEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
*/
public function initializeObject() {
/** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
$querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
$querySettings->setRespectStoragePage(FALSE);
$this->setDefaultQuerySettings($querySettings);
}
......
......@@ -36,7 +36,7 @@ class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
public function initializeObject() {
$this->beUserList = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
/** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
$defaultQuerySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
$defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
$defaultQuerySettings->setRespectStoragePage(FALSE);
$this->setDefaultQuerySettings($defaultQuerySettings);
}
......
......@@ -30,7 +30,7 @@ class WorkspaceRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
*/
public function initializeObject() {
/** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
$querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface');
$querySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
$querySettings->setRespectStoragePage(FALSE);
$this->setDefaultQuerySettings($querySettings);
}
......
......@@ -40,7 +40,7 @@ class SwitchBackUserHook {
public function switchBack($params, AbstractUserAuthentication $authentication) {
if ($this->isAHandledBackendSession($authentication)) {
$objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
$backendUserSessionRepository = $objectManager->get('TYPO3\\CMS\\Beuser\\Domain\\Repository\\BackendUserSessionRepository');
$backendUserSessionRepository = $objectManager->get(\TYPO3\CMS\Beuser\Domain\Repository\BackendUserSessionRepository::class);
$backendUserSessionRepository->switchBackToOriginalUser($authentication);
HttpUtility::redirect($GLOBALS['BACK_PATH'] . 'backend.php');
}
......
......@@ -42,7 +42,7 @@ class ModuleDataStorageService implements \TYPO3\CMS\Core\SingletonInterface {
public function loadModuleData() {
$moduleData = $GLOBALS['BE_USER']->getModuleData(self::KEY);
if (empty($moduleData) || !$moduleData) {
$moduleData = $this->objectManager->get('TYPO3\\CMS\\Beuser\\Domain\\Model\\ModuleData');
$moduleData = $this->objectManager->get(\TYPO3\CMS\Beuser\Domain\Model\ModuleData::class);
} else {
$moduleData = @unserialize($moduleData);
}
......
......@@ -347,7 +347,7 @@ class FileIndexRepository implements SingletonInterface {
* @return \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
*/
protected function getSignalSlotDispatcher() {
return $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
return $this->getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
/**
......
......@@ -156,7 +156,7 @@ class MetaDataRepository implements SingletonInterface {
* @return \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
*/
protected function getSignalSlotDispatcher() {
return $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
return $this->getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
/**
......
......@@ -2357,7 +2357,7 @@ class ResourceStorage implements ResourceStorageInterface {
*/
protected function getSignalSlotDispatcher() {
if (!isset($this->signalSlotDispatcher)) {
$this->signalSlotDispatcher = $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
$this->signalSlotDispatcher = $this->getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
return $this->signalSlotDispatcher;
}
......
......@@ -137,7 +137,7 @@ class FileProcessingService {
protected function getSignalSlotDispatcher() {
if (!isset($this->signalSlotDispatcher)) {
$this->signalSlotDispatcher = Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class)
->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
return $this->signalSlotDispatcher;
}
......
......@@ -450,7 +450,7 @@ class DatabaseTreeDataProvider extends AbstractTableConfigurationTreeDataProvide
*/
protected function getSignalSlotDispatcher() {
if (!isset($this->signalSlotDispatcher)) {
$this->signalSlotDispatcher = $this->getObjectManager()->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');
$this->signalSlotDispatcher = $this->getObjectManager()->get(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
}
return $this->signalSlotDispatcher;
}
......
......@@ -21,7 +21,7 @@ for Templates there is no lookup requirement.
As a developer or integrator, you can configure your View as follows:
::
$view = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
$view = $this->objectManager->get(\TYPO3\CMS\Fluid\View\StandaloneView::class);
$view->setFormat('html');
$view->setTemplatePathAndFileName(ExtensionManagementUtility::extPath('myExt') . 'Resources/Private/Templates/Email.html');
$view->setLayoutRootPaths(array(
......
......@@ -214,7 +214,7 @@ class PackageManager implements \TYPO3\Flow\Package\PackageManagerInterface {
return strlen($packageTwo->getPackagePath()) - strlen($packageOne->getPackagePath());
});
$className = $this->bootstrap->getObjectManager()->get('TYPO3\Flow\Reflection\ReflectionService')->getClassNameByObject($object);
$className = $this->bootstrap->getObjectManager()->get(\TYPO3\Flow\Reflection\ReflectionService::class)->getClassNameByObject($object);
$reflectedClass = new \ReflectionClass($className);
$fileName = Files::getUnixStylePath($reflectedClass->getFileName());
......@@ -559,7 +559,7 @@ class PackageManager implements \TYPO3\Flow\Package\PackageManagerInterface {
return;
}
$this->bootstrap->getObjectManager()->get('TYPO3\Flow\Reflection\ReflectionService')->freezePackageReflection($packageKey);
$this->bootstrap->getObjectManager()->get(\TYPO3\Flow\Reflection\ReflectionService::class)->freezePackageReflection($packageKey);
$this->packageStatesConfiguration['packages'][$packageKey]['frozen'] = TRUE;
$this->sortAndSavePackageStates();
......@@ -590,7 +590,7 @@ class PackageManager implements \TYPO3\Flow\Package\PackageManagerInterface {
return;
}
$this->bootstrap->getObjectManager()->get('TYPO3\Flow\Reflection\ReflectionService')->unfreezePackageReflection($packageKey);
$this->bootstrap->getObjectManager()->get(\TYPO3\Flow\Reflection\ReflectionService::class)->unfreezePackageReflection($packageKey);
unset($this->packageStatesConfiguration['packages'][$packageKey]['frozen']);
$this->sortAndSavePackageStates();
......@@ -607,7 +607,7 @@ class PackageManager implements \TYPO3\Flow\Package\PackageManagerInterface {
return;
}
$this->bootstrap->getObjectManager()->get('TYPO3\Flow\Reflection\ReflectionService')->unfreezePackageReflection($packageKey);
$this->bootstrap->getObjectManager()->get(\TYPO3\Flow\Reflection\ReflectionService::class)->unfreezePackageReflection($packageKey);
}
/**
......@@ -1025,4 +1025,4 @@ class PackageManager implements \TYPO3\Flow\Package\PackageManagerInterface {
}
}
?>
\ No newline at end of file
?>
......@@ -101,14 +101,14 @@ abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\Acti
* @return \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
*/
protected function getPersistenceManager() {
return $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\PersistenceManagerInterface');
return $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface::class);
}
/**
* @return \OliverHader\IrreTutorial\Service\QueueService
*/
protected function getQueueService() {
return $this->objectManager->get('OliverHader\\IrreTutorial\\Service\\QueueService');
return $this->objectManager->get(\OliverHader\IrreTutorial\Service\QueueService::class);
}
}
......@@ -508,7 +508,7 @@ class FunctionalTestCaseBootstrapUtility {
/** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
/** @var \TYPO3\CMS\Install\Service\SqlExpectedSchemaService $expectedSchemaService */
$expectedSchemaService = $objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
$expectedSchemaService = $objectManager->get(\TYPO3\CMS\Install\Service\SqlExpectedSchemaService::class);
// Raw concatenated ext_tables.sql and friends string
$expectedSchemaString = $expectedSchemaService->getTablesDefinitionString(TRUE);
......
......@@ -136,7 +136,7 @@ class DocumentRepository {
$icon = \TYPO3\CMS\Documentation\Utility\MiscUtility::getIcon($documentKey);
/** @var \TYPO3\CMS\Documentation\Domain\Model\Document $document */
$document = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\Document')
$document = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\Document::class)
->setPackageKey($documentKey)
->setIcon($icon);
......@@ -149,7 +149,7 @@ class DocumentRepository {
}
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation */
$documentTranslation = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\DocumentTranslation')
$documentTranslation = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation::class)
->setLanguage($language)
->setTitle($metadata['title'])
->setDescription($metadata['description']);
......@@ -179,7 +179,7 @@ class DocumentRepository {
}
if (!empty($documentFile)) {
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $documentFormat */
$documentFormat = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\DocumentFormat')
$documentFormat = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat::class)
->setFormat($format)
->setPath($formatPath . $format . '/' . $documentFile);
......@@ -213,20 +213,20 @@ class DocumentRepository {
$icon = \TYPO3\CMS\Documentation\Utility\MiscUtility::getIcon($documentKey);
/** @var \TYPO3\CMS\Documentation\Domain\Model\Document $document */
$document = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\Document')
$document = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\Document::class)
->setPackageKey($documentKey)
->setExtensionKey($extensionKey)
->setIcon($icon);
$metadata = $this->getMetadata($documentKey, $language);
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation */
$documentTranslation = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\DocumentTranslation')
$documentTranslation = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation::class)
->setLanguage($language)
->setTitle($metadata['title'])
->setDescription($metadata['description']);
/** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentFormat $documentFormat */
$documentFormat = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\DocumentFormat')
$documentFormat = $this->objectManager->get(\TYPO3\CMS\Documentation\Domain\Model\DocumentFormat::class)
->setFormat('sxw')
->setPath($path . 'manual.sxw');
......
......@@ -42,7 +42,7 @@ class ExtensionManager {
public function processActions(array $extension, array &$actions) {
if (static::$documents === NULL) {
/** @var \TYPO3\CMS\Documentation\Controller\DocumentController $documentController */
$documentController = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Controller\\DocumentController');
$documentController = $this->objectManager->get(\TYPO3\CMS\Documentation\Controller\DocumentController::class);
static::$documents = $documentController->getDocuments();
}
......@@ -53,7 +53,7 @@ class ExtensionManager {
$document = static::$documents[$documentKey];
/** @var \TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper $formatsViewHelper */
$formatsViewHelper = $this->objectManager->get('TYPO3\\CMS\\Documentation\\ViewHelpers\\FormatsViewHelper');
$formatsViewHelper = $this->objectManager->get(\TYPO3\CMS\Documentation\ViewHelpers\FormatsViewHelper::class);
foreach ($document->getTranslations() as $documentTranslation) {
$actions[] = $formatsViewHelper->render($documentTranslation);
......
......@@ -52,9 +52,9 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
*/
protected function initializeConcreteConfigurationManager() {
if ($this->environmentService->isEnvironmentInFrontendMode()) {
$this->concreteConfigurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\FrontendConfigurationManager');
$this->concreteConfigurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\FrontendConfigurationManager::class);
} else {
$this->concreteConfigurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\BackendConfigurationManager');
$this->concreteConfigurationManager = $this->objectManager->get(\TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager::class);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment