Skip to content

Commit

Permalink
[TASK] Add rule "return_type_declaration" to php-cs-fixer
Browse files Browse the repository at this point in the history
Unify the space before the colon of return type.

Resolves: #84515
Releases: master, 8.7
Change-Id: Ie107e574965f834c8fcaa8c2aa4f44f7cc41d7c5
Reviewed-on: https://review.typo3.org/56553
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
georgringer committed Apr 4, 2018
1 parent d0da431 commit 37869c6
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 47 deletions.
1 change: 1 addition & 0 deletions Build/.php_cs
Expand Up @@ -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);
Expand Up @@ -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']);
Expand Down
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -318,7 +318,7 @@ protected function getPreview() : array
*
* @return array
*/
protected function getPropertiesForTable() : array
protected function getPropertiesForTable(): array
{
$propertiesForTable = [];
$lang = $this->getLanguageService();
Expand Down Expand Up @@ -426,7 +426,7 @@ protected function getPropertiesForTable() : array
*
* @return array
*/
protected function getReferences() : array
protected function getReferences(): array
{
$references = [];
switch ($this->type) {
Expand All @@ -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'))];
}
Expand Down Expand Up @@ -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();
Expand Down
Expand Up @@ -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);
Expand Down
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Classes/Template/ModuleTemplate.php
Expand Up @@ -740,7 +740,7 @@ protected function getFlashMessageQueue()
/**
* @return bool
*/
public function isUiBlock() : bool
public function isUiBlock(): bool
{
return $this->uiBlock;
}
Expand Down
Expand Up @@ -1609,7 +1609,7 @@ public function fetchUserRecord($dbUser, $username, $extraWhere = '')
* @internal
* @return string
*/
public function getSessionId() : string
public function getSessionId(): string
{
return $this->id;
}
Expand All @@ -1618,7 +1618,7 @@ public function getSessionId() : string
* @internal
* @return string
*/
public function getLoginType() : string
public function getLoginType(): string
{
return $this->loginType;
}
Expand Down
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/Configuration/Richtext.php
Expand Up @@ -141,7 +141,7 @@ protected function convertPlainArrayToTypoScriptArray(array $plainArray)
/**
* @return BackendUserAuthentication
*/
protected function getBackendUser() : BackendUserAuthentication
protected function getBackendUser(): BackendUserAuthentication
{
return $GLOBALS['BE_USER'];
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Database/ReferenceIndex.php
Expand Up @@ -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'];
Expand Down
6 changes: 3 additions & 3 deletions typo3/sysext/core/Classes/Messaging/AbstractMessage.php
Expand Up @@ -54,7 +54,7 @@ abstract class AbstractMessage
*
* @return string The message's title.
*/
public function getTitle() : string
public function getTitle(): string
{
return $this->title;
}
Expand All @@ -74,7 +74,7 @@ public function setTitle(string $title)
*
* @return string The message.
*/
public function getMessage() : string
public function getMessage(): string
{
return $this->message;
}
Expand All @@ -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;
}
Expand Down
Expand Up @@ -40,7 +40,7 @@ class FlashMessageRendererResolver
*
* @return FlashMessageRendererInterface
*/
public function resolve() : FlashMessageRendererInterface
public function resolve(): FlashMessageRendererInterface
{
$rendererClass = $this->resolveFlashMessageRenderClass();
$renderer = GeneralUtility::makeInstance($rendererClass);
Expand All @@ -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'];
Expand All @@ -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) {
Expand Down
Expand Up @@ -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(
Expand Down
Expand Up @@ -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);
}
Expand All @@ -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()];
}
Expand All @@ -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()];
}
Expand All @@ -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[] = '<div class="typo3-messages">';
Expand Down
Expand Up @@ -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;
}
8 changes: 4 additions & 4 deletions typo3/sysext/core/Classes/Messaging/Renderer/ListRenderer.php
Expand Up @@ -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);
}
Expand All @@ -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()];
}
Expand All @@ -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()];
}
Expand All @@ -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[] = '<ul class="typo3-messages">';
Expand Down
Expand Up @@ -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 = [];

Expand Down
Expand Up @@ -46,7 +46,7 @@ public function validateConfiguration();
*
* @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
Expand All @@ -55,15 +55,15 @@ public function getAll() : array;
* @return array Returns the session data
* @throws SessionNotFoundException
*/
public function get(string $sessionId) : array;
public function get(string $sessionId): array;

/**
* Delete a session record
*
* @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.
Expand All @@ -75,7 +75,7 @@ public function remove(string $sessionId) : bool;
* @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.
Expand All @@ -87,7 +87,7 @@ public function set(string $sessionId, array $sessionData) : array;
* @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
Expand Down
4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/Session/SessionManager.php
Expand Up @@ -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])) {
if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier]) || !is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['session'][$identifier])) {
Expand All @@ -70,7 +70,7 @@ public function getSessionBackend(string $identifier) : SessionBackendInterface
* @return SessionBackendInterface
* @throws \InvalidArgumentException
*/
protected function createSessionBackendFromConfiguration(string $identifier, array $configuration) : SessionBackendInterface
protected function createSessionBackendFromConfiguration(string $identifier, array $configuration): SessionBackendInterface
{
$className = $configuration['backend'];

Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Utility/StringUtility.php
Expand Up @@ -103,7 +103,7 @@ public static function getUniqueId($prefix = '')
* @param string $selector
* @return string
*/
public static function escapeCssSelector(string $selector) : string
public static function escapeCssSelector(string $selector): string
{
return preg_replace('/([#:.\\[\\],=@])/', '\\\\$1', $selector);
}
Expand Down
Expand Up @@ -47,7 +47,7 @@ public function initializeArguments()
*
* @return string
*/
public function render() : string
public function render(): string
{
$table = $this->arguments['table'];
$size = $this->arguments['size'];
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/core/Tests/Unit/Utility/StringUtilityTest.php
Expand Up @@ -232,7 +232,7 @@ public function escapeCssSelector(string $selector, string $expectedValue)
/**
* @return array
*/
public function escapeCssSelectorDataProvider() : array
public function escapeCssSelectorDataProvider(): array
{
return [
['data.field', 'data\\.field'],
Expand Down
Expand Up @@ -29,5 +29,5 @@ interface TypolinkModifyLinkConfigForPageLinksHookInterface
*
* @return array The modified $linkConfiguration
*/
public function modifyPageLinkConfiguration(array $linkConfiguration, array $linkDetails, array $pageRow) : array;
public function modifyPageLinkConfiguration(array $linkConfiguration, array $linkDetails, array $pageRow): array;
}
Expand Up @@ -247,7 +247,7 @@ public function forceAbsoluteUrlReturnsCorrectAbsoluteUrlWithSubfolder()
*
* @return array [[$expected, $conf, $name, $respectFrameSetOption, $fallbackTarget],]
*/
public function resolveTargetAttributeDataProvider() : array
public function resolveTargetAttributeDataProvider(): array
{
$targetName = $this->getUniqueId('name_');
$target = $this->getUniqueId('target_');
Expand Down

0 comments on commit 37869c6

Please sign in to comment.