diff --git a/Build/.php_cs b/Build/.php_cs index 812f3969a2f7..3573867a560f 100644 --- a/Build/.php_cs +++ b/Build/.php_cs @@ -81,5 +81,6 @@ return PhpCsFixer\Config::create() 'no_useless_else' => true, 'phpdoc_types' => true, 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'return_type_declaration' => ['space_before' => 'none'], ]) ->setFinder($finder); diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php index 4783beb300e9..12d575f0c692 100644 --- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php +++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/UserToolbarItem.php @@ -122,7 +122,7 @@ protected function getBackendUser() * * @return StandaloneView */ - protected function getFluidTemplateObject(string $filename):StandaloneView + protected function getFluidTemplateObject(string $filename): StandaloneView { $view = GeneralUtility::makeInstance(StandaloneView::class); $view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']); diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php index 45d35729cebc..627e67e2f5d2 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php @@ -248,7 +248,7 @@ public function main() * * @return array */ - protected function getPageTitle() : array + protected function getPageTitle(): array { $pageTitle = [ 'title' => BackendUtility::getRecordTitle($this->table, $this->row, false) @@ -272,7 +272,7 @@ protected function getPageTitle() : array * * @return array */ - protected function getPreview() : array + protected function getPreview(): array { $preview = []; // Perhaps @todo in future: Also display preview for records - without fileObject @@ -318,7 +318,7 @@ protected function getPreview() : array * * @return array */ - protected function getPropertiesForTable() : array + protected function getPropertiesForTable(): array { $propertiesForTable = []; $lang = $this->getLanguageService(); @@ -426,7 +426,7 @@ protected function getPropertiesForTable() : array * * @return array */ - protected function getReferences() : array + protected function getReferences(): array { $references = []; switch ($this->type) { @@ -451,7 +451,7 @@ protected function getReferences() : array * * @return array */ - protected function getBackButton() : array + protected function getBackButton(): array { return ['returnUrl' => GeneralUtility::sanitizeLocalUrl(GeneralUtility::_GET('returnUrl'))]; } @@ -611,7 +611,7 @@ protected function makeRef($table, $ref) * @param string $ref Filename or uid * @return array */ - protected function makeRefFrom($table, $ref) : array + protected function makeRefFrom($table, $ref): array { $refFromLines = []; $lang = $this->getLanguageService(); diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php index 40c3f3b5e669..6d82a817b1e6 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php @@ -568,7 +568,7 @@ protected function getBackendUser() * @param string $filename * @return StandaloneView */ - protected function getFluidTemplateObject(string $filename = 'Main.html'):StandaloneView + protected function getFluidTemplateObject(string $filename = 'Main.html'): StandaloneView { /** @var StandaloneView $view */ $view = GeneralUtility::makeInstance(StandaloneView::class); diff --git a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php index 4016b9d6ccad..1052ed06b7e1 100644 --- a/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php +++ b/typo3/sysext/backend/Classes/Form/FormDataProvider/AbstractItemProvider.php @@ -953,7 +953,7 @@ protected function getExplicitAuthFieldValues() * @param string $localFieldName Current handle field name * @return QueryBuilder */ - protected function buildForeignTableQueryBuilder(array $result, string $localFieldName): QueryBuilder + protected function buildForeignTableQueryBuilder(array $result, string $localFieldName): QueryBuilder { $backendUser = $this->getBackendUser(); diff --git a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php index c316d1e77baf..11542cb0fa05 100644 --- a/typo3/sysext/backend/Classes/Template/ModuleTemplate.php +++ b/typo3/sysext/backend/Classes/Template/ModuleTemplate.php @@ -740,7 +740,7 @@ protected function getFlashMessageQueue() /** * @return bool */ - public function isUiBlock() : bool + public function isUiBlock(): bool { return $this->uiBlock; } diff --git a/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php b/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php index e59910fd2aef..53e4ee6147b7 100644 --- a/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php +++ b/typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php @@ -1609,7 +1609,7 @@ public function fetchUserRecord($dbUser, $username, $extraWhere = '') * @internal * @return string */ - public function getSessionId() : string + public function getSessionId(): string { return $this->id; } @@ -1618,7 +1618,7 @@ public function getSessionId() : string * @internal * @return string */ - public function getLoginType() : string + public function getLoginType(): string { return $this->loginType; } diff --git a/typo3/sysext/core/Classes/Configuration/Richtext.php b/typo3/sysext/core/Classes/Configuration/Richtext.php index 49aeae745ebc..1e8d63630c58 100644 --- a/typo3/sysext/core/Classes/Configuration/Richtext.php +++ b/typo3/sysext/core/Classes/Configuration/Richtext.php @@ -141,7 +141,7 @@ protected function convertPlainArrayToTypoScriptArray(array $plainArray) /** * @return BackendUserAuthentication */ - protected function getBackendUser() : BackendUserAuthentication + protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } @@ -179,7 +179,7 @@ protected function addFlattenedPageTsConfig(array $typoScriptArray): array * @param string $recordType Record type value * @return array */ - protected function getPageTsConfiguration(string $table, string $field, int $pid, string $recordType) : array + protected function getPageTsConfiguration(string $table, string $field, int $pid, string $recordType): array { // Load PageTSconfig configuration $fullPageTsConfig = $this->getRtePageTsConfigOfPid($pid); diff --git a/typo3/sysext/core/Classes/Database/ReferenceIndex.php b/typo3/sysext/core/Classes/Database/ReferenceIndex.php index 762716840ca0..9a118d0411e2 100644 --- a/typo3/sysext/core/Classes/Database/ReferenceIndex.php +++ b/typo3/sysext/core/Classes/Database/ReferenceIndex.php @@ -340,7 +340,7 @@ public function generateRefIndexData($tableName, $uid) * @param array $record Record from $tableName * @return array */ - protected function generateDataUsingRecord(string $tableName, array $record) : array + protected function generateDataUsingRecord(string $tableName, array $record): array { $this->relations = []; $deleteField = $GLOBALS['TCA'][$tableName]['ctrl']['delete']; diff --git a/typo3/sysext/core/Classes/Messaging/AbstractMessage.php b/typo3/sysext/core/Classes/Messaging/AbstractMessage.php index 403fd1e62600..c4dccb644a19 100644 --- a/typo3/sysext/core/Classes/Messaging/AbstractMessage.php +++ b/typo3/sysext/core/Classes/Messaging/AbstractMessage.php @@ -54,7 +54,7 @@ abstract class AbstractMessage * * @return string The message's title. */ - public function getTitle() : string + public function getTitle(): string { return $this->title; } @@ -74,7 +74,7 @@ public function setTitle(string $title) * * @return string The message. */ - public function getMessage() : string + public function getMessage(): string { return $this->message; } @@ -94,7 +94,7 @@ public function setMessage(string $message) * * @return int The message' severity, must be one of AbstractMessage::INFO or similar contstants */ - public function getSeverity() : int + public function getSeverity(): int { return $this->severity; } diff --git a/typo3/sysext/core/Classes/Messaging/FlashMessageRendererResolver.php b/typo3/sysext/core/Classes/Messaging/FlashMessageRendererResolver.php index c19d39963ffd..50487c9d1ff7 100644 --- a/typo3/sysext/core/Classes/Messaging/FlashMessageRendererResolver.php +++ b/typo3/sysext/core/Classes/Messaging/FlashMessageRendererResolver.php @@ -40,7 +40,7 @@ class FlashMessageRendererResolver * * @return FlashMessageRendererInterface */ - public function resolve() : FlashMessageRendererInterface + public function resolve(): FlashMessageRendererInterface { $rendererClass = $this->resolveFlashMessageRenderClass(); $renderer = GeneralUtility::makeInstance($rendererClass); @@ -56,7 +56,7 @@ public function resolve() : FlashMessageRendererInterface * * @return string */ - protected function resolveFlashMessageRenderClass() : string + protected function resolveFlashMessageRenderClass(): string { $context = $this->resolveContext(); $renderClass = $this->renderer['_default']; @@ -77,7 +77,7 @@ protected function resolveFlashMessageRenderClass() : string * * @return string */ - protected function resolveContext() : string + protected function resolveContext(): string { $context = ''; if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) { diff --git a/typo3/sysext/core/Classes/Messaging/FlashMessageService.php b/typo3/sysext/core/Classes/Messaging/FlashMessageService.php index 2bccb30a23c2..aea35e103975 100644 --- a/typo3/sysext/core/Classes/Messaging/FlashMessageService.php +++ b/typo3/sysext/core/Classes/Messaging/FlashMessageService.php @@ -38,7 +38,7 @@ class FlashMessageService implements SingletonInterface * @return FlashMessageQueue * @api */ - public function getMessageQueueByIdentifier($identifier = 'core.template.flashMessages') : FlashMessageQueue + public function getMessageQueueByIdentifier($identifier = 'core.template.flashMessages'): FlashMessageQueue { if (!isset($this->flashMessageQueues[$identifier])) { $this->flashMessageQueues[$identifier] = GeneralUtility::makeInstance( diff --git a/typo3/sysext/core/Classes/Messaging/Renderer/BootstrapRenderer.php b/typo3/sysext/core/Classes/Messaging/Renderer/BootstrapRenderer.php index 3d74501c35d8..377612c17ccb 100644 --- a/typo3/sysext/core/Classes/Messaging/Renderer/BootstrapRenderer.php +++ b/typo3/sysext/core/Classes/Messaging/Renderer/BootstrapRenderer.php @@ -54,7 +54,7 @@ class BootstrapRenderer implements FlashMessageRendererInterface * @param FlashMessage[] $flashMessages * @return string Representation of the flash message */ - public function render(array $flashMessages) : string + public function render(array $flashMessages): string { return $this->getMessageAsMarkup($flashMessages); } @@ -66,7 +66,7 @@ public function render(array $flashMessages) : string * * @return string The message severity class name */ - protected function getClass(FlashMessage $flashMessage) : string + protected function getClass(FlashMessage $flashMessage): string { return 'alert-' . self::$classes[$flashMessage->getSeverity()]; } @@ -78,7 +78,7 @@ protected function getClass(FlashMessage $flashMessage) : string * * @return string The message severity icon name */ - protected function getIconName(FlashMessage $flashMessage) : string + protected function getIconName(FlashMessage $flashMessage): string { return self::$icons[$flashMessage->getSeverity()]; } @@ -89,7 +89,7 @@ protected function getIconName(FlashMessage $flashMessage) : string * @param FlashMessage[] $flashMessages * @return string */ - protected function getMessageAsMarkup(array $flashMessages) : string + protected function getMessageAsMarkup(array $flashMessages): string { $markup = []; $markup[] = '
'; diff --git a/typo3/sysext/core/Classes/Messaging/Renderer/FlashMessageRendererInterface.php b/typo3/sysext/core/Classes/Messaging/Renderer/FlashMessageRendererInterface.php index 639d7e913b1b..43db6bc3a424 100644 --- a/typo3/sysext/core/Classes/Messaging/Renderer/FlashMessageRendererInterface.php +++ b/typo3/sysext/core/Classes/Messaging/Renderer/FlashMessageRendererInterface.php @@ -28,5 +28,5 @@ interface FlashMessageRendererInterface * @param FlashMessage[] $flashMessages * @return string Representation of the flash message */ - public function render(array $flashMessages) : string; + public function render(array $flashMessages): string; } diff --git a/typo3/sysext/core/Classes/Messaging/Renderer/ListRenderer.php b/typo3/sysext/core/Classes/Messaging/Renderer/ListRenderer.php index fbc1108fd4a1..1664114b3123 100644 --- a/typo3/sysext/core/Classes/Messaging/Renderer/ListRenderer.php +++ b/typo3/sysext/core/Classes/Messaging/Renderer/ListRenderer.php @@ -55,7 +55,7 @@ class ListRenderer implements FlashMessageRendererInterface * @param FlashMessage[] $flashMessages * @return string Representation of the flash message */ - public function render(array $flashMessages) : string + public function render(array $flashMessages): string { return $this->getMessageAsMarkup($flashMessages); } @@ -67,7 +67,7 @@ public function render(array $flashMessages) : string * * @return string The message severity class name */ - protected function getClass(FlashMessage $flashMessage) : string + protected function getClass(FlashMessage $flashMessage): string { return 'alert-' . self::$classes[$flashMessage->getSeverity()]; } @@ -79,7 +79,7 @@ protected function getClass(FlashMessage $flashMessage) : string * * @return string The message severity icon name */ - protected function getIconName(FlashMessage $flashMessage) : string + protected function getIconName(FlashMessage $flashMessage): string { return self::$icons[$flashMessage->getSeverity()]; } @@ -90,7 +90,7 @@ protected function getIconName(FlashMessage $flashMessage) : string * @param FlashMessage[] $flashMessages * @return string */ - protected function getMessageAsMarkup(array $flashMessages) : string + protected function getMessageAsMarkup(array $flashMessages): string { $markup = []; $markup[] = '