diff --git a/typo3/sysext/backend/Classes/Clipboard/Clipboard.php b/typo3/sysext/backend/Classes/Clipboard/Clipboard.php index 3282d31dba14a2745ee8b67039557948ac36dd38..7abcff50364f1b52212972bf3e5c2259c260696a 100644 --- a/typo3/sysext/backend/Classes/Clipboard/Clipboard.php +++ b/typo3/sysext/backend/Classes/Clipboard/Clipboard.php @@ -23,6 +23,9 @@ use TYPO3\CMS\Core\Database\Query\Restriction\WorkspaceRestriction; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Resource\AbstractFile; +use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException; +use TYPO3\CMS\Core\Resource\Folder; +use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; @@ -384,11 +387,11 @@ class Clipboard $fileObject = GeneralUtility::makeInstance(ResourceFactory::class)->retrieveFileOrFolderObject($v); if ($fileObject) { $thumb = []; - $folder = $fileObject instanceof \TYPO3\CMS\Core\Resource\Folder; + $folder = $fileObject instanceof Folder; $size = $folder ? '' : '(' . GeneralUtility::formatSize($fileObject->getSize()) . 'bytes)'; if (!$folder && $fileObject->isImage()) { $thumb = [ - 'image' => $fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, [])->getPublicUrl(true), + 'image' => $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, [])->getPublicUrl(true), 'title' => htmlspecialchars($fileObject->getName()) ]; } @@ -834,7 +837,7 @@ class Clipboard } else { try { GeneralUtility::makeInstance(ResourceFactory::class)->retrieveFileOrFolderObject($v); - } catch (\TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException $e) { + } catch (ResourceDoesNotExistException $e) { // The file has been deleted in the meantime, so just remove it silently unset($this->clipData[$this->current]['el'][$k]); } diff --git a/typo3/sysext/backend/Classes/Configuration/TsConfigParser.php b/typo3/sysext/backend/Classes/Configuration/TsConfigParser.php index 40a882b4112e675b685843524b35dda04f305e5f..220b5be40d56d8549ba85009f28b6c8b423296ba 100644 --- a/typo3/sysext/backend/Classes/Configuration/TsConfigParser.php +++ b/typo3/sysext/backend/Classes/Configuration/TsConfigParser.php @@ -15,7 +15,9 @@ namespace TYPO3\CMS\Backend\Configuration; +use TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher; use TYPO3\CMS\Core\Cache\CacheManager; +use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -23,7 +25,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * * @deprecated Should not be used anymore. See the PageTsConfigParser class, which has a more straightforward API. This class will be removed in TYPO3 v11.0. */ -class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser +class TsConfigParser extends TypoScriptParser { /** * @var array @@ -119,7 +121,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser protected function parseWithConditions($TSconfig) { /** @var \TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher $matchObj */ - $matchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class); + $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class); $matchObj->setRootline($this->rootLine); $matchObj->setPageId($this->id); $this->parse($TSconfig, $matchObj); @@ -140,7 +142,7 @@ class TsConfigParser extends \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser { if (is_array($cc['sections'])) { /** @var \TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher $matchObj */ - $matchObj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class); + $matchObj = GeneralUtility::makeInstance(ConditionMatcher::class); $matchObj->setRootline($this->rootLine); $matchObj->setPageId($this->id); foreach ($cc['sections'] as $key => $pre) { diff --git a/typo3/sysext/backend/Classes/ContextMenu/ContextMenu.php b/typo3/sysext/backend/Classes/ContextMenu/ContextMenu.php index f635259af9bf1eeda2a7765a733129011805614a..2bf7369bdbf3cbb5e0b7e5bcec30c849eb620e5a 100644 --- a/typo3/sysext/backend/Classes/ContextMenu/ContextMenu.php +++ b/typo3/sysext/backend/Classes/ContextMenu/ContextMenu.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\ContextMenu; +use TYPO3\CMS\Backend\ContextMenu\ItemProviders\PageProvider; +use TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -31,8 +33,8 @@ class ContextMenu * @var array */ protected $itemProviders = [ - ItemProviders\PageProvider::class, - ItemProviders\RecordProvider::class + PageProvider::class, + RecordProvider::class ]; /** diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php index 19f599578172db9873bfa8fc4664f0321f4532f0..b17a3126c9d59a2cb8c0f0f348e54f73dd11d033 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/MoveElementController.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Backend\Template\ModuleTemplate; use TYPO3\CMS\Backend\Tree\View\ContentMovingPagePositionMap; use TYPO3\CMS\Backend\Tree\View\PageMovingPagePositionMap; use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Backend\View\BackendLayoutView; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\Imaging\Icon; @@ -201,7 +202,7 @@ class MoveElementController $assigns['ttContent']['pageInfo'] = $pageInfo; $assigns['ttContent']['recordTooltip'] = BackendUtility::getRecordToolTip($pageInfo, 'pages'); $assigns['ttContent']['recordTitle'] = BackendUtility::getRecordTitle('pages', $pageInfo, true); - $colPosArray = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $this->page_id, $this); + $colPosArray = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getColPosListItemsParsed', $this->page_id, $this); $colPosIds = []; foreach ($colPosArray as $colPos) { $colPosIds[] = $colPos[1]; diff --git a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php index 0a4389b1e45b0ae71e0567c41774aabe58e89438..b72eaf22b466c2b4284a0cbdaa33cb6a4063f24d 100644 --- a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php +++ b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php @@ -734,9 +734,11 @@ class EditDocumentController } // If a preview is requested if (isset($parsedBody['_savedokview'])) { + $array_keys = array_keys($this->data); // Get the first table and id of the data array from DataHandler - $table = reset(array_keys($this->data)); - $id = reset(array_keys($this->data[$table])); + $table = reset($array_keys); + $array_keys = array_keys($this->data[$table]); + $id = reset($array_keys); if (!MathUtility::canBeInterpretedAsInteger($id)) { $id = $tce->substNEWwithIDs[$id]; } diff --git a/typo3/sysext/backend/Classes/Controller/File/ThumbnailController.php b/typo3/sysext/backend/Classes/Controller/File/ThumbnailController.php index 192fdbac58c3c23fdd2e69375f8d53d093a6442f..634ca007f2ab73161295c7d7d5a0710979bef0bf 100644 --- a/typo3/sysext/backend/Classes/Controller/File/ThumbnailController.php +++ b/typo3/sysext/backend/Classes/Controller/File/ThumbnailController.php @@ -21,6 +21,7 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Core\Http\Response; use TYPO3\CMS\Core\Imaging\IconRegistry; +use TYPO3\CMS\Core\Resource\Exception; use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Utility\ArrayUtility; @@ -52,7 +53,7 @@ class ThumbnailController $parameters['fileId'] ?? null, $parameters['configuration'] ?? [] ); - } catch (\TYPO3\CMS\Core\Resource\Exception $exception) { + } catch (Exception $exception) { // catch and handle only resource related exceptions $response = $this->generateNotFoundResponse(); } diff --git a/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php b/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php index 2cefaf491188ef986a119b6dacdb1908e8bb6d2c..13c9ed61d8f384dbde4f36c1f1065280ea4e2ab1 100644 --- a/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php +++ b/typo3/sysext/backend/Classes/Controller/Wizard/EditController.php @@ -19,6 +19,7 @@ namespace TYPO3\CMS\Backend\Controller\Wizard; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools; use TYPO3\CMS\Core\Database\RelationHandler; use TYPO3\CMS\Core\Http\HtmlResponse; @@ -118,7 +119,7 @@ class EditController extends AbstractWizardController } } - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $urlParameters = [ 'returnUrl' => (string)$uriBuilder->buildUriFromRoute('wizard_edit', ['doClose' => 1]) ]; diff --git a/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php b/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php index 79dab528276e5e2008ccca753b9c688357abfbea..afd5611d5417a2005d3692251fe35561b583f561 100644 --- a/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php +++ b/typo3/sysext/backend/Classes/Domain/Repository/Module/BackendModuleRepository.php @@ -17,18 +17,20 @@ namespace TYPO3\CMS\Backend\Domain\Repository\Module; use TYPO3\CMS\Backend\Domain\Model\Module\BackendModule; use TYPO3\CMS\Backend\Module\ModuleLoader; +use TYPO3\CMS\Backend\Module\ModuleStorage; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Imaging\IconRegistry; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Repository for backend module menu * compiles all data from $GLOBALS[TBE_MODULES] */ -class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface +class BackendModuleRepository implements SingletonInterface { /** * @var \TYPO3\CMS\Backend\Module\ModuleStorage @@ -40,7 +42,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface */ public function __construct() { - $this->moduleStorage = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Module\ModuleStorage::class); + $this->moduleStorage = GeneralUtility::makeInstance(ModuleStorage::class); $rawData = $this->getRawModuleMenuData(); @@ -152,7 +154,7 @@ class BackendModuleRepository implements \TYPO3\CMS\Core\SingletonInterface protected function createEntryFromRawData(array $module) { /** @var \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $entry */ - $entry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule::class); + $entry = GeneralUtility::makeInstance(BackendModule::class); if (!empty($module['name']) && is_string($module['name'])) { $entry->setName($module['name']); } diff --git a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php index e60cf1e8d729b3a8cb451de47c717a6217ec3bf4..9e279f71f3e186fc4baf4a844e00d07eca3faffd 100644 --- a/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php +++ b/typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php @@ -19,6 +19,7 @@ use TYPO3\CMS\Backend\Form\Element\InlineElementHookInterface; use TYPO3\CMS\Backend\Form\Exception\AccessDeniedContentEditException; use TYPO3\CMS\Backend\Form\InlineStackProcessor; use TYPO3\CMS\Backend\Form\NodeFactory; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -540,7 +541,7 @@ class InlineRecordContainer extends AbstractContainer ->execute() ->fetch(); if (!empty($recordInDatabase)) { - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $url = (string)$uriBuilder->buildUriFromRoute('record_edit', [ 'edit[sys_file_metadata][' . (int)$recordInDatabase['uid'] . ']' => 'edit', 'returnUrl' => $this->data['returnUrl'] diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php b/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php index 53af4c1b13b48ba6351a1258bbab0f1077cfed42..8769175e314839303b77f640a6bc8419c9db6a35 100644 --- a/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php +++ b/typo3/sysext/backend/Classes/Form/FieldControl/AddRecord.php @@ -18,6 +18,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\FieldControl; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -102,7 +103,7 @@ class AddRecord extends AbstractNode $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); return [ 'iconIdentifier' => 'actions-add', 'title' => $title, diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php b/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php index bfc446b6718debe838788732baf0eed88ad778cb..31e2a133935444864800cc075f21bf4e3e8ded74 100644 --- a/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php +++ b/typo3/sysext/backend/Classes/Form/FieldControl/EditPopup.php @@ -18,6 +18,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\FieldControl; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -80,7 +81,7 @@ class EditPopup extends AbstractNode 'fieldChangeFuncHash' => GeneralUtility::hmac(serialize($parameterArray['fieldChangeFunc'])), ], ]; - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $url = (string)$uriBuilder->buildUriFromRoute('wizard_edit', $urlParameters); $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php b/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php index 50cb294dccba6295b257179994cc0baeffa32273..932185bf2f952c098115e854054f801c215cc46b 100644 --- a/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php +++ b/typo3/sysext/backend/Classes/Form/FieldControl/LinkPopup.php @@ -18,6 +18,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\FieldControl; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -66,7 +67,7 @@ class LinkPopup extends AbstractNode ], ]; /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $url = (string)$uriBuilder->buildUriFromRoute('wizard_link', $urlParameters); $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php b/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php index f1ac50a825ea7f693368351d7394605bad6ef2da..2fb2555fca2bfe01b69110ec62c6721fc5916527 100644 --- a/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php +++ b/typo3/sysext/backend/Classes/Form/FieldControl/ListModule.php @@ -18,6 +18,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\FieldControl; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -88,7 +89,7 @@ class ListModule extends AbstractNode $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); return [ 'iconIdentifier' => 'actions-system-list-open', diff --git a/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php b/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php index f4eb03378ca3bc6dc41d9e9a47c415e6b34a18f7..5b9548f0c3c2626549690eeb0e94c44538921b13 100644 --- a/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php +++ b/typo3/sysext/backend/Classes/Form/FieldControl/TableWizard.php @@ -18,6 +18,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Form\FieldControl; use TYPO3\CMS\Backend\Form\AbstractNode; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\StringUtility; @@ -72,7 +73,7 @@ class TableWizard extends AbstractNode $id = StringUtility::getUniqueId('t3js-formengine-fieldcontrol-'); /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); return [ 'iconIdentifier' => 'content-table', 'title' => $title, diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php index 5406b1fce1ae5064a8a3ca3e2d4b5aef14a4ee84..a767f3f6a9df029f2af3ff412b2b0ec11bab96c9 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php @@ -33,6 +33,7 @@ use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Resource\FileRepository; +use TYPO3\CMS\Core\Resource\ResourceStorage; use TYPO3\CMS\Core\Site\SiteFinder; use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\ArrayUtility; @@ -731,7 +732,7 @@ abstract class AbstractItemProvider } $allowedStorageIds = array_map( - function (\TYPO3\CMS\Core\Resource\ResourceStorage $storage) { + function (ResourceStorage $storage) { return $storage->getUid(); }, $this->getBackendUser()->getFileStorages() @@ -1329,7 +1330,7 @@ abstract class AbstractItemProvider } $value = strlen((string)$item[1]) > 0 ? $item[1] : ''; $icon = !empty($item[2]) ? $item[2] : null; - $groupId = isset($item[3]) ? $item[3] : null; + $groupId = $item[3] ?? null; $helpText = null; if (!empty($item[4])) { if (\is_string($item[4])) { diff --git a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php index 0107b57a36ac2bf19e396fdb378640542b0d7a41..c16be2032cf1f3cbe49527f9df5fdf60d83aa872 100644 --- a/typo3/sysext/backend/Classes/Form/FormResultCompiler.php +++ b/typo3/sysext/backend/Classes/Form/FormResultCompiler.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Form; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\ArrayUtility; @@ -182,7 +183,7 @@ class FormResultCompiler { $pageRenderer = $this->getPageRenderer(); /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); // @todo: this is messy here - "additional hidden fields" should be handled elsewhere $html = implode(LF, $this->hiddenFieldAccum); diff --git a/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php b/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php index 7acb1a5a89c48a02caad450943db83db847c16fe..96210110cae0e18aee495e3ef76bf4ba481d6cd3 100644 --- a/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php +++ b/typo3/sysext/backend/Classes/FrontendBackendUserAuthentication.php @@ -91,7 +91,6 @@ class FrontendBackendUserAuthentication extends BackendUserAuthentication /** * Edit Access */ - /** * Checks whether the user has access to edit the language for the * requested record. diff --git a/typo3/sysext/backend/Classes/Module/ModuleLoader.php b/typo3/sysext/backend/Classes/Module/ModuleLoader.php index 2b7646211fe873d44b1913e317b9af587a0e415b..6bea2e21fda07f1664bb50385c664a300827f318 100644 --- a/typo3/sysext/backend/Classes/Module/ModuleLoader.php +++ b/typo3/sysext/backend/Classes/Module/ModuleLoader.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Module; +use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -156,7 +157,7 @@ class ModuleLoader // Language processing. This will add module labels and image reference to the internal ->moduleLabels array of the LANG object. $this->addLabelsForModule($name, $finalModuleConfiguration['labels'] ?? $setupInformation['labels']); /** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */ - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); if (isset($setupInformation['configuration']['routeTarget'])) { $finalModuleConfiguration['script'] = (string)$uriBuilder->buildUriFromRoute($name); } else { diff --git a/typo3/sysext/backend/Classes/Module/ModuleStorage.php b/typo3/sysext/backend/Classes/Module/ModuleStorage.php index 8cb1d2b8f2d978c45ff3753e81df5123b3bbab76..e6e016664619a9ed58e24e6d9db1388440ebe29a 100644 --- a/typo3/sysext/backend/Classes/Module/ModuleStorage.php +++ b/typo3/sysext/backend/Classes/Module/ModuleStorage.php @@ -16,11 +16,12 @@ namespace TYPO3\CMS\Backend\Module; use TYPO3\CMS\Backend\Domain\Model\Module\BackendModule; +use TYPO3\CMS\Core\SingletonInterface; /** * Model for the module storage */ -class ModuleStorage implements \TYPO3\CMS\Core\SingletonInterface +class ModuleStorage implements SingletonInterface { /** * @var \SplObjectStorage diff --git a/typo3/sysext/backend/Classes/Provider/PageTsBackendLayoutDataProvider.php b/typo3/sysext/backend/Classes/Provider/PageTsBackendLayoutDataProvider.php index 2f70b3d256ed9678fc16c0499581eb3d9e27634f..d70c015988df669b13bb1d6aec128dcbbe013714 100644 --- a/typo3/sysext/backend/Classes/Provider/PageTsBackendLayoutDataProvider.php +++ b/typo3/sysext/backend/Classes/Provider/PageTsBackendLayoutDataProvider.php @@ -20,6 +20,7 @@ use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout; use TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection; use TYPO3\CMS\Backend\View\BackendLayout\DataProviderContext; use TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface; +use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -177,7 +178,7 @@ class PageTsBackendLayoutDataProvider implements DataProviderInterface $backendLayout['title'] = $data['title'] ?: $backendLayout['uid']; $backendLayout['icon'] = $data['icon'] ?: ''; // Convert PHP array back to plain TypoScript so it can be processed - $config = \TYPO3\CMS\Core\Utility\ArrayUtility::flatten($data['config.']); + $config = ArrayUtility::flatten($data['config.']); $backendLayout['config'] = ''; foreach ($config as $row => $value) { $backendLayout['config'] .= $row . ' = ' . $value . "\r\n"; diff --git a/typo3/sysext/backend/Classes/Routing/Exception/InvalidRequestTokenException.php b/typo3/sysext/backend/Classes/Routing/Exception/InvalidRequestTokenException.php index 25119fc580d6ffdf01b884c9f1839c9206e622cb..4a8d0e381fef08f920d9159d13e4f0a3e773c05b 100644 --- a/typo3/sysext/backend/Classes/Routing/Exception/InvalidRequestTokenException.php +++ b/typo3/sysext/backend/Classes/Routing/Exception/InvalidRequestTokenException.php @@ -15,9 +15,11 @@ namespace TYPO3\CMS\Backend\Routing\Exception; +use TYPO3\CMS\Core\Exception; + /** * Exception thrown when request token was invalid */ -class InvalidRequestTokenException extends \TYPO3\CMS\Core\Exception +class InvalidRequestTokenException extends Exception { } diff --git a/typo3/sysext/backend/Classes/Routing/Exception/ResourceNotFoundException.php b/typo3/sysext/backend/Classes/Routing/Exception/ResourceNotFoundException.php index 3dff07ca6afd453165b4ef562a311db675697c6b..80fdf4182fa4180d2d16dc683f984297ddec930a 100644 --- a/typo3/sysext/backend/Classes/Routing/Exception/ResourceNotFoundException.php +++ b/typo3/sysext/backend/Classes/Routing/Exception/ResourceNotFoundException.php @@ -15,9 +15,11 @@ namespace TYPO3\CMS\Backend\Routing\Exception; +use TYPO3\CMS\Core\Exception; + /** * Exception thrown when a resource was not found. */ -class ResourceNotFoundException extends \TYPO3\CMS\Core\Exception +class ResourceNotFoundException extends Exception { } diff --git a/typo3/sysext/backend/Classes/Routing/Router.php b/typo3/sysext/backend/Classes/Routing/Router.php index 349a8001d2eddf24388b723b0116ae6cca099762..7a8520fc7055a2339a823ca9cb8f77901b86b3de 100644 --- a/typo3/sysext/backend/Classes/Routing/Router.php +++ b/typo3/sysext/backend/Classes/Routing/Router.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Routing; use Psr\Http\Message\ServerRequestInterface; use TYPO3\CMS\Backend\Routing\Exception\ResourceNotFoundException; +use TYPO3\CMS\Core\SingletonInterface; /** * Implementation of a class for adding routes, collecting throughout the Bootstrap @@ -29,7 +30,7 @@ use TYPO3\CMS\Backend\Routing\Exception\ResourceNotFoundException; * * The architecture is inspired by the Symfony Routing Component. */ -class Router implements \TYPO3\CMS\Core\SingletonInterface +class Router implements SingletonInterface { /** * All routes used in the Backend diff --git a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php index 86b129aa16fd7d0ccca8b325cd04f5cc169904b6..d09461fa1bac497e80b91e5d8d94926f60bec864 100644 --- a/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php +++ b/typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\Search\LiveSearch; use TYPO3\CMS\Backend\Routing\UriBuilder; +use TYPO3\CMS\Backend\Tree\View\PageTreeView; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\ConnectionPool; @@ -438,7 +439,7 @@ class LiveSearch */ protected function getAvailablePageIds($id, $depth) { - $tree = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class); + $tree = GeneralUtility::makeInstance(PageTreeView::class); $tree->init('AND ' . $this->userPermissions); $tree->makeHTML = 0; $tree->fieldArray = ['uid', 'php_tree_stop']; diff --git a/typo3/sysext/backend/Classes/ServiceProvider.php b/typo3/sysext/backend/Classes/ServiceProvider.php index 5a07228c55aa795165c4b1ad71dc0540bdb582ff..02ccd4f4302021b6f23d72bf7c6fe4ffd07180ba 100644 --- a/typo3/sysext/backend/Classes/ServiceProvider.php +++ b/typo3/sysext/backend/Classes/ServiceProvider.php @@ -19,6 +19,11 @@ namespace TYPO3\CMS\Backend; use ArrayObject; use Psr\Container\ContainerInterface; +use TYPO3\CMS\Backend\Http\Application; +use TYPO3\CMS\Backend\Http\RequestHandler; +use TYPO3\CMS\Backend\Http\RouteDispatcher; +use TYPO3\CMS\Backend\Routing\Route; +use TYPO3\CMS\Backend\Routing\Router; use TYPO3\CMS\Core\Cache\Exception\InvalidDataException; use TYPO3\CMS\Core\Configuration\ConfigurationManager; use TYPO3\CMS\Core\Context\Context; @@ -42,9 +47,9 @@ class ServiceProvider extends AbstractServiceProvider public function getFactories(): array { return [ - Http\Application::class => [ static::class, 'getApplication' ], - Http\RequestHandler::class => [ static::class, 'getRequestHandler' ], - Http\RouteDispatcher::class => [ static::class, 'getRouteDispatcher' ], + Application::class => [ static::class, 'getApplication' ], + RequestHandler::class => [ static::class, 'getRequestHandler' ], + RouteDispatcher::class => [ static::class, 'getRouteDispatcher' ], 'backend.middlewares' => [ static::class, 'getBackendMiddlewares' ], 'backend.routes' => [ static::class, 'getBackendRoutes' ], ]; @@ -53,32 +58,32 @@ class ServiceProvider extends AbstractServiceProvider public function getExtensions(): array { return [ - Routing\Router::class => [ static::class, 'configureBackendRouter' ], + Router::class => [ static::class, 'configureBackendRouter' ], ] + parent::getExtensions(); } - public static function getApplication(ContainerInterface $container): Http\Application + public static function getApplication(ContainerInterface $container): Application { $requestHandler = new MiddlewareDispatcher( - $container->get(Http\RequestHandler::class), + $container->get(RequestHandler::class), $container->get('backend.middlewares'), $container ); - return new Http\Application( + return new Application( $requestHandler, $container->get(ConfigurationManager::class), $container->get(Context::class) ); } - public static function getRequestHandler(ContainerInterface $container): Http\RequestHandler + public static function getRequestHandler(ContainerInterface $container): RequestHandler { - return new Http\RequestHandler($container->get(Http\RouteDispatcher::class)); + return new RequestHandler($container->get(RouteDispatcher::class)); } - public static function getRouteDispatcher(ContainerInterface $container): Http\RouteDispatcher + public static function getRouteDispatcher(ContainerInterface $container): RouteDispatcher { - return self::new($container, Http\RouteDispatcher::class, [$container]); + return self::new($container, RouteDispatcher::class, [$container]); } /** @@ -92,9 +97,9 @@ class ServiceProvider extends AbstractServiceProvider return new ArrayObject($container->get(MiddlewareStackResolver::class)->resolve('backend')); } - public static function configureBackendRouter(ContainerInterface $container, Routing\Router $router = null): Routing\Router + public static function configureBackendRouter(ContainerInterface $container, Router $router = null): Router { - $router = $router ?? self::new($container, Routing\Router::class); + $router = $router ?? self::new($container, Router::class); $cache = $container->get('cache.core'); $cacheIdentifier = 'BackendRoutes_' . sha1((string)(new Typo3Version()) . Environment::getProjectPath() . 'BackendRoutes'); @@ -107,7 +112,7 @@ class ServiceProvider extends AbstractServiceProvider foreach ($routesFromPackages as $name => $options) { $path = $options['path']; unset($options['path']); - $route = new Routing\Route($path, $options); + $route = new Route($path, $options); $router->addRoute($name, $route); } diff --git a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php index c4ea31f01a386fd3c89169335d38a623be28588a..8fce986b738d1a7adf4aa8bf99341aa23516c17f 100644 --- a/typo3/sysext/backend/Classes/Template/DocumentTemplate.php +++ b/typo3/sysext/backend/Classes/Template/DocumentTemplate.php @@ -26,8 +26,10 @@ use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Information\Typo3Information; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; +use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\HttpUtility; @@ -244,7 +246,7 @@ function jumpToUrl(URL) { // Make copy $ovr = $GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID]; // merge styles. - \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TBE_STYLES'], $ovr); + ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TBE_STYLES'], $ovr); // Have to unset - otherwise the second instantiation will do it again! unset($GLOBALS['TBE_STYLES']['scriptIDindex'][$this->scriptID]); } @@ -644,7 +646,6 @@ function jumpToUrl(URL) { * Tables, buttons, formatting dimmed/red strings * ******************************************/ - /** * Function to load a HTML template file with markers. * When calling from own extension, use syntax getHtmlTemplate('EXT:extkey/template.html') @@ -736,7 +737,7 @@ function jumpToUrl(URL) { public function getFlashMessages() { /** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */ - $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class); + $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class); /** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */ $defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier(); return $defaultFlashMessageQueue->renderFlashMessages(); diff --git a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php index 2e032a7d2826788024b482d6663089fb25329b98..7459cb4fba203b8065b3a82ddea343cea8d4ef0a 100644 --- a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php +++ b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php @@ -24,6 +24,7 @@ use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Messaging\AbstractMessage; +use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Messaging\FlashMessageQueue; use TYPO3\CMS\Core\Messaging\FlashMessageService; use TYPO3\CMS\Core\Page\PageRenderer; @@ -498,7 +499,6 @@ class ModuleTemplate * Do not use these methods within own extensions if possible or * be prepared to change this later again. *******************************************/ - /** * Returns a linked shortcut-icon which will call the shortcut frame and set a * shortcut there back to the calling page/module @@ -709,7 +709,7 @@ class ModuleTemplate } /* @var \TYPO3\CMS\Core\Messaging\FlashMessage $flashMessage */ $flashMessage = GeneralUtility::makeInstance( - \TYPO3\CMS\Core\Messaging\FlashMessage::class, + FlashMessage::class, $messageBody, $messageTitle, $severity, diff --git a/typo3/sysext/backend/Classes/Tree/AbstractTree.php b/typo3/sysext/backend/Classes/Tree/AbstractTree.php index 81312591d5b5b0fec036ff1273ef0dae27930600..e83b77ea586d43a04bf116c0d403cccec73a843b 100644 --- a/typo3/sysext/backend/Classes/Tree/AbstractTree.php +++ b/typo3/sysext/backend/Classes/Tree/AbstractTree.php @@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Tree; +use TYPO3\CMS\Backend\Tree\Renderer\AbstractTreeRenderer; + /** * Abstract Tree */ @@ -37,7 +39,7 @@ abstract class AbstractTree /** * @param \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider $dataProvider */ - public function setDataProvider(\TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider $dataProvider) + public function setDataProvider(AbstractTreeDataProvider $dataProvider) { $this->dataProvider = $dataProvider; } @@ -53,7 +55,7 @@ abstract class AbstractTree /** * @param \TYPO3\CMS\Backend\Tree\Renderer\AbstractTreeRenderer $nodeRenderer */ - public function setNodeRenderer(\TYPO3\CMS\Backend\Tree\Renderer\AbstractTreeRenderer $nodeRenderer) + public function setNodeRenderer(AbstractTreeRenderer $nodeRenderer) { $this->nodeRenderer = $nodeRenderer; } diff --git a/typo3/sysext/backend/Classes/Tree/AbstractTreeDataProvider.php b/typo3/sysext/backend/Classes/Tree/AbstractTreeDataProvider.php index 0bd3042db793196f13687451f33e90bb9d10121e..9e17b51d435617be22f3197c7d8d7f85b8255aa8 100644 --- a/typo3/sysext/backend/Classes/Tree/AbstractTreeDataProvider.php +++ b/typo3/sysext/backend/Classes/Tree/AbstractTreeDataProvider.php @@ -40,5 +40,5 @@ abstract class AbstractTreeDataProvider * @param \TYPO3\CMS\Backend\Tree\TreeNode $node * @return \TYPO3\CMS\Backend\Tree\TreeNodeCollection */ - abstract public function getNodes(\TYPO3\CMS\Backend\Tree\TreeNode $node); + abstract public function getNodes(TreeNode $node); } diff --git a/typo3/sysext/backend/Classes/Tree/Renderer/AbstractTreeRenderer.php b/typo3/sysext/backend/Classes/Tree/Renderer/AbstractTreeRenderer.php index 891f27e18e3e30940dc4b719d85eb50211371a58..dc03042e172fc65ba3abf7bfacd00419675d0467 100644 --- a/typo3/sysext/backend/Classes/Tree/Renderer/AbstractTreeRenderer.php +++ b/typo3/sysext/backend/Classes/Tree/Renderer/AbstractTreeRenderer.php @@ -15,6 +15,10 @@ namespace TYPO3\CMS\Backend\Tree\Renderer; +use TYPO3\CMS\Backend\Tree\AbstractTree; +use TYPO3\CMS\Backend\Tree\TreeNodeCollection; +use TYPO3\CMS\Backend\Tree\TreeRepresentationNode; + /** * Abstract Renderer */ @@ -27,7 +31,7 @@ abstract class AbstractTreeRenderer * @param bool $recursive * @return mixed */ - abstract public function renderNode(\TYPO3\CMS\Backend\Tree\TreeRepresentationNode $node, $recursive = true); + abstract public function renderNode(TreeRepresentationNode $node, $recursive = true); /** * Renders a node collection recursive or just a single instance @@ -36,7 +40,7 @@ abstract class AbstractTreeRenderer * @param bool $recursive * @return mixed */ - abstract public function renderNodeCollection(\TYPO3\CMS\Backend\Tree\TreeNodeCollection $collection, $recursive = true); + abstract public function renderNodeCollection(TreeNodeCollection $collection, $recursive = true); /** * Renders a tree recursively or just a single instance @@ -45,5 +49,5 @@ abstract class AbstractTreeRenderer * @param bool $recursive * @return mixed */ - abstract public function renderTree(\TYPO3\CMS\Backend\Tree\AbstractTree $tree, $recursive = true); + abstract public function renderTree(AbstractTree $tree, $recursive = true); } diff --git a/typo3/sysext/backend/Classes/Tree/Renderer/UnorderedListTreeRenderer.php b/typo3/sysext/backend/Classes/Tree/Renderer/UnorderedListTreeRenderer.php index 658b8989e8e1f8f1805d3b6d5f494390825df370..611649be9713bd94386f1d5e7ddc6ca7c1269069 100644 --- a/typo3/sysext/backend/Classes/Tree/Renderer/UnorderedListTreeRenderer.php +++ b/typo3/sysext/backend/Classes/Tree/Renderer/UnorderedListTreeRenderer.php @@ -15,10 +15,14 @@ namespace TYPO3\CMS\Backend\Tree\Renderer; +use TYPO3\CMS\Backend\Tree\AbstractTree; +use TYPO3\CMS\Backend\Tree\TreeNodeCollection; +use TYPO3\CMS\Backend\Tree\TreeRepresentationNode; + /** * Renderer for unordered lists */ -class UnorderedListTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\AbstractTreeRenderer +class UnorderedListTreeRenderer extends AbstractTreeRenderer { /** * recursion level @@ -34,7 +38,7 @@ class UnorderedListTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\Abstrac * @param bool $recursive * @return string */ - public function renderNode(\TYPO3\CMS\Backend\Tree\TreeRepresentationNode $node, $recursive = true) + public function renderNode(TreeRepresentationNode $node, $recursive = true) { $code = '<li><span class="' . htmlspecialchars($node->getIcon()) . '"> </span>' . htmlspecialchars($node->getLabel()); if ($recursive && $node->getChildNodes() !== null) { @@ -53,7 +57,7 @@ class UnorderedListTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\Abstrac * @param bool $recursive * @return string */ - public function renderTree(\TYPO3\CMS\Backend\Tree\AbstractTree $tree, $recursive = true) + public function renderTree(AbstractTree $tree, $recursive = true) { $this->recursionLevel = 0; $code = '<ul class="level' . $this->recursionLevel . '" style="margin-left:10px">'; @@ -69,7 +73,7 @@ class UnorderedListTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\Abstrac * @param bool $recursive * @return string */ - public function renderNodeCollection(\TYPO3\CMS\Backend\Tree\TreeNodeCollection $collection, $recursive = true) + public function renderNodeCollection(TreeNodeCollection $collection, $recursive = true) { $code = '<ul class="level' . $this->recursionLevel . '" style="margin-left:10px">'; foreach ($collection as $node) { diff --git a/typo3/sysext/backend/Classes/Tree/SortedTreeNodeCollection.php b/typo3/sysext/backend/Classes/Tree/SortedTreeNodeCollection.php index 9268c2c4b32eda4e29504a9baee103a7f3c17618..a4b72d67914244bab8616fb02d9f2dc2513b88a1 100644 --- a/typo3/sysext/backend/Classes/Tree/SortedTreeNodeCollection.php +++ b/typo3/sysext/backend/Classes/Tree/SortedTreeNodeCollection.php @@ -21,7 +21,7 @@ namespace TYPO3\CMS\Backend\Tree; * Note: This collection works only with integers as offset keys and not * with much datasets. You have been warned! */ -class SortedTreeNodeCollection extends \TYPO3\CMS\Backend\Tree\TreeNodeCollection +class SortedTreeNodeCollection extends TreeNodeCollection { /** * Checks if a specific node is inside the collection @@ -29,7 +29,7 @@ class SortedTreeNodeCollection extends \TYPO3\CMS\Backend\Tree\TreeNodeCollectio * @param \TYPO3\CMS\Backend\Tree\TreeNode $node * @return bool */ - public function contains(\TYPO3\CMS\Backend\Tree\TreeNode $node) + public function contains(TreeNode $node) { return $this->offsetOf($node) !== -1; } @@ -40,7 +40,7 @@ class SortedTreeNodeCollection extends \TYPO3\CMS\Backend\Tree\TreeNodeCollectio * @param \TYPO3\CMS\Backend\Tree\TreeNode $node * @return int */ - protected function offsetOf(\TYPO3\CMS\Backend\Tree\TreeNode $node) + protected function offsetOf(TreeNode $node) { return $this->binarySearch($node, 0, $this->count() - 1); } @@ -53,7 +53,7 @@ class SortedTreeNodeCollection extends \TYPO3\CMS\Backend\Tree\TreeNodeCollectio * @param int $end * @return int */ - protected function binarySearch(\TYPO3\CMS\Backend\Tree\TreeNode $node, $start, $end) + protected function binarySearch(TreeNode $node, $start, $end) { if (!$start && $end - $start >= 2 || $end - $start > 2) { $divider = ceil(($end - $start) / 2); diff --git a/typo3/sysext/backend/Classes/Tree/TreeNode.php b/typo3/sysext/backend/Classes/Tree/TreeNode.php index 262d6223ac5bfc180a215000141a1b2e9cb249cf..bd511541a5c16a997074827eebb44b3186380078 100644 --- a/typo3/sysext/backend/Classes/Tree/TreeNode.php +++ b/typo3/sysext/backend/Classes/Tree/TreeNode.php @@ -15,12 +15,13 @@ namespace TYPO3\CMS\Backend\Tree; +use TYPO3\CMS\Core\Exception; use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Tree Node */ -class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Serializable +class TreeNode implements ComparableNodeInterface, \Serializable { /** * Node Identifier @@ -63,7 +64,7 @@ class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Seri * * @param \TYPO3\CMS\Backend\Tree\TreeNodeCollection $childNodes */ - public function setChildNodes(\TYPO3\CMS\Backend\Tree\TreeNodeCollection $childNodes) + public function setChildNodes(TreeNodeCollection $childNodes) { $this->childNodes = $childNodes; } @@ -233,7 +234,7 @@ class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Seri { $arrayRepresentation = unserialize($serializedString); if ($arrayRepresentation['serializeClassName'] !== static::class) { - throw new \TYPO3\CMS\Core\Exception('Deserialized object type is not identical!', 1294586646); + throw new Exception('Deserialized object type is not identical!', 1294586646); } $this->dataFromArray($arrayRepresentation); } diff --git a/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php b/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php index f91c488616075d255124fac206975267cbbad05c..368da2a6a8fa0466bb67b88d20e2601a17eb5551 100644 --- a/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php +++ b/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php @@ -15,6 +15,9 @@ namespace TYPO3\CMS\Backend\Tree; +use TYPO3\CMS\Core\Exception; +use TYPO3\CMS\Core\Utility\GeneralUtility; + /** * Tree Node Collection */ @@ -53,7 +56,7 @@ class TreeNodeCollection extends \ArrayObject * @param TreeNode $otherNode * @return int */ - public function nodeCompare(\TYPO3\CMS\Backend\Tree\TreeNode $node, \TYPO3\CMS\Backend\Tree\TreeNode $otherNode) + public function nodeCompare(TreeNode $node, TreeNode $otherNode) { return $node->compareTo($otherNode); } @@ -78,7 +81,7 @@ class TreeNodeCollection extends \ArrayObject { $arrayRepresentation = unserialize($serializedString); if ($arrayRepresentation['serializeClassName'] !== static::class) { - throw new \TYPO3\CMS\Core\Exception('Deserialized object type is not identical!', 1294586647); + throw new Exception('Deserialized object type is not identical!', 1294586647); } $this->dataFromArray($arrayRepresentation); } @@ -110,7 +113,7 @@ class TreeNodeCollection extends \ArrayObject { unset($data['serializeClassName']); foreach ($data as $index => $nodeArray) { - $node = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($nodeArray['serializeClassName'], $nodeArray); + $node = GeneralUtility::makeInstance($nodeArray['serializeClassName'], $nodeArray); $this->offsetSet($index, $node); } } diff --git a/typo3/sysext/backend/Classes/Tree/TreeRepresentationNode.php b/typo3/sysext/backend/Classes/Tree/TreeRepresentationNode.php index d0b615e971e82fca7478426608528781b7e9d374..6fb418410ed2ef3358886c99a2d977d66580084c 100644 --- a/typo3/sysext/backend/Classes/Tree/TreeRepresentationNode.php +++ b/typo3/sysext/backend/Classes/Tree/TreeRepresentationNode.php @@ -20,7 +20,7 @@ use TYPO3\CMS\Core\Imaging\Icon; /** * Representation Tree Node */ -class TreeRepresentationNode extends \TYPO3\CMS\Backend\Tree\TreeNode +class TreeRepresentationNode extends TreeNode { /** * Node Label diff --git a/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php b/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php index 8a5e89311a66d9ad5579a6929a6254f7d0315769..810bd26cfeff29b7752f0a2e4de502b0e65067bc 100644 --- a/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php +++ b/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php @@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Resource\Folder; use TYPO3\CMS\Core\Resource\FolderInterface; use TYPO3\CMS\Core\Resource\InaccessibleFolder; use TYPO3\CMS\Core\Resource\ResourceStorage; +use TYPO3\CMS\Core\Resource\Utility\ListUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -373,7 +374,7 @@ class FolderTreeView extends AbstractTreeView $subFolders = []; } else { $subFolders = $folderObject->getSubfolders(); - $subFolders = \TYPO3\CMS\Core\Resource\Utility\ListUtility::resolveSpecialFolderNames($subFolders); + $subFolders = ListUtility::resolveSpecialFolderNames($subFolders); uksort($subFolders, 'strnatcasecmp'); } diff --git a/typo3/sysext/backend/Classes/Utility/BackendUtility.php b/typo3/sysext/backend/Classes/Utility/BackendUtility.php index ff981da170ebff20e2e42c4434ee669ca2a824ce..f0e406dc1548d5ecf16151a19a54d7d69259ee34 100644 --- a/typo3/sysext/backend/Classes/Utility/BackendUtility.php +++ b/typo3/sysext/backend/Classes/Utility/BackendUtility.php @@ -18,6 +18,7 @@ namespace TYPO3\CMS\Backend\Utility; use Psr\EventDispatcher\EventDispatcherInterface; use Psr\Log\LoggerInterface; use TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher; +use TYPO3\CMS\Backend\Controller\File\ThumbnailController; use TYPO3\CMS\Backend\Routing\UriBuilder; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Cache\CacheManager; @@ -45,6 +46,7 @@ use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection; use TYPO3\CMS\Core\Information\Typo3Information; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Log\LogManager; +use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException; use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ResourceFactory; use TYPO3\CMS\Core\Routing\InvalidRouteArgumentsException; @@ -1077,7 +1079,7 @@ class BackendUtility $workspaceId === 0 ); $fileReferences[$fileReference->getUid()] = $fileReference; - } catch (\TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException $e) { + } catch (FileDoesNotExistException $e) { /** * We just catch the exception here * Reasoning: There is nothing an editor or even admin could do @@ -1205,7 +1207,7 @@ class BackendUtility 'parameters' => $parameters, 'hmac' => GeneralUtility::hmac( $parameters, - \TYPO3\CMS\Backend\Controller\File\ThumbnailController::class + ThumbnailController::class ), ]; return (string)GeneralUtility::makeInstance(UriBuilder::class) @@ -2737,7 +2739,7 @@ class BackendUtility } if ($routePath = GeneralUtility::_GP('route')) { - $uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class); + $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $scriptUrl = (string)$uriBuilder->buildUriFromRoutePath($routePath, $mainParams); $scriptUrl .= $addParams; } else { diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/BackendLayout.php b/typo3/sysext/backend/Classes/View/BackendLayout/BackendLayout.php index c74f053c26a213322c141461ad82f363a4c93dd1..7a838be53a8affdd258676df17fdab333b56d3e8 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/BackendLayout.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/BackendLayout.php @@ -95,7 +95,7 @@ class BackendLayout */ public static function create($identifier, $title, $configuration) { - return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( + return GeneralUtility::makeInstance( static::class, $identifier, $title, diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderCollection.php b/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderCollection.php index 7add9739dc091fc1a132acafe9bd2279f0a28057..4ee6687c73e766e59484e2b34e234bb16effcf84 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderCollection.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderCollection.php @@ -15,10 +15,13 @@ namespace TYPO3\CMS\Backend\View\BackendLayout; +use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Core\Utility\GeneralUtility; + /** * Collection of backend layout data providers. */ -class DataProviderCollection implements \TYPO3\CMS\Core\SingletonInterface +class DataProviderCollection implements SingletonInterface { /** * @var array|DataProviderInterface[] @@ -52,12 +55,12 @@ class DataProviderCollection implements \TYPO3\CMS\Core\SingletonInterface $dataProvider = $classNameOrObject; } else { $className = $classNameOrObject; - $dataProvider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($classNameOrObject); + $dataProvider = GeneralUtility::makeInstance($classNameOrObject); } if (!$dataProvider instanceof DataProviderInterface) { throw new \LogicException( - $className . ' must implement interface ' . \TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface::class, + $className . ' must implement interface ' . DataProviderInterface::class, 1381269811 ); } @@ -122,7 +125,7 @@ class DataProviderCollection implements \TYPO3\CMS\Core\SingletonInterface */ protected function createBackendLayoutCollection($identifier) { - return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( + return GeneralUtility::makeInstance( BackendLayoutCollection::class, $identifier ); diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderContext.php b/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderContext.php index b0033edd87e30045a66d79f8155deeb770c9a0ba..6eb2efbdc319f01b43f690c81b0f10ea0f1dcdf1 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderContext.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/DataProviderContext.php @@ -15,10 +15,12 @@ namespace TYPO3\CMS\Backend\View\BackendLayout; +use TYPO3\CMS\Core\SingletonInterface; + /** * Context that is forwarded to backend layout data providers. */ -class DataProviderContext implements \TYPO3\CMS\Core\SingletonInterface +class DataProviderContext implements SingletonInterface { /** * @var int diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/DefaultDataProvider.php b/typo3/sysext/backend/Classes/View/BackendLayout/DefaultDataProvider.php index b679d77f01be002f8fbada1246de9f9cd44b9c0a..68d8a3aad59c35a0c345409823273862e9f9b05e 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/DefaultDataProvider.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/DefaultDataProvider.php @@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\View\BackendLayout; use TYPO3\CMS\Backend\Utility\BackendUtility; +use TYPO3\CMS\Backend\View\BackendLayoutView; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder; @@ -93,7 +94,7 @@ class DefaultDataProvider implements DataProviderInterface return BackendLayout::create( 'default', 'LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.backend_layout.default', - \TYPO3\CMS\Backend\View\BackendLayoutView::getDefaultColumnLayout() + BackendLayoutView::getDefaultColumnLayout() ); } diff --git a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/Grid.php b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/Grid.php index 7634886d01e16e1abf6f35c3f59aa2a94b096cac..9e83302540527fb4aa33950d916c54548440ef90 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayout/Grid/Grid.php +++ b/typo3/sysext/backend/Classes/View/BackendLayout/Grid/Grid.php @@ -86,6 +86,6 @@ class Grid extends AbstractGridObject foreach ($this->rows[0]->getColumns() ?? [] as $column) { $span += $column->getColSpan(); } - return $span ? $span : 1; + return $span ?: 1; } } diff --git a/typo3/sysext/backend/Classes/View/BackendLayoutView.php b/typo3/sysext/backend/Classes/View/BackendLayoutView.php index 8d83f2b2db31cb081da6524743bedb0f46772b04..13d5b8158e233f6e8c7aa23c13d51a010d3c3f42 100644 --- a/typo3/sysext/backend/Classes/View/BackendLayoutView.php +++ b/typo3/sysext/backend/Classes/View/BackendLayoutView.php @@ -23,6 +23,7 @@ use TYPO3\CMS\Backend\View\BackendLayout\DataProviderContext; use TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Localization\LanguageService; +use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser; use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -31,7 +32,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; * Backend layout for CMS * @internal This class is a TYPO3 Backend implementation and is not considered part of the Public TYPO3 API. */ -class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface +class BackendLayoutView implements SingletonInterface { /** * @var DataProviderCollection diff --git a/typo3/sysext/backend/Classes/View/BackendTemplateView.php b/typo3/sysext/backend/Classes/View/BackendTemplateView.php index 40fc601ebf7f5e750568cc1fd53d6063860491f9..b97593a1169e9e4b0b31dfe39c5145efd0333bca 100644 --- a/typo3/sysext/backend/Classes/View/BackendTemplateView.php +++ b/typo3/sysext/backend/Classes/View/BackendTemplateView.php @@ -81,7 +81,7 @@ class BackendTemplateView implements ViewInterface * * @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext Controller context which is available inside the view */ - public function setControllerContext(\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext) + public function setControllerContext(ControllerContext $controllerContext) { $this->templateView->setControllerContext($controllerContext); } diff --git a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawFooterHookInterface.php b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawFooterHookInterface.php index a56d68ef71587f723d65e5c0a6d36ecd52428e08..fee6bf094cea7feffcea73133688c05c9a65e162 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawFooterHookInterface.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawFooterHookInterface.php @@ -28,5 +28,5 @@ interface PageLayoutViewDrawFooterHookInterface * @param array $info Processed values * @param array $row Record row of tt_content */ - public function preProcess(\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject, &$info, array &$row); + public function preProcess(PageLayoutView &$parentObject, &$info, array &$row); } diff --git a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawItemHookInterface.php b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawItemHookInterface.php index 4f9b99ee87fc34d5220d4636cd6ff1c5915bebba..e2681c7a927b81e9cf1090b41f738afc97c223ef 100644 --- a/typo3/sysext/backend/Classes/View/PageLayoutViewDrawItemHookInterface.php +++ b/typo3/sysext/backend/Classes/View/PageLayoutViewDrawItemHookInterface.php @@ -30,5 +30,5 @@ interface PageLayoutViewDrawItemHookInterface * @param string $itemContent Item content * @param array $row Record row of tt_content */ - public function preProcess(\TYPO3\CMS\Backend\View\PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row); + public function preProcess(PageLayoutView &$parentObject, &$drawItem, &$headerContent, &$itemContent, array &$row); } diff --git a/typo3/sysext/backend/Tests/Functional/Domain/Repository/Localization/LocalizationRepositoryTest.php b/typo3/sysext/backend/Tests/Functional/Domain/Repository/Localization/LocalizationRepositoryTest.php index c7a6290250e87604e6e6152e34153ffc74fd645d..20f324fad42cbbd5329eddc945784ce47ab0f5df 100644 --- a/typo3/sysext/backend/Tests/Functional/Domain/Repository/Localization/LocalizationRepositoryTest.php +++ b/typo3/sysext/backend/Tests/Functional/Domain/Repository/Localization/LocalizationRepositoryTest.php @@ -19,11 +19,12 @@ namespace TYPO3\CMS\Backend\Tests\Functional\Domain\Repository\Localization; use TYPO3\CMS\Backend\Domain\Repository\Localization\LocalizationRepository; use TYPO3\CMS\Core\Core\Bootstrap; +use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; /** * Test case for TYPO3\CMS\Backend\Domain\Repository\Localization\LocalizationRepository */ -class LocalizationRepositoryTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase +class LocalizationRepositoryTest extends FunctionalTestCase { /** * @var LocalizationRepository diff --git a/typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php b/typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php index c3ea4dbb14c782dfc842596ca566afcf1e66dadf..5d0ba1657d8184024d03d3321a615528889cfa3d 100644 --- a/typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php +++ b/typo3/sysext/backend/Tests/Unit/Controller/File/FileControllerTest.php @@ -22,6 +22,9 @@ use TYPO3\CMS\Core\Http\Response; use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Imaging\Icon; use TYPO3\CMS\Core\Imaging\IconFactory; +use TYPO3\CMS\Core\Resource\File; +use TYPO3\CMS\Core\Resource\Folder; +use TYPO3\CMS\Core\Utility\File\ExtendedFileUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -60,15 +63,15 @@ class FileControllerTest extends UnitTestCase */ protected function setUp(): void { - $this->fileResourceMock = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\File::class) + $this->fileResourceMock = $this->getMockBuilder(File::class) ->setMethods(['toArray', 'getModificationTime', 'getExtension']) ->disableOriginalConstructor() ->getMock(); - $this->folderResourceMock = $this->getMockBuilder(\TYPO3\CMS\Core\Resource\Folder::class) + $this->folderResourceMock = $this->getMockBuilder(Folder::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); - $this->mockFileProcessor = $this->getMockBuilder(\TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::class) + $this->mockFileProcessor = $this->getMockBuilder(ExtendedFileUtility::class) ->setMethods(['getErrorMessages']) ->disableOriginalConstructor() ->getMock(); @@ -124,7 +127,7 @@ class FileControllerTest extends UnitTestCase */ public function processAjaxRequestDeleteProcessActuallyDoesNotChangeFileData() { - $subject = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, ['init', 'main']); + $subject = $this->getAccessibleMock(FileController::class, ['init', 'main']); $fileData = ['delete' => [true]]; $subject->_set('fileProcessor', $this->mockFileProcessor); @@ -141,7 +144,7 @@ class FileControllerTest extends UnitTestCase */ public function processAjaxRequestEditFileProcessActuallyDoesNotChangeFileData() { - $subject = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, ['init', 'main']); + $subject = $this->getAccessibleMock(FileController::class, ['init', 'main']); $fileData = ['editfile' => [true]]; $subject->_set('fileProcessor', $this->mockFileProcessor); @@ -158,7 +161,7 @@ class FileControllerTest extends UnitTestCase */ public function processAjaxRequestReturnsStatus200IfNoErrorOccurs() { - $subject = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, ['init', 'main']); + $subject = $this->getAccessibleMock(FileController::class, ['init', 'main']); $fileData = ['editfile' => [true]]; $subject->_set('fileProcessor', $this->mockFileProcessor); diff --git a/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php b/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php index 7ef368acc528928423b77f2baa5c442e871a9474..c9b671921e68488756bfdcd4e5473b3dee3e884f 100644 --- a/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php +++ b/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php @@ -18,6 +18,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Controller\File; use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Backend\Controller\File\ThumbnailController; use TYPO3\CMS\Core\Http\Response; +use TYPO3\CMS\Core\Http\ServerRequest; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -68,7 +69,7 @@ class ThumbnailControllerTest extends UnitTestCase 'hmac' => $hmac, ]; - $request = (new \TYPO3\CMS\Core\Http\ServerRequest()) + $request = (new ServerRequest()) ->withQueryParams($queryParameters); $this->subject->render($request); } @@ -105,7 +106,7 @@ class ThumbnailControllerTest extends UnitTestCase ), ]; - $request = (new \TYPO3\CMS\Core\Http\ServerRequest()) + $request = (new ServerRequest()) ->withQueryParams($queryParameters); self::assertInstanceOf( Response::class, diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexProcessTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexProcessTest.php index afa18734a5f777c751098591094a236edba48a24..37bd59ef33bdd555fac8a941127234afa58f3a75 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexProcessTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/TcaFlexProcessTest.php @@ -18,7 +18,9 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment; +use TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowDefaultValues; use TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess; +use TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems; use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -827,7 +829,7 @@ class TcaFlexProcessTest extends UnitTestCase ]; $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['flexFormSegment'] = [ - \TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems::class => [], + TcaRadioItems::class => [], ]; /** @var LanguageService|ObjectProphecy $languageService */ @@ -915,7 +917,7 @@ class TcaFlexProcessTest extends UnitTestCase ]; $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['flexFormSegment'] = [ - \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowDefaultValues::class => [], + DatabaseRowDefaultValues::class => [], ]; /** @var LanguageService|ObjectProphecy $languageService */ @@ -1117,7 +1119,7 @@ class TcaFlexProcessTest extends UnitTestCase ]; $GLOBALS['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['flexFormSegment'] = [ - \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseRowDefaultValues::class => [], + DatabaseRowDefaultValues::class => [], ]; /** @var LanguageService|ObjectProphecy $languageService */ diff --git a/typo3/sysext/backend/Tests/Unit/Tree/SortedTreeNodeCollectionTest.php b/typo3/sysext/backend/Tests/Unit/Tree/SortedTreeNodeCollectionTest.php index 0c75c8c9cd06def4835f43c64a64cb7f1cd4f0b3..2567cf4615299cdfcdf19766eddb55488065ba7c 100644 --- a/typo3/sysext/backend/Tests/Unit/Tree/SortedTreeNodeCollectionTest.php +++ b/typo3/sysext/backend/Tests/Unit/Tree/SortedTreeNodeCollectionTest.php @@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree; +use TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection; +use TYPO3\CMS\Backend\Tree\TreeNode; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -24,22 +26,22 @@ class SortedTreeNodeCollectionTest extends UnitTestCase { protected function createTestCollection() { - $nodeCollection = new \TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection(); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 5]); + $nodeCollection = new SortedTreeNodeCollection(); + $node = new TreeNode(['id' => 5]); $nodeCollection->append($node); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 15]); + $node = new TreeNode(['id' => 15]); $nodeCollection->append($node); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 3]); + $node = new TreeNode(['id' => 3]); $nodeCollection->append($node); return $nodeCollection; } protected function createTestCollectionWithTwoNodes() { - $nodeCollection = new \TYPO3\CMS\Backend\Tree\SortedTreeNodeCollection(); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 5]); + $nodeCollection = new SortedTreeNodeCollection(); + $node = new TreeNode(['id' => 5]); $nodeCollection->append($node); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 3]); + $node = new TreeNode(['id' => 3]); $nodeCollection->append($node); return $nodeCollection; } @@ -64,7 +66,7 @@ class SortedTreeNodeCollectionTest extends UnitTestCase public function collectionContainsNode() { $nodeCollection = $this->createTestCollection(); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 5]); + $node = new TreeNode(['id' => 5]); self::assertTrue($nodeCollection->contains($node)); } @@ -74,14 +76,14 @@ class SortedTreeNodeCollectionTest extends UnitTestCase public function searchDataWithBinarySearch() { $nodeCollection = $this->createTestCollection(); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 15]); + $node = new TreeNode(['id' => 15]); self::assertTrue($nodeCollection->contains($node)); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 99]); + $node = new TreeNode(['id' => 99]); self::assertFalse($nodeCollection->contains($node)); $nodeCollection = $this->createTestCollectionWithTwoNodes(); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 3]); + $node = new TreeNode(['id' => 3]); self::assertTrue($nodeCollection->contains($node)); - $node = new \TYPO3\CMS\Backend\Tree\TreeNode(['id' => 99]); + $node = new TreeNode(['id' => 99]); self::assertFalse($nodeCollection->contains($node)); } } diff --git a/typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php b/typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php index 5e5cc01309aa7cb4d5cd73d4664512aa3813ea95..bc5da1db17162b106ad605ffd74d7fbfeef7f145 100644 --- a/typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php +++ b/typo3/sysext/backend/Tests/Unit/Tree/TreeNodeCollectionTest.php @@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Tree; +use TYPO3\CMS\Backend\Tree\TreeNode; +use TYPO3\CMS\Backend\Tree\TreeNodeCollection; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -27,13 +29,13 @@ class TreeNodeCollectionTest extends UnitTestCase */ public function sortNodes() { - $nodeCollection = new \TYPO3\CMS\Backend\Tree\TreeNodeCollection([ - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 15], - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 25], - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 5], - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 2], - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 150], - ['serializeClassName' => \TYPO3\CMS\Backend\Tree\TreeNode::class, 'id' => 67] + $nodeCollection = new TreeNodeCollection([ + ['serializeClassName' => TreeNode::class, 'id' => 15], + ['serializeClassName' => TreeNode::class, 'id' => 25], + ['serializeClassName' => TreeNode::class, 'id' => 5], + ['serializeClassName' => TreeNode::class, 'id' => 2], + ['serializeClassName' => TreeNode::class, 'id' => 150], + ['serializeClassName' => TreeNode::class, 'id' => 67] ]); $nodeCollection->asort(); $expected = [2, 5, 15, 25, 67, 150]; diff --git a/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php b/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php index 24b6807f054a22c058f705907c54222152b53fa2..c777025e03873232c8482bfd8c792bb170cac6d2 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility; +use Doctrine\DBAL\Driver\Statement; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; use Psr\EventDispatcher\EventDispatcherInterface; @@ -288,7 +289,7 @@ class BackendUtilityTest extends UnitTestCase $relationHandlerInstance->tableArray['sys_category'] = [1, 2]; [$queryBuilderProphet, $connectionPoolProphet] = $this->mockDatabaseConnection('sys_category'); - $statementProphet = $this->prophesize(\Doctrine\DBAL\Driver\Statement::class); + $statementProphet = $this->prophesize(Statement::class); $statementProphet->fetch()->shouldBeCalled()->willReturn( [ 'uid' => 1, @@ -466,7 +467,7 @@ class BackendUtilityTest extends UnitTestCase ] ] ]; - $languageServiceProphecy = $this->prophesize(\TYPO3\CMS\Core\Localization\LanguageService::class); + $languageServiceProphecy = $this->prophesize(LanguageService::class); $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes')->willReturn('Yes'); $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no')->willReturn('No'); $GLOBALS['LANG'] = $languageServiceProphecy->reveal(); @@ -496,7 +497,7 @@ class BackendUtilityTest extends UnitTestCase ] ] ]; - $languageServiceProphecy = $this->prophesize(\TYPO3\CMS\Core\Localization\LanguageService::class); + $languageServiceProphecy = $this->prophesize(LanguageService::class); $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes')->willReturn('Yes'); $languageServiceProphecy->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no')->willReturn('No'); $GLOBALS['LANG'] = $languageServiceProphecy->reveal(); diff --git a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/LabelFromItemListMergedReturnsCorrectFieldsFixture.php b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/LabelFromItemListMergedReturnsCorrectFieldsFixture.php index 921568f87e29d25c0ee26f875b9e6defdebbeaa2..1deb211dbefd86113102e1c5de76519ac10a1b82 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/LabelFromItemListMergedReturnsCorrectFieldsFixture.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/LabelFromItemListMergedReturnsCorrectFieldsFixture.php @@ -15,10 +15,12 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures; +use TYPO3\CMS\Backend\Utility\BackendUtility; + /** * Disable getRecordWSOL and getRecordTitle dependency by returning stable results */ -class LabelFromItemListMergedReturnsCorrectFieldsFixture extends \TYPO3\CMS\Backend\Utility\BackendUtility +class LabelFromItemListMergedReturnsCorrectFieldsFixture extends BackendUtility { /** * @return array diff --git a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithMultipleAllowedTablesFixture.php b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithMultipleAllowedTablesFixture.php index da2e55dfaffa007c340900f32d88e02f80c2a41f..30bf47ba98962af93f62fa1afc96124c30f7cb44 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithMultipleAllowedTablesFixture.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithMultipleAllowedTablesFixture.php @@ -15,10 +15,12 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures; +use TYPO3\CMS\Backend\Utility\BackendUtility; + /** * Disable getRecordWSOL and getRecordTitle dependency by returning stable results */ -class ProcessedValueForGroupWithMultipleAllowedTablesFixture extends \TYPO3\CMS\Backend\Utility\BackendUtility +class ProcessedValueForGroupWithMultipleAllowedTablesFixture extends BackendUtility { /** * Get record WSOL diff --git a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithOneAllowedTableFixture.php b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithOneAllowedTableFixture.php index 5ac311611d36f14dbdddb677c17414610f9cf956..7abeb3220c79ba8ca19bcff4f11d6cd1103f79b0 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithOneAllowedTableFixture.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForGroupWithOneAllowedTableFixture.php @@ -15,10 +15,12 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures; +use TYPO3\CMS\Backend\Utility\BackendUtility; + /** * Disable getRecordWSOL and getRecordTitle dependency by returning stable results */ -class ProcessedValueForGroupWithOneAllowedTableFixture extends \TYPO3\CMS\Backend\Utility\BackendUtility +class ProcessedValueForGroupWithOneAllowedTableFixture extends BackendUtility { /** * Get record WSOL diff --git a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForSelectWithMMRelationFixture.php b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForSelectWithMMRelationFixture.php index ac914ef3f5a878f484e9c83733f9ea1b6dfbbd00..e20d6016d3e2d5477808fb50f4624bfe53b40d95 100644 --- a/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForSelectWithMMRelationFixture.php +++ b/typo3/sysext/backend/Tests/Unit/Utility/Fixtures/ProcessedValueForSelectWithMMRelationFixture.php @@ -15,10 +15,12 @@ namespace TYPO3\CMS\Backend\Tests\Unit\Utility\Fixtures; +use TYPO3\CMS\Backend\Utility\BackendUtility; + /** * Disable getRecordWSOL and getRecordTitle dependency by returning stable results */ -class ProcessedValueForSelectWithMMRelationFixture extends \TYPO3\CMS\Backend\Utility\BackendUtility +class ProcessedValueForSelectWithMMRelationFixture extends BackendUtility { /** * Get record title diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php index 738a7450d5e5f27a374c002184967e4fb3df668d..f72874112f1f42e1144ac9a9946f51c77cf0d1f8 100644 --- a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php +++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutCollectionTest.php @@ -15,6 +15,8 @@ namespace TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout; +use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout; +use TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection; use TYPO3\CMS\Core\Utility\StringUtility; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -31,7 +33,7 @@ class BackendLayoutCollectionTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1381597631); $identifier = StringUtility::getUniqueId('identifier__'); - new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier); + new BackendLayoutCollection($identifier); } /** @@ -40,7 +42,7 @@ class BackendLayoutCollectionTest extends UnitTestCase public function objectIsCreated() { $identifier = StringUtility::getUniqueId('identifier'); - $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier); + $backendLayoutCollection = new BackendLayoutCollection($identifier); self::assertEquals($identifier, $backendLayoutCollection->getIdentifier()); } @@ -53,9 +55,9 @@ class BackendLayoutCollectionTest extends UnitTestCase $this->expectException(\UnexpectedValueException::class); $this->expectExceptionCode(1381597628); $identifier = StringUtility::getUniqueId('identifier'); - $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier); + $backendLayoutCollection = new BackendLayoutCollection($identifier); $backendLayoutIdentifier = StringUtility::getUniqueId('identifier__'); - $backendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $backendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); @@ -72,14 +74,14 @@ class BackendLayoutCollectionTest extends UnitTestCase $this->expectException(\LogicException::class); $this->expectExceptionCode(1381559376); $identifier = StringUtility::getUniqueId('identifier'); - $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier); + $backendLayoutCollection = new BackendLayoutCollection($identifier); $backendLayoutIdentifier = StringUtility::getUniqueId('identifier'); - $firstBackendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $firstBackendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); $firstBackendLayoutMock->expects(self::once())->method('getIdentifier')->willReturn($backendLayoutIdentifier); - $secondBackendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $secondBackendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); @@ -95,9 +97,9 @@ class BackendLayoutCollectionTest extends UnitTestCase public function backendLayoutCanBeFetched() { $identifier = StringUtility::getUniqueId('identifier'); - $backendLayoutCollection = new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayoutCollection($identifier); + $backendLayoutCollection = new BackendLayoutCollection($identifier); $backendLayoutIdentifier = StringUtility::getUniqueId('identifier'); - $backendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $backendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php index e0b8a3fa1f82d6ee3ccea8f11105474947bb3f28..4cb6bfee22bf4aa8ce8bbc19e02eff7f941541ef 100644 --- a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php +++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/BackendLayoutTest.php @@ -39,7 +39,7 @@ class BackendLayoutTest extends UnitTestCase $identifier = StringUtility::getUniqueId('identifier__'); $title = StringUtility::getUniqueId('title'); $configuration = StringUtility::getUniqueId('configuration'); - new \TYPO3\CMS\Backend\View\BackendLayout\BackendLayout($identifier, $title, $configuration); + new BackendLayout($identifier, $title, $configuration); } /** diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php index 04832d8f1303daaa6c468d5f51724b7d3513cf1c..a3e8f0a4a1e1aa4a100eb181451bc493fccf45a6 100644 --- a/typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php +++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayout/DataProviderCollectionTest.php @@ -15,6 +15,9 @@ namespace TYPO3\CMS\Backend\Tests\Unit\View\BackendLayout; +use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout; +use TYPO3\CMS\Backend\View\BackendLayout\DataProviderCollection; +use TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider; use TYPO3\CMS\Core\Utility\StringUtility; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -34,7 +37,7 @@ class DataProviderCollectionTest extends UnitTestCase protected function setUp(): void { parent::setUp(); - $this->dataProviderCollection = new \TYPO3\CMS\Backend\View\BackendLayout\DataProviderCollection(); + $this->dataProviderCollection = new DataProviderCollection(); } /** @@ -70,11 +73,11 @@ class DataProviderCollectionTest extends UnitTestCase { $backendLayoutIdentifier = StringUtility::getUniqueId('identifier'); - $dataProviderMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider::class) + $dataProviderMock = $this->getMockBuilder(DefaultDataProvider::class) ->setMethods(['getBackendLayout']) ->disableOriginalConstructor() ->getMock(); - $backendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $backendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); @@ -96,11 +99,11 @@ class DataProviderCollectionTest extends UnitTestCase $dataProviderIdentifier = StringUtility::getUniqueId('custom'); $backendLayoutIdentifier = StringUtility::getUniqueId('identifier'); - $dataProviderMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider::class) + $dataProviderMock = $this->getMockBuilder(DefaultDataProvider::class) ->setMethods(['getBackendLayout']) ->disableOriginalConstructor() ->getMock(); - $backendLayoutMock = $this->getMockBuilder(\TYPO3\CMS\Backend\View\BackendLayout\BackendLayout::class) + $backendLayoutMock = $this->getMockBuilder(BackendLayout::class) ->setMethods(['getIdentifier']) ->disableOriginalConstructor() ->getMock(); diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php index f8ec0a1351c62c5dc05480d857225e64e9870f9b..c51d04fb494cf2ef22b48ebd180d2c9011632d1a 100644 --- a/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php +++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php @@ -15,6 +15,7 @@ namespace TYPO3\CMS\Backend\Tests\Unit\View; +use TYPO3\CMS\Backend\View\BackendLayoutView; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -34,7 +35,7 @@ class BackendLayoutViewTest extends UnitTestCase { parent::setUp(); $this->backendLayoutView = $this->getAccessibleMock( - \TYPO3\CMS\Backend\View\BackendLayoutView::class, + BackendLayoutView::class, ['getPage', 'getRootLine'], [], '',