Commit 7dcf08b8 authored by Georg Ringer's avatar Georg Ringer Committed by Wouter Wolters
Browse files

[TASK] Add rule "return_type_declaration" to php-cs-fixer

Unify the space before the colon of return type.

Resolves: #84515
Releases: master, 8.7
Change-Id: Ie107e574965f834c8fcaa8c2aa4f44f7cc41d7c5
Reviewed-on: https://review.typo3.org/56414

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 591fd650
......@@ -83,5 +83,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);
......@@ -171,7 +171,7 @@ class UserToolbarItem implements ToolbarItemInterface
*
* @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']);
......
......@@ -291,7 +291,7 @@ class ElementInformationController
*
* @return array
*/
protected function getPageTitle() : array
protected function getPageTitle(): array
{
$pageTitle = [
'title' => BackendUtility::getRecordTitle($this->table, $this->row, false)
......@@ -315,7 +315,7 @@ class ElementInformationController
*
* @return array
*/
protected function getPreview() : array
protected function getPreview(): array
{
$preview = [];
// Perhaps @todo in future: Also display preview for records - without fileObject
......@@ -361,7 +361,7 @@ class ElementInformationController
*
* @return array
*/
protected function getPropertiesForTable() : array
protected function getPropertiesForTable(): array
{
$propertiesForTable = [];
$lang = $this->getLanguageService();
......@@ -470,7 +470,7 @@ class ElementInformationController
* @param ServerRequestInterface $request
* @return array
*/
protected function getReferences(ServerRequestInterface $request) : array
protected function getReferences(ServerRequestInterface $request): array
{
$references = [];
switch ($this->type) {
......
......@@ -954,7 +954,7 @@ abstract class AbstractItemProvider
* @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();
......
......@@ -735,7 +735,7 @@ class ModuleTemplate
/**
* @return bool
*/
public function isUiBlock() : bool
public function isUiBlock(): bool
{
return $this->uiBlock;
}
......
......@@ -1527,7 +1527,7 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
* @internal
* @return string
*/
public function getSessionId() : string
public function getSessionId(): string
{
return $this->id;
}
......@@ -1536,7 +1536,7 @@ abstract class AbstractUserAuthentication implements LoggerAwareInterface
* @internal
* @return string
*/
public function getLoginType() : string
public function getLoginType(): string
{
return $this->loginType;
}
......
......@@ -138,7 +138,7 @@ class Richtext
/**
* @return BackendUserAuthentication
*/
protected function getBackendUser() : BackendUserAuthentication
protected function getBackendUser(): BackendUserAuthentication
{
return $GLOBALS['BE_USER'];
}
......@@ -176,7 +176,7 @@ class Richtext
* @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);
......
......@@ -372,7 +372,7 @@ class ReferenceIndex implements LoggerAwareInterface
* @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'];
......
......@@ -54,7 +54,7 @@ abstract class AbstractMessage implements \JsonSerializable
*
* @return string The message's title.
*/
public function getTitle() : string
public function getTitle(): string
{
return $this->title;
}
......@@ -74,7 +74,7 @@ abstract class AbstractMessage implements \JsonSerializable
*
* @return string The message.
*/
public function getMessage() : string
public function getMessage(): string
{
return $this->message;
}
......@@ -94,7 +94,7 @@ abstract class AbstractMessage implements \JsonSerializable
*
* @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;
}
......
......@@ -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 @@ class FlashMessageRendererResolver
*
* @return string
*/
protected function resolveFlashMessageRenderClass() : string
protected function resolveFlashMessageRenderClass(): string
{
$context = $this->resolveContext();
$renderClass = $this->renderer['_default'];
......@@ -77,7 +77,7 @@ class FlashMessageRendererResolver
*
* @return string
*/
protected function resolveContext() : string
protected function resolveContext(): string
{
$context = '';
if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) {
......
......@@ -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(
......
......@@ -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 @@ class BootstrapRenderer implements FlashMessageRendererInterface
*
* @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 @@ class BootstrapRenderer implements FlashMessageRendererInterface
*
* @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 @@ class BootstrapRenderer implements FlashMessageRendererInterface
* @param FlashMessage[] $flashMessages
* @return string
*/
protected function getMessageAsMarkup(array $flashMessages) : string
protected function getMessageAsMarkup(array $flashMessages): string
{
$markup = [];
$markup[] = '<div class="typo3-messages">';
......
......@@ -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;
}
......@@ -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 @@ class ListRenderer implements FlashMessageRendererInterface
*
* @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 @@ class ListRenderer implements FlashMessageRendererInterface
*
* @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 @@ class ListRenderer implements FlashMessageRendererInterface
* @param FlashMessage[] $flashMessages
* @return string
*/
protected function getMessageAsMarkup(array $flashMessages) : string
protected function getMessageAsMarkup(array $flashMessages): string
{
$markup = [];
$markup[] = '<ul class="typo3-messages">';
......
......@@ -56,7 +56,7 @@ class PlaintextRenderer implements FlashMessageRendererInterface
* @param FlashMessage[] $flashMessages
* @return string Representation of the flash message as plain text
*/
public function render(array $flashMessages) : string
public function render(array $flashMessages): string
{
$messages = [];
......
......@@ -46,7 +46,7 @@ interface SessionBackendInterface
*
* @return array Return a list of all user sessions. The list may be empty.
*/
public function getAll() : array;
public function getAll(): array;
/**
* Read session data
......@@ -55,7 +55,7 @@ interface SessionBackendInterface
* @return array Returns the session data
* @throws SessionNotFoundException
*/
public function get(string $sessionId) : array;
public function get(string $sessionId): array;
/**
* Delete a session record
......@@ -63,7 +63,7 @@ interface SessionBackendInterface
* @param string $sessionId
* @return bool true if the session was deleted, false it session could not be found
*/
public function remove(string $sessionId) : bool;
public function remove(string $sessionId): bool;
/**
* Write session data. This method prevents overriding existing session data.
......@@ -75,7 +75,7 @@ interface SessionBackendInterface
* @return array The newly created session record.
* @throws SessionNotCreatedException
*/
public function set(string $sessionId, array $sessionData) : array;
public function set(string $sessionId, array $sessionData): array;
/**
* Updates the session data.
......@@ -87,7 +87,7 @@ interface SessionBackendInterface
* @return array $sessionData The newly updated session record.
* @throws SessionNotUpdatedException
*/
public function update(string $sessionId, array $sessionData) : array;
public function update(string $sessionId, array $sessionData): array;
/**
* Garbage Collection
......
......@@ -45,7 +45,7 @@ class SessionManager implements SingletonInterface
* @return SessionBackendInterface
* @throws \InvalidArgumentException
*/
public function getSessionBackend(string $identifier) : SessionBackendInterface
public function getSessionBackend(string $identifier): SessionBackendInterface
{
if (!isset($this->sessionBackends[$identifier])) {
$configuration = $GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier] ?? false;
......@@ -70,7 +70,7 @@ class SessionManager implements SingletonInterface
* @return SessionBackendInterface
* @throws \InvalidArgumentException
*/
protected function createSessionBackendFromConfiguration(string $identifier, array $configuration) : SessionBackendInterface
protected function createSessionBackendFromConfiguration(string $identifier, array $configuration): SessionBackendInterface
{
$className = $configuration['backend'];
......
......@@ -103,7 +103,7 @@ class StringUtility
* @param string $selector
* @return string
*/
public static function escapeCssSelector(string $selector) : string
public static function escapeCssSelector(string $selector): string
{
return preg_replace('/([#:.\\[\\],=@])/', '\\\\$1', $selector);
}
......
......@@ -233,7 +233,7 @@ class StringUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
/**
* @return array
*/
public function escapeCssSelectorDataProvider() : array
public function escapeCssSelectorDataProvider(): array
{
return [
['data.field', 'data\\.field'],
......
......@@ -28,7 +28,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
* @param array $conf Array of TypoScript properties
* @return string
*/
public function render($conf = []) : string
public function render($conf = []): string
{
$renderMode = isset($conf['renderMode.'])
? $this->cObj->stdWrap($conf['renderMode'], $conf['renderMode.'])
......@@ -46,7 +46,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
*
* @return string
*/
protected function renderInline(array $conf) : string
protected function renderInline(array $conf): string
{
$src = $this->resolveAbsoluteSourcePath($conf);
list($width, $height, $isDefaultWidth, $isDefaultHeight) = $this->getDimensions($conf);
......@@ -88,7 +88,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
*
* @return string
*/
protected function renderObject(array $conf) : string
protected function renderObject(array $conf): string
{
$src = $this->resolveAbsoluteSourcePath($conf);
list($width, $height) = $this->getDimensions($conf);
......@@ -139,7 +139,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
*
* @return string
*/
protected function resolveAbsoluteSourcePath(array $conf) : string
protected function resolveAbsoluteSourcePath(array $conf): string
{
$src = isset($conf['src.']) ? $this->cObj->stdWrap($conf['src'], $conf['src.']) : $conf['src'];
return GeneralUtility::getFileAbsFileName($src);
......@@ -150,7 +150,7 @@ class ScalableVectorGraphicsContentObject extends AbstractContentObject
*
* @return array
*/
protected function getDimensions(array $conf) : array
protected function getDimensions(array $conf): array
{
$isDefaultWidth = false;
$isDefaultHeight = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment