Skip to content

Commit

Permalink
[TASK] Bump friendsofphp/php-cs-fixer:^3.37.1
Browse files Browse the repository at this point in the history
Minor CGL streamlinings from latest php-cs-fixer.

> composer req --dev friendsofphp/php-cs-fixer:^3.37.1
> Build/Scripts/runTests.sh -s cgl

Resolves: #102285
Releases: main, 12.4, 11.5
Change-Id: I0cc1fe3c0f81f62a49df00d62d57ef3c593c57df
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81611
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Oct 30, 2023
1 parent 3878632 commit c7ea9e7
Show file tree
Hide file tree
Showing 21 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -113,7 +113,7 @@
"composer/composer": "^2.2.22",
"composer/package-versions-deprecated": "^1.11.99.4",
"cweagans/composer-patches": "^1.7.1",
"friendsofphp/php-cs-fixer": "^3.35.1",
"friendsofphp/php-cs-fixer": "^3.37.1",
"friendsoftypo3/phpstan-typo3": "^0.9.0",
"jangregor/phpstan-prophecy": "^1.0",
"php-webdriver/webdriver": "^1.12.0",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -314,7 +314,7 @@ protected function getPreview(): array
// Check if there is a FileRenderer
if ($fileRenderer !== null) {
$preview['fileRenderer'] = $fileRenderer->render($this->fileObject, $width, $height);
// else check if we can create an Image preview
// else check if we can create an Image preview
} elseif ($this->fileObject->isImage()) {
$preview['fileObject'] = $this->fileObject;
$preview['width'] = $width;
Expand Down
Expand Up @@ -406,7 +406,7 @@ protected function checkRedirect(ServerRequestInterface $request): void
if ($this->loginRefresh) {
$formProtection->setSessionTokenFromRegistry();
$formProtection->persistSessionToken();
// triggering `TYPO3/CMS/Backend/LoginRefresh` module happens in `TYPO3/CMS/Backend/Login`
// triggering `TYPO3/CMS/Backend/LoginRefresh` module happens in `TYPO3/CMS/Backend/Login`
} else {
$formProtection->storeSessionTokenInRegistry();
$this->redirectToUrl();
Expand Down
Expand Up @@ -184,7 +184,7 @@ protected function createEntryFromRawData(array $module)
// @deprecated since TYPO3 v11, will be removed in TYPO3 v12.0
if (!empty($module['navigationFrameScript']) && is_string($module['navigationFrameScript'])) {
$entry->setNavigationFrameScript($module['navigationFrameScript']);
// @deprecated since TYPO3 v11, will be removed in TYPO3 v12.0
// @deprecated since TYPO3 v11, will be removed in TYPO3 v12.0
} elseif (!empty($module['parentNavigationFrameScript']) && is_string($module['parentNavigationFrameScript'])) {
$entry->setNavigationFrameScript($module['parentNavigationFrameScript']);
}
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/backend/Classes/Form/InlineStackProcessor.php
Expand Up @@ -284,7 +284,7 @@ protected function getStructureItemName($levelData, $disposal = 'Disposal_Attrib
$parts[] = implode('][', $levelData['flexform']);
}
$name = '[' . implode('][', $parts) . ']';
// Use in object id attributes:
// Use in object id attributes:
} else {
$name = implode('-', $parts);

Expand Down
Expand Up @@ -591,8 +591,8 @@ public function checkAuthentication(ServerRequestInterface $request = null)
break;
}
}
// mimic user authentication to mitigate observable timing discrepancies
// @link https://cwe.mitre.org/data/definitions/208.html
// mimic user authentication to mitigate observable timing discrepancies
// @link https://cwe.mitre.org/data/definitions/208.html
} elseif ($activeLogin) {
$subType = 'authUser' . $this->loginType;
foreach ($this->getAuthServices($subType, $loginData, $authInfo) as $serviceObj) {
Expand Down
12 changes: 6 additions & 6 deletions typo3/sysext/core/Classes/DataHandling/DataHandler.php
Expand Up @@ -3862,7 +3862,7 @@ protected function copyRecord_processInline(
} else {
if (!MathUtility::canBeInterpretedAsInteger($realDestPid)) {
$newId = $this->copyRecord($v['table'], $v['id'], -(int)($v['id']));
// If the destination page id is a NEW string, keep it on the same page
// If the destination page id is a NEW string, keep it on the same page
} elseif ($this->BE_USER->workspace > 0 && BackendUtility::isTableWorkspaceEnabled($v['table'])) {
// A filled $workspaceOptions indicated that this call
// has it's origin in previous versionizeRecord() processing
Expand All @@ -3876,7 +3876,7 @@ protected function copyRecord_processInline(
$workspaceOptions['label'] ?? 'Auto-created for WS #' . $this->BE_USER->workspace,
$workspaceOptions['delete'] ?? false
);
// Otherwise just use plain copyRecord() to create placeholders etc.
// Otherwise just use plain copyRecord() to create placeholders etc.
} else {
// If a record has been copied already during this request,
// prevent superfluous duplication and use the existing copy
Expand Down Expand Up @@ -8135,15 +8135,15 @@ protected function isSubmittedValueEqualToStoredValue($submittedValue, $storedVa
// Thus, check whether strings are the same or whether integer values are empty ("0" or "").
if (!$allowNull) {
$result = (string)$submittedValue === (string)$storedValue || $storedType === 'int' && (int)$storedValue === (int)$submittedValue;
// Null values are allowed, but currently there's a real (not NULL) value.
// Thus, ensure no NULL value was submitted and fallback to the regular behaviour.
// Null values are allowed, but currently there's a real (not NULL) value.
// Thus, ensure no NULL value was submitted and fallback to the regular behaviour.
} elseif ($storedValue !== null) {
$result = (
$submittedValue !== null
&& $this->isSubmittedValueEqualToStoredValue($submittedValue, $storedValue, $storedType, false)
);
// Null values are allowed, and currently there's a NULL value.
// Thus, check whether a NULL value was submitted.
// Null values are allowed, and currently there's a NULL value.
// Thus, check whether a NULL value was submitted.
} else {
$result = ($submittedValue === null);
}
Expand Down
Expand Up @@ -1068,7 +1068,7 @@ protected function fetchDependentIdMap(string $tableName, array $ids, int $desir
// implicit: use origin pointer if table cannot be translated
if (!$isTranslatable) {
$ancestorId = (int)$dependentElement[$fieldNames['origin']];
// only consider element if it reflects the desired language
// only consider element if it reflects the desired language
} elseif ((int)$dependentElement[$fieldNames['language']] === $desiredLanguage) {
$ancestorId = $this->resolveAncestorId($fieldNames, $dependentElement);
} else {
Expand Down
Expand Up @@ -44,7 +44,7 @@ public function connect(array $params, $username = null, $password = null, array

if (defined('PDO::PGSQL_ATTR_DISABLE_PREPARES')
&& (
! isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES])
!isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES])
|| $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES] === true
)
) {
Expand Down
16 changes: 8 additions & 8 deletions typo3/sysext/core/Classes/Html/SimpleParser.php
Expand Up @@ -132,53 +132,53 @@ protected function process(string $string): void
$this->next(SimpleNode::TYPE_CDATA);
$this->append('<![CDATA[');
$skip = 8;
// comment start
// comment start
} elseif ($character === '<'
&& $this->isType(SimpleNode::TYPE_TEXT) && substr($string, $i, 4) === '<!--'
) {
$this->next(SimpleNode::TYPE_COMMENT);
$this->append('<!--');
$skip = 3;
// element start
// element start
} elseif ($character === '<'
&& $this->isType(SimpleNode::TYPE_TEXT)
&& preg_match('#^</?[a-z]#i', substr($string, $i, 3))
) {
$this->next(SimpleNode::TYPE_ELEMENT);
$this->append($character);
// CDATA end
// CDATA end
} elseif ($character === ']'
&& $this->isType(SimpleNode::TYPE_CDATA) && substr($string, $i, 3) === ']]>'
) {
$this->append(']]>');
$this->next(SimpleNode::TYPE_TEXT);
$skip = 2;
// comment end
// comment end
} elseif ($character === '-'
&& $this->isType(SimpleNode::TYPE_COMMENT) && substr($string, $i, 3) === '-->'
) {
$this->append('-->');
$this->next(SimpleNode::TYPE_TEXT);
$skip = 2;
// element end
// element end
} elseif ($character === '>'
&& $this->isType(SimpleNode::TYPE_ELEMENT) && !$this->inAttribute()
) {
$this->append($character);
$this->next(SimpleNode::TYPE_TEXT);
// element attribute start
// element attribute start
} elseif (($character === '"' || $character === "'")
&& $this->isType(SimpleNode::TYPE_ELEMENT) && !$this->inAttribute()
) {
$this->attribute = $character;
$this->append($character);
// element attribute end
// element attribute end
} elseif (($character === '"' || $character === "'")
&& $this->isType(SimpleNode::TYPE_ELEMENT) && $this->attribute === $character
) {
$this->append($character);
$this->attribute = null;
// anything else (put to current type)
// anything else (put to current type)
} else {
$this->append($character);
}
Expand Down
Expand Up @@ -140,7 +140,7 @@ public function resolve(string $linkParameter): array
if (!$isIdOrAlias && $isLocalFile !== 1 && $urlChar && (!$containsSlash || $urlChar < $fileChar)) {
$result['type'] = LinkService::TYPE_URL;
$result['url'] = UrlLinkHandler::getDefaultScheme() . '://' . $linkParameter;
// file (internal) or folder
// file (internal) or folder
} elseif ($containsSlash || $isLocalFile) {
$result = $this->getFileOrFolderObjectFromMixedIdentifier($linkParameter);
} else {
Expand Down
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php
Expand Up @@ -376,7 +376,7 @@ protected function getDirectoryItemList($folderIdentifier, $start, $numberOfItem
}

// $c is the counter for how many items we still have to fetch (-1 is unlimited)
$c = $numberOfItems > 0 ? $numberOfItems : - 1;
$c = $numberOfItems > 0 ? $numberOfItems : -1;
$items = [];
while ($iterator->valid() && ($numberOfItems === 0 || $c > 0)) {
// $iteratorItem is the file or folder name
Expand Down
Expand Up @@ -292,7 +292,7 @@ protected function createRouteFieldConstraints(QueryBuilder $queryBuilder, array
$queryBuilder->expr()->eq('uid', $idParameter),
$queryBuilder->expr()->eq($this->languageParentFieldName, $idParameter)
);
// otherwise - basically uid is not in pattern - restrict to languages and apply fallbacks
// otherwise - basically uid is not in pattern - restrict to languages and apply fallbacks
} elseif ($languageAware) {
$languageIds = $this->resolveAllRelevantLanguageIds();
$constraints[] = $queryBuilder->expr()->in(
Expand Down
Expand Up @@ -278,7 +278,7 @@ protected function getObjectDataByRawQuery(Statement $statement): array
throw new SqlErrorException($e->getPrevious()->getMessage(), 1472064721, $e);
}
$rows = $result->fetchAllAssociative();
// Prepared Doctrine DBAL statement
// Prepared Doctrine DBAL statement
} elseif ($realStatement instanceof \Doctrine\DBAL\Statement) {
try {
$result = $realStatement->executeQuery($parameters);
Expand Down
Expand Up @@ -235,10 +235,10 @@ protected function applyControllerActionValues(string $controllerActionValue, ar
// use default action name if controller matches
if ($tryUpdate && empty($target['action']) && $controllerName === ($target['controller'] ?? null)) {
$target['action'] = $actionName;
// use default controller name if action is defined (implies: non-default-controllers must be given)
// use default controller name if action is defined (implies: non-default-controllers must be given)
} elseif ($tryUpdate && empty($target['controller']) && !empty($target['action'])) {
$target['controller'] = $controllerName;
// fallback and override
// fallback and override
} else {
$target['controller'] = $controllerName;
$target['action'] = $actionName;
Expand Down
4 changes: 2 additions & 2 deletions typo3/sysext/filelist/Classes/FileList.php
Expand Up @@ -714,7 +714,7 @@ public function formatFileList(array $files)
$theData[$field] .= '<span class="label label-danger label-space-left">'
. htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:warning.file_missing'))
. '</span>';
// Thumbnails?
// Thumbnails?
} elseif ($this->thumbs && ($fileObject->isImage() || $fileObject->isMediaFile())) {
$processedFile = $fileObject->process(
ProcessedFile::CONTEXT_IMAGEPREVIEW,
Expand Down Expand Up @@ -1031,7 +1031,7 @@ public function makeEdit($fileOrFolderObject)
if ($fileUrl) {
$cells['download'] = '<a href="' . htmlspecialchars($fileUrl) . '" download="' . htmlspecialchars($fileOrFolderObject->getName()) . '" class="btn btn-default" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:filelist/Resources/Private/Language/locallang.xlf:download')) . '">' . $this->iconFactory->getIcon('actions-download', Icon::SIZE_SMALL)->render() . '</a>';
}
// Folder download
// Folder download
} elseif ($fileOrFolderObject instanceof Folder) {
$cells['download'] = '<button type="button" data-folder-download="' . htmlspecialchars($this->uriBuilder->buildUriFromRoute('file_download')) . '" data-folder-identifier="' . htmlspecialchars($fileOrFolderObject->getCombinedIdentifier()) . '" class="btn btn-default" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:filelist/Resources/Private/Language/locallang.xlf:download')) . '">' . $this->iconFactory->getIcon('actions-download', Icon::SIZE_SMALL)->render() . '</button>';
}
Expand Down
Expand Up @@ -422,7 +422,7 @@ protected function calculateMediaWidthsAndHeights()
// Recalculate gallery width
$this->galleryData['width'] = floor($maximumRowWidth / $mediaScalingCorrection);

// User entered a predefined width
// User entered a predefined width
} elseif ($this->equalMediaWidth) {
$mediaScalingCorrection = 1;

Expand All @@ -446,7 +446,7 @@ protected function calculateMediaWidthsAndHeights()
// Recalculate gallery width
$this->galleryData['width'] = floor($totalRowWidth / $mediaScalingCorrection);

// Automatic setting of width and height
// Automatic setting of width and height
} else {
$maxMediaWidth = (int)($galleryWidthMinusBorderAndSpacing / $this->galleryData['count']['columns']);
foreach ($this->fileObjects as $key => $fileObject) {
Expand Down
Expand Up @@ -118,7 +118,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
['code' => PageAccessFailureReasons::CACHEHASH_COMPARISON_FAILED]
);
}
// No cHash given but was required
// No cHash given but was required
} elseif (!$this->evaluatePageArgumentsWithoutCacheHash($pageArguments, $pageNotFoundOnValidationError)) {
return GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction(
$request,
Expand Down
Expand Up @@ -51,7 +51,7 @@ public function getLikeQueryPart(string $tableName, string $fieldName, string $l
$expected = addcslashes($expected, '\\');
}
$expected = $connection->quoteIdentifier($fieldName) . ' ' . $expected;
if (! $connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
if (!$connection->getDatabasePlatform() instanceof PostgreSQLPlatform) {
$expected .= ' ESCAPE ' . $connection->quote('\\');
}
self::assertSame($expected, $subject->getLikeQueryPart($tableName, $fieldName, $likeValue));
Expand Down
Expand Up @@ -292,7 +292,7 @@ protected function findRelationsToNonExistingRecords(): array
} else {
$offlineVersionRecords[$idx][$rec['hash']] = $infoString;
}
// reference to a deleted record
// reference to a deleted record
} elseif (isset($GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete']) && $existingRecords[$idx][$GLOBALS['TCA'][$rec['ref_table']]['ctrl']['delete']]) {
if ($isSoftReference) {
$deletedRecordsInSoftReferenceRelations[] = $infoString;
Expand Down

0 comments on commit c7ea9e7

Please sign in to comment.