Commit d0abdc0e authored by Wouter Wolters's avatar Wouter Wolters Committed by Andreas Fernandez
Browse files

[TASK] Add more fixers for php-cs-fixer

Resolves: #77701
Releases: master
Change-Id: Id5f32eb76ac3adddd834160bc79828fefd0ce63c
Reviewed-on: https://review.typo3.org/49665

Tested-by: default avatarBamboo TYPO3com <info@typo3.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
parent 38394b79
......@@ -69,6 +69,17 @@ return Symfony\CS\Config\Config::create()
'phpdoc_no_package',
'phpdoc_scalar',
'no_empty_lines_after_phpdocs',
'short_array_syntax'
'short_array_syntax',
'array_element_white_space_after_comma',
'function_typehint_space',
'hash_to_slash_comment',
'join_function',
'lowercase_cast',
'namespace_no_leading_whitespace',
'native_function_casing',
'no_empty_statement',
'self_accessor',
'short_bool_cast',
'unneeded_control_parentheses'
])
->finder($finder);
......@@ -554,7 +554,9 @@ class NewContentElementController extends AbstractModule
{
if (isset($wizardGroup[$key])) {
$wizardGroup[$key] = GeneralUtility::trimExplode(',', $wizardGroup[$key]);
$wizardGroup[$key] = array_map(function ($s) {return $s . '.';}, $wizardGroup[$key]);
$wizardGroup[$key] = array_map(function ($s) {
return $s . '.';
}, $wizardGroup[$key]);
}
}
......
<?php
declare (strict_types = 1);
declare(strict_types=1);
namespace TYPO3\CMS\Backend\Controller;
/*
......
......@@ -162,7 +162,7 @@ abstract class AbstractItemProvider
$special = $result['processedTca']['columns'][$fieldName]['config']['special'];
switch (true) {
case ($special === 'tables'):
case $special === 'tables':
foreach ($GLOBALS['TCA'] as $currentTable => $_) {
if (!empty($GLOBALS['TCA'][$currentTable]['ctrl']['adminOnly'])) {
// Hide "admin only" tables
......@@ -180,7 +180,7 @@ abstract class AbstractItemProvider
$items[] = [$label, $currentTable, $icon, $helpText];
}
break;
case ($special === 'pagetypes'):
case $special === 'pagetypes':
if (isset($GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'])
&& is_array($GLOBALS['TCA']['pages']['columns']['doktype']['config']['items'])
) {
......@@ -197,7 +197,7 @@ abstract class AbstractItemProvider
}
}
break;
case ($special === 'exclude'):
case $special === 'exclude':
$excludeArrays = $this->getExcludeFields();
foreach ($excludeArrays as $excludeArray) {
// If the field comes from a FlexForm, the syntax is more complex
......@@ -240,7 +240,7 @@ abstract class AbstractItemProvider
];
}
break;
case ($special === 'explicitValues'):
case $special === 'explicitValues':
$theTypes = $this->getExplicitAuthFieldValues();
$icons = [
'ALLOW' => 'status-status-permission-granted',
......@@ -266,7 +266,7 @@ abstract class AbstractItemProvider
}
}
break;
case ($special === 'languages'):
case $special === 'languages':
foreach ($result['systemLanguageRows'] as $language) {
if ($language['uid'] !== -1) {
$items[] = [
......@@ -277,7 +277,7 @@ abstract class AbstractItemProvider
}
}
break;
case ($special === 'custom'):
case $special === 'custom':
$customOptions = $GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions'];
if (is_array($customOptions)) {
foreach ($customOptions as $coKey => $coValue) {
......@@ -305,7 +305,7 @@ abstract class AbstractItemProvider
}
}
break;
case ($special === 'modListGroup' || $special === 'modListUser'):
case $special === 'modListGroup' || $special === 'modListUser':
/** @var ModuleLoader $loadModules */
$loadModules = GeneralUtility::makeInstance(ModuleLoader::class);
$loadModules->load($GLOBALS['TBE_MODULES']);
......
......@@ -949,7 +949,7 @@ class RecordHistory
);
}
return ($this->pageAccessCache[$pageId] !== false);
return $this->pageAccessCache[$pageId] !== false;
}
/**
......
......@@ -102,7 +102,7 @@ class RequestHandler implements RequestHandlerInterface
*/
public function canHandleRequest(ServerRequestInterface $request)
{
return (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI));
return TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_BE && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI);
}
/**
......
......@@ -442,7 +442,7 @@ abstract class AbstractRecordList
$this->pageOverlays = [];
while ($row = $result->fetch()) {
$this->pageOverlays[$row['sys_language_uid']] = $row;
};
}
$this->languageIconTitles = $this->getTranslateTools()->getSystemLanguages($this->id);
}
......
......@@ -127,7 +127,7 @@ class HelpButton implements ButtonInterface, PositionInterface
*/
public function isValid()
{
return (!empty($this->moduleName));
return !empty($this->moduleName);
}
/**
......
......@@ -191,9 +191,9 @@ class ShortcutButton implements ButtonInterface, PositionInterface
{
$this->preProcess();
return (
return
!empty($this->moduleName)
);
;
}
/**
......
......@@ -82,7 +82,7 @@ class FullyRenderedButton implements ButtonInterface
{
if (
trim($this->getHtmlSource()) !== ''
&& $this->getType() === FullyRenderedButton::class
&& $this->getType() === self::class
) {
return true;
}
......
......@@ -132,7 +132,7 @@ class InputButton extends AbstractButton implements ButtonInterface
trim($this->getName()) !== ''
&& trim($this->getValue()) !== ''
&& trim($this->getTitle()) !== ''
&& $this->getType() === InputButton::class
&& $this->getType() === self::class
&& $this->getIcon() !== null
) {
return true;
......
......@@ -74,7 +74,7 @@ class LinkButton extends AbstractButton implements ButtonInterface
if (
trim($this->getHref()) !== ''
&& trim($this->getTitle()) !== ''
&& $this->getType() === LinkButton::class
&& $this->getType() === self::class
&& $this->getIcon() !== null
) {
return true;
......
......@@ -137,6 +137,6 @@ class Menu
*/
public function isValid(Menu $menu)
{
return (trim($menu->getIdentifier()) !== '');
return trim($menu->getIdentifier()) !== '';
}
}
......@@ -355,7 +355,7 @@ class ExtdirectTreeCommands
// Clean JSON-serialized ampersands ('&')
// @see GeneralUtility::quoteJSvalue()
$extractedLink = json_decode('"' . trim($match[1], '"') . '"', JSON_HEX_AMP);
};
}
return $extractedLink;
}
......
......@@ -264,11 +264,11 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function canBeCut()
{
return (
return
$this->canEdit($this->record)
&& !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
&& $GLOBALS['BE_USER']->checkLanguageAccess(0)
);
;
}
/**
......@@ -288,11 +288,11 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function canBeCopied()
{
return (
return
$GLOBALS['BE_USER']->doesUserHaveAccess($this->record, 1)
&& !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
&& $GLOBALS['BE_USER']->checkLanguageAccess(0)
);
;
}
/**
......@@ -312,11 +312,11 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function canBeRemoved()
{
return (
return
$this->canRemove($this->record)
&& !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
&& $GLOBALS['BE_USER']->checkLanguageAccess(0)
);
;
}
/**
......@@ -326,11 +326,11 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function canBePastedInto()
{
return (
return
$this->canCreate($this->record)
&& !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
&& $GLOBALS['BE_USER']->checkLanguageAccess(0)
);
;
}
/**
......@@ -340,11 +340,11 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function canBePastedAfter()
{
return (
return
$this->canCreate($this->record)
&& !VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
&& $GLOBALS['BE_USER']->checkLanguageAccess(0)
);
;
}
/**
......@@ -394,10 +394,10 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode
*/
public function isDeleted()
{
return (
return
!empty($this->record['deleted'])
|| VersionState::cast($this->record['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)
);
;
}
/**
......
......@@ -63,7 +63,7 @@ class ExtJsJsonTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\AbstractTre
} else {
$iconMarkup = $node->getIcon();
}
$nodeArray = array(
$nodeArray = [
'iconTag' => $iconMarkup,
'text' => htmlspecialchars($node->getLabel()),
'leaf' => !$node->hasChildNodes(),
......@@ -76,7 +76,7 @@ class ExtJsJsonTreeRenderer extends \TYPO3\CMS\Backend\Tree\Renderer\AbstractTre
'identifier' => htmlspecialchars($node->getId()),
//no need for htmlspecialhars here as d3 is using 'textContent' property of the HTML DOM node
'name' => $node->getLabel(),
);
];
return $nodeArray;
}
......
......@@ -2256,7 +2256,7 @@ class BackendUtility
foreach (GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$theColConf['foreign_table']]['ctrl']['label_alt'], true) as $f) {
$MMfields[] = $theColConf['foreign_table'] . '.' . $f;
}
$MMfield = join(',', $MMfields);
$MMfield = implode(',', $MMfields);
}
/** @var $dbGroup RelationHandler */
$dbGroup = GeneralUtility::makeInstance(RelationHandler::class);
......@@ -2404,7 +2404,7 @@ class BackendUtility
$MMfields[] = $theColConf['foreign_table'] . '.' . $f;
}
}
$MMfield = join(',', $MMfields);
$MMfield = implode(',', $MMfields);
}
/** @var $dbGroup RelationHandler */
$dbGroup = GeneralUtility::makeInstance(RelationHandler::class);
......@@ -3056,7 +3056,7 @@ class BackendUtility
'uPT' => 1,
'vC' => static::getBackendUserAuthentication()->veriCode()
];
$url = BackendUtility::getModuleUrl('tce_db', $urlParameters) . $parameters . '&redirect=';
$url = self::getModuleUrl('tce_db', $urlParameters) . $parameters . '&redirect=';
if ((int)$redirectUrl === -1) {
$url = GeneralUtility::quoteJSvalue($url) . '+T3_THIS_LOCATION';
} else {
......@@ -4229,7 +4229,7 @@ class BackendUtility
$outputRows[] = $row;
} else {
// Select UID version:
$row = BackendUtility::getRecord($table, $uid, $fields, '', !$includeDeletedRecords);
$row = self::getRecord($table, $uid, $fields, '', !$includeDeletedRecords);
// Add rows to output array:
if ($row) {
$row['_CURRENT_VERSION'] = true;
......@@ -4701,7 +4701,7 @@ class BackendUtility
// -2 means "show at any login". We simulate first available fe_group.
/** @var PageRepository $sysPage */
$sysPage = GeneralUtility::makeInstance(PageRepository::class);
$activeFeGroupRow = BackendUtility::getRecordRaw(
$activeFeGroupRow = self::getRecordRaw(
'fe_groups',
'1=1' . $sysPage->enableFields('fe_groups'),
'uid'
......
......@@ -58,7 +58,7 @@ class BackendLayout
public static function create($identifier, $title, $configuration)
{
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
BackendLayout::class,
self::class,
$identifier,
$title,
$configuration
......
......@@ -169,7 +169,7 @@ class DefaultDataProvider implements DataProviderInterface
if (!empty($GLOBALS['TCA'][$this->tableName]['ctrl']['sortby'])) {
$queryBuilder->orderBy($GLOBALS['TCA'][$this->tableName]['ctrl']['sortby']);
};
}
$results = $queryBuilder
->execute()
......
......@@ -1216,7 +1216,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
if (!empty($GLOBALS['TCA']['pages']['ctrl']['sortby'])) {
$queryBuilder->orderBy($GLOBALS['TCA']['pages']['ctrl']['sortby']);
};
}
if ($depth >= 0) {
$result = $queryBuilder->execute();
......@@ -1278,7 +1278,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
if (!empty($GLOBALS['TCA']['pages']['ctrl']['sortby'])) {
$queryBuilder->orderBy($GLOBALS['TCA']['pages']['ctrl']['sortby']);
};
}
if (!empty($qWhere)) {
$queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($qWhere));
......
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