Commit 61a0ef65 authored by Wouter Wolters's avatar Wouter Wolters Committed by Christian Kuhn
Browse files

[TASK] Fix PSR-2 violations with php-cs-fixer

Resolves: #79668
Releases: master
Change-Id: I78b9b85a5af2170ddb725dee969f090be1d444e3
Reviewed-on: https://review.typo3.org/51566


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 609e0a36
......@@ -45,7 +45,6 @@ class Avatar
*/
public function render(array $backendUser = null, int $size = 32, bool $showIcon = false)
{
if (!is_array($backendUser)) {
$backendUser = $this->getBackendUser()->user;
}
......@@ -58,7 +57,6 @@ class Avatar
$avatar = static::getCache()->get($cacheId);
if (!$avatar) {
$this->validateSortAndInitiateAvatarProviders();
$view = $this->getFluidTemplateObject();
......
......@@ -221,5 +221,4 @@ class AbstractProvider implements ProviderInterface
{
return '';
}
}
......@@ -17,8 +17,8 @@ namespace TYPO3\CMS\Backend\Controller;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\ContextMenu\ContextMenu;
use TYPO3\CMS\Backend\Clipboard\Clipboard;
use TYPO3\CMS\Backend\ContextMenu\ContextMenu;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;
......
......@@ -16,8 +16,8 @@ namespace TYPO3\CMS\Backend\Form\FormDataGroup;
use TYPO3\CMS\Backend\Form\FormDataGroupInterface;
use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Service\DependencyOrderingService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Calls provider with dependencies specified given by setter
......
......@@ -181,7 +181,6 @@ class FolderTreeView extends AbstractTreeView
if (!$folderObject instanceof InaccessibleFolder) {
$tableName = $this->getTableNameForClickMenu($folderObject);
$theFolderIcon = BackendUtility::wrapClickMenuOnIcon($icon, $tableName, $folderObject->getCombinedIdentifier(), 'tree');
}
} elseif ($this->ext_IconMode === 'titlelink') {
$aOnClick = 'return jumpTo(' . GeneralUtility::quoteJSvalue($this->getJumpToParam($folderObject)) . ',this,' . GeneralUtility::quoteJSvalue($this->domIdPrefix . $this->getId($folderObject)) . ',' . $this->bank . ');';
......
......@@ -54,6 +54,6 @@ class DatabaseSchemaService
$sqlString[] = implode(LF, $tableSchemas);
}
return array('sqlString' => $sqlString);
return ['sqlString' => $sqlString];
}
}
......@@ -411,7 +411,7 @@ class DataMapItem
*/
public function findDependencies(string $scope)
{
return ($this->dependencies[$scope] ?? []);
return $this->dependencies[$scope] ?? [];
}
/**
......@@ -427,4 +427,4 @@ class DataMapItem
$scopes[] = static::SCOPE_EXCLUDE;
return $scopes;
}
}
\ No newline at end of file
}
......@@ -130,10 +130,8 @@ class DataMapProcessor
$this->filterNumericIds(array_keys($idValues))
);
foreach ($idValues as $id => $values)
{
foreach ($idValues as $id => $values) {
$recordValues = $translationValues[$id] ?? [];
// $values['l10n_state'] = json_decode($values['l10n_state'], true) ?? [];
$item = DataMapItem::build(
$tableName,
$id,
......@@ -643,7 +641,6 @@ class DataMapProcessor
return $dependentIdMap;
}
/**
* Fetch all elements that depend on given record id's in their parent or source field
*
......@@ -712,7 +709,7 @@ class DataMapProcessor
{
return array_filter(
$this->items,
function(DataMapItem $item) use ($type) {
function (DataMapItem $item) use ($type) {
return $item->getType() === $type;
}
);
......@@ -729,7 +726,7 @@ class DataMapProcessor
{
return array_filter(
$ids,
function($id) use ($numeric) {
function ($id) use ($numeric) {
return MathUtility::canBeInterpretedAsInteger($id) === $numeric;
}
);
......@@ -744,7 +741,7 @@ class DataMapProcessor
protected function mapRelationItemId(array $relationItems)
{
return array_map(
function(array $relationItem) {
function (array $relationItem) {
return (string)$relationItem['id'];
},
$relationItems
......@@ -830,7 +827,7 @@ class DataMapProcessor
$configuration = $GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'];
return (
return
$configuration['type'] === 'group'
&& ($configuration['internal_type'] ?? null) === 'db'
&& !empty($configuration['allowed'])
......@@ -841,7 +838,7 @@ class DataMapProcessor
|| ($configuration['special'] ?? null) === 'languages'
)
|| $this->isInlineRelationField($tableName, $fieldName)
);
;
}
/**
......@@ -859,11 +856,11 @@ class DataMapProcessor
$configuration = $GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config'];
return (
return
$configuration['type'] === 'inline'
&& !empty($configuration['foreign_table'])
&& !empty($GLOBALS['TCA'][$configuration['foreign_table']])
);
;
}
/**
......@@ -875,11 +872,11 @@ class DataMapProcessor
*/
protected function isApplicable(string $tableName): bool
{
return (
return
State::isApplicable($tableName)
|| BackendUtility::isTableLocalizable($tableName)
&& count($this->getLocalizationModeExcludeFieldNames($tableName)) > 0
);
;
}
/**
......@@ -891,4 +888,4 @@ class DataMapProcessor
$relationHandler->setWorkspaceId($this->backendUser->workspace);
return $relationHandler;
}
}
\ No newline at end of file
}
......@@ -66,12 +66,12 @@ class State
*/
public static function isApplicable(string $tableName)
{
return (
return
static::hasColumns($tableName)
&& static::hasLanguageFieldName($tableName)
&& static::hasTranslationParentFieldName($tableName)
&& count(static::getFieldNames($tableName)) > 0
);
;
}
/**
......@@ -80,10 +80,10 @@ class State
*/
protected static function hasColumns(string $tableName)
{
return (
return
!empty($GLOBALS['TCA'][$tableName]['columns'])
&& is_array($GLOBALS['TCA'][$tableName]['columns'])
);
;
}
/**
......@@ -113,7 +113,7 @@ class State
return array_keys(
array_filter(
$GLOBALS['TCA'][$tableName]['columns'],
function(array $fieldConfiguration) {
function (array $fieldConfiguration) {
return !empty(
$fieldConfiguration['config']
['behaviour']['allowLanguageSynchronization']
......@@ -142,7 +142,7 @@ class State
* @param string $tableName
* @param array $states
*/
public function __construct(string $tableName, array $states = array())
public function __construct(string $tableName, array $states = [])
{
$this->tableName = $tableName;
$this->states = $states;
......@@ -237,7 +237,7 @@ class State
*/
public function getState(string $fieldName)
{
return ($this->states[$fieldName] ?? null);
return $this->states[$fieldName] ?? null;
}
/**
......@@ -256,7 +256,7 @@ class State
}
return array_filter(
$fieldNames,
function($fieldName) use ($desiredState) {
function ($fieldName) use ($desiredState) {
return $this->states[$fieldName] === $desiredState;
}
);
......@@ -293,4 +293,4 @@ class State
}
return $states;
}
}
\ No newline at end of file
}
......@@ -301,7 +301,7 @@ class ElementsBasicCest
*/
public function checkThatBrowserSideValidationWorks_EvalDate(Admin $I, Formhandler $formhandler)
{
$this->skip("Instable Test is skipped due to repeated failure");
$this->skip('Instable Test is skipped due to repeated failure');
//@todo fix this test
$this->waitForFormReady($I);
......@@ -418,7 +418,7 @@ class ElementsBasicCest
public function checkThatValidationWorks_EvalDateTime_DbTypeDateTime(Admin $I, Formhandler $formhandler)
{
$this->skip("Instable Test is skipped due to repeated failure");
$this->skip('Instable Test is skipped due to repeated failure');
//@todo fix this test
$this->waitForFormReady($I);
$testData = [
......@@ -498,9 +498,9 @@ class ElementsBasicCest
public function checkThatValidationWorks_evalTimesec(Admin $I, Formhandler $formhandler)
{
$this->skip("Instable Test is skipped due to repeated failure");
$this->skip('Instable Test is skipped due to repeated failure');
//@todo fix this test
$this->waitForFormReady($I);
$testData = [
'input_18 eval=timesec' => [
......
......@@ -16,9 +16,9 @@ namespace TYPO3\CMS\Core\Tests\Unit\Resource\Driver;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamWrapper;
use TYPO3\Components\TestingFramework\Core\FileStreamWrapper;
use TYPO3\CMS\Core\Resource\Exception\InvalidFileNameException;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\Components\TestingFramework\Core\FileStreamWrapper;
/**
* Testcase for the local storage driver class of the TYPO3 VFS
......
......@@ -16,12 +16,12 @@ namespace TYPO3\CMS\Core\Tests\Unit\ViewHelpers;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\ViewHelpers\IconForRecordViewHelper;
use TYPO3\CMS\Core\ViewHelpers\IconViewHelper;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
/**
......
......@@ -15,12 +15,12 @@ namespace TYPO3\CMS\Core\Tests\Unit\ViewHelpers;
*/
use Prophecy\Argument;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Type\Icon\IconState;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\ViewHelpers\IconViewHelper;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
/**
* Test case
......
......@@ -76,7 +76,6 @@ $signalSlotDispatcher->connect(
'getLocalizationRequiredDatabaseSchema'
);
unset($signalSlotDispatcher);
$GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['dumpFile'] = \TYPO3\CMS\Core\Controller\FileDumpController::class . '::dumpAction';
......
......@@ -261,7 +261,8 @@ class FileProvider extends \TYPO3\CMS\Backend\ContextMenu\ItemProviders\Abstract
* @param File|Folder $fileOrFolderInClipBoard
* @return bool
*/
protected function isFoldersAreInTheSameRoot($fileOrFolderInClipBoard): bool {
protected function isFoldersAreInTheSameRoot($fileOrFolderInClipBoard): bool
{
return (!$fileOrFolderInClipBoard instanceof Folder)
|| (
$this->record->getStorage()->getRootLevelFolder()->getCombinedIdentifier()
......
......@@ -15,12 +15,7 @@ namespace TYPO3\CMS\Filelist\ContextMenu\ItemProviders;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Provides click menu items for file_storage
......
......@@ -15,12 +15,7 @@ namespace TYPO3\CMS\Filelist\ContextMenu\ItemProviders;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Provides click menu items for filemounts
......
......@@ -14,8 +14,8 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3\CMS\Fluid\ViewHelpers\BaseViewHelper;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
/**
*/
......
......@@ -15,10 +15,10 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
*/
use Prophecy\Argument;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\ViewHelpers\CObjectViewHelper;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
/**
* Class CObjectViewHelperTest
......
......@@ -14,10 +14,10 @@ namespace TYPO3\CMS\Fluid\Tests\Unit\ViewHelpers;
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
use TYPO3\CMS\Fluid\ViewHelpers\FlashMessagesViewHelper;
use TYPO3\Components\TestingFramework\Fluid\Unit\ViewHelpers\ViewHelperBaseTestcase;
/**
* Testcase for FlashMessagesViewHelper
......
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