Skip to content

Commit

Permalink
[TASK] Bump friendsofphp/php-cs-fixer:^3.35.1
Browse files Browse the repository at this point in the history
It's time to update to latest changes of php-cs-fixer
to align with current community rules. This brings a
rather huge series of changes, main changes due to
single_line_empty_body rule which now formats empty
class and method body curly braces into a single line,
plus changes from function_declaration rule which tends
to avoid more whitespaces.

The change has a slight impact on phpstan, we
regenerate baseline.

To reduce backport headaches, this change is backported
to v12 and v11.

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

Resolves: #102236
Releases: main, 12.4, 11.5
Change-Id: Iea45b10667951672b2194033216c49f580799f55
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81514
Reviewed-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Jasmina Ließmann <minapokhalo+typo3@gmail.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed Oct 23, 2023
1 parent 2642fae commit ddc9ee1
Show file tree
Hide file tree
Showing 520 changed files with 626 additions and 1,713 deletions.
2 changes: 1 addition & 1 deletion Build/phpstan/phpstan-baseline.neon
Expand Up @@ -2901,7 +2901,7 @@ parameters:
path: ../../typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php

-
message: "#^Property class@anonymous/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest\\.php\\:344\\:\\:\\$name is unused\\.$#"
message: "#^Property class@anonymous/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest\\.php\\:337\\:\\:\\$name is unused\\.$#"
count: 1
path: ../../typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php

Expand Down
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.26.1",
"friendsofphp/php-cs-fixer": "^3.35.1",
"friendsoftypo3/phpstan-typo3": "^0.9.0",
"jangregor/phpstan-prophecy": "^1.0",
"php-webdriver/webdriver": "^1.12.0",
Expand Down
16 changes: 7 additions & 9 deletions composer.lock

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

Expand Up @@ -20,6 +20,4 @@
/**
* Exception class for invalid admin panel configuration
*/
class InvalidConfigurationException extends \RuntimeException
{
}
class InvalidConfigurationException extends \RuntimeException {}
4 changes: 1 addition & 3 deletions typo3/sysext/adminpanel/Classes/ModuleApi/ModuleData.php
Expand Up @@ -23,6 +23,4 @@
*
* It's a separate class to add semantic meaning to its' usage
*/
class ModuleData extends \ArrayObject
{
}
class ModuleData extends \ArrayObject {}
Expand Up @@ -108,9 +108,7 @@ public function isEnabled(): bool
* @param array $configurationToSave
* @param ServerRequestInterface $request
*/
public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void
{
}
public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void {}

/**
* Returns a string array with javascript files that will be rendered after the module
Expand All @@ -137,9 +135,7 @@ public function getCssFiles(): array
*
* @param ModuleInterface[] $subModules
*/
public function setSubModules(array $subModules): void
{
}
public function setSubModules(array $subModules): void {}

/**
* Get SubModules for current module
Expand Down
Expand Up @@ -77,9 +77,7 @@ public function getSettings(): string
* @param array $configurationToSave
* @param ServerRequestInterface $request
*/
public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void
{
}
public function onSubmit(array $configurationToSave, ServerRequestInterface $request): void {}

/**
* @param ServerRequestInterface $request
Expand Down
Expand Up @@ -186,7 +186,7 @@ protected function getColumns(string $table, int $pageId): array
}

// Sort standard columns by their resolved label
usort($columns, static fn ($a, $b) => $a['label'] <=> $b['label']);
usort($columns, static fn($a, $b) => $a['label'] <=> $b['label']);

// Disabled columns go first, followed by standard columns
// and special columns, which do not have a label.
Expand All @@ -204,7 +204,7 @@ protected function getFileFields(): array
// Get all sys_file fields expect excluded ones
$fileFields = array_filter(
BackendUtility::getAllowedFieldsForTable('sys_file'),
static fn (string $field): bool => !in_array($field, self::EXCLUDE_FILE_FIELDS, true)
static fn(string $field): bool => !in_array($field, self::EXCLUDE_FILE_FIELDS, true)
);

// Always add crdate and tstamp fields for files
Expand All @@ -216,13 +216,13 @@ protected function getFileFields(): array
// Get all sys_file_metadata fields expect excluded ones
$fileMetaDataFields = array_filter(
BackendUtility::getAllowedFieldsForTable('sys_file_metadata'),
static fn (string $field): bool => !in_array($field, $excludeFields, true)
static fn(string $field): bool => !in_array($field, $excludeFields, true)
);

// Merge sys_file and sys_file_metadata fields together, while adding the table name as prefix
return array_merge(
array_map(static fn (string $value): string => 'sys_file|' . $value, $fileFields),
array_map(static fn (string $value): string => 'sys_file_metadata|' . $value, $fileMetaDataFields),
array_map(static fn(string $value): string => 'sys_file|' . $value, $fileFields),
array_map(static fn(string $value): string => 'sys_file_metadata|' . $value, $fileMetaDataFields),
);
}

Expand Down
Expand Up @@ -2345,7 +2345,7 @@ protected function getLanguages(int $id, string $table): array
// Fetch the current translations of this page, to only show the ones where there is a page translation
$allLanguages = array_filter(
GeneralUtility::makeInstance(TranslationConfigurationProvider::class)->getSystemLanguages($pageId),
static fn ($language) => (int)$language['uid'] !== -1
static fn($language) => (int)$language['uid'] !== -1
);
if ($table !== 'pages' && $id > 0) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
Expand Down
Expand Up @@ -533,7 +533,7 @@ protected function getAllEntryPointPageTrees(int $startPid = 0, string $query =
//watch out for deleted pages returned as webmount
$mountPoints = array_map('intval', $backendUser->returnWebmounts());
$mountPoints = array_unique($mountPoints);
$mountPoints = array_filter($mountPoints, fn ($id) => !in_array($id, $this->hiddenRecords, true));
$mountPoints = array_filter($mountPoints, fn($id) => !in_array($id, $this->hiddenRecords, true));

// Switch to multiple-entryPoint-mode if the rootPage is to be mounted.
// (other mounts would appear duplicated in the pid = 0 tree otherwise)
Expand All @@ -558,7 +558,7 @@ protected function getAllEntryPointPageTrees(int $startPid = 0, string $query =

$entryPointRecords[] = $rootRecord;
} else {
$entryPointIds = array_filter($entryPointIds, fn ($id) => !in_array($id, $this->hiddenRecords, true));
$entryPointIds = array_filter($entryPointIds, fn($id) => !in_array($id, $this->hiddenRecords, true));
$this->calculateBackgroundColors($entryPointIds);
foreach ($entryPointIds as $k => $entryPointId) {
if ($entryPointId === 0) {
Expand Down
4 changes: 1 addition & 3 deletions typo3/sysext/backend/Classes/Exception.php
Expand Up @@ -20,6 +20,4 @@
/**
* Generic Backend exception
*/
class Exception extends CoreException
{
}
class Exception extends CoreException {}
Expand Up @@ -19,6 +19,4 @@

use TYPO3\CMS\Core\Error\Http\AbstractClientErrorException;

class BackendAccessDeniedException extends AbstractClientErrorException
{
}
class BackendAccessDeniedException extends AbstractClientErrorException {}
Expand Up @@ -19,6 +19,4 @@

use TYPO3\CMS\Core\Error\Http\AbstractClientErrorException;

class BackendLockedException extends AbstractClientErrorException
{
}
class BackendLockedException extends AbstractClientErrorException {}
Expand Up @@ -22,6 +22,4 @@
/**
* Exception thrown if site configuration for a page is not found
*/
class SiteValidationErrorException extends Exception
{
}
class SiteValidationErrorException extends Exception {}
Expand Up @@ -109,7 +109,7 @@ public function render()
) {
$uniqueIds[] = $this->data['inlineParentUid'];
}
$uniqueIds = array_map(static fn ($item) => (int)$item, $uniqueIds);
$uniqueIds = array_map(static fn($item) => (int)$item, $uniqueIds);
}

// Initialization:
Expand Down
4 changes: 1 addition & 3 deletions typo3/sysext/backend/Classes/Form/Exception.php
Expand Up @@ -18,6 +18,4 @@
/**
* Generic backend form exception
*/
class Exception extends \TYPO3\CMS\Backend\Exception
{
}
class Exception extends \TYPO3\CMS\Backend\Exception {}
Expand Up @@ -18,6 +18,4 @@
/**
* User is not allowed to edit this content elements
*/
class AccessDeniedContentEditException extends AccessDeniedException
{
}
class AccessDeniedContentEditException extends AccessDeniedException {}
Expand Up @@ -18,6 +18,4 @@
/**
* User check did not survive "recordEditAccessInternals" to edit record
*/
class AccessDeniedEditInternalsException extends AccessDeniedException
{
}
class AccessDeniedEditInternalsException extends AccessDeniedException {}
Expand Up @@ -22,6 +22,4 @@
* This indicated a recoverable error that should be changed to a user message.
* This abstract exception is extended by more fine grained exceptions.
*/
abstract class AccessDeniedException extends Exception
{
}
abstract class AccessDeniedException extends Exception {}
Expand Up @@ -18,6 +18,4 @@
/**
* User access to record was denied by a makeEditForm_accessCheck hook
*/
class AccessDeniedHookException extends AccessDeniedException
{
}
class AccessDeniedHookException extends AccessDeniedException {}
Expand Up @@ -18,6 +18,4 @@
/**
* User is not allowed to edit this page
*/
class AccessDeniedPageEditException extends AccessDeniedException
{
}
class AccessDeniedPageEditException extends AccessDeniedException {}
Expand Up @@ -18,6 +18,4 @@
/**
* User is not allowed to add a new page
*/
class AccessDeniedPageNewException extends AccessDeniedException
{
}
class AccessDeniedPageNewException extends AccessDeniedException {}
Expand Up @@ -18,6 +18,4 @@
/**
* User has no sufficient rights to modify a row that is located at root node
*/
class AccessDeniedRootNodeException extends AccessDeniedException
{
}
class AccessDeniedRootNodeException extends AccessDeniedException {}
Expand Up @@ -18,6 +18,4 @@
/**
* User has no modify table access to a table record
*/
class AccessDeniedTableModifyException extends AccessDeniedException
{
}
class AccessDeniedTableModifyException extends AccessDeniedException {}
Expand Up @@ -20,6 +20,4 @@
/**
* Thrown if a language overlay record is handled and no default language record is found.
*/
class DatabaseDefaultLanguageException extends Exception
{
}
class DatabaseDefaultLanguageException extends Exception {}
Expand Up @@ -98,7 +98,7 @@ public function addData(array $result): array
// Finally, the only data needed for the tree code are the valid uids of the possible records
$uidListOfAllDynamicItems = array_map('intval', array_filter(
array_values(array_column($dynamicItems, 1)),
static fn ($uid) => (int)$uid > 0
static fn($uid) => (int)$uid > 0
));
$fullRowsOfDynamicItems = [];
foreach ($dynamicItems as $item) {
Expand Down
Expand Up @@ -326,9 +326,7 @@ protected function prepareOrderByStatement()
*
* @param array $row
*/
protected function manipulateRecord(&$row)
{
}
protected function manipulateRecord(&$row) {}

/**
* Selects whether the logged in Backend User is allowed to read a specific record
Expand Down
Expand Up @@ -20,6 +20,4 @@
/**
* Exception thrown when request token was invalid
*/
class InvalidRequestTokenException extends Exception
{
}
class InvalidRequestTokenException extends Exception {}
Expand Up @@ -20,6 +20,4 @@
/**
* Exception thrown when a resource was found but the methods did not match.
*/
class MethodNotAllowedException extends Exception
{
}
class MethodNotAllowedException extends Exception {}
Expand Up @@ -20,6 +20,4 @@
/**
* Exception thrown when request token was missing.
*/
class MissingRequestTokenException extends Exception
{
}
class MissingRequestTokenException extends Exception {}
Expand Up @@ -20,6 +20,4 @@
/**
* Exception thrown when a resource was not found.
*/
class ResourceNotFoundException extends Exception
{
}
class ResourceNotFoundException extends Exception {}
Expand Up @@ -18,6 +18,4 @@
/**
* Exception thrown when a route does not exist
*/
class RouteNotFoundException extends \TYPO3\CMS\Core\Routing\RouteNotFoundException
{
}
class RouteNotFoundException extends \TYPO3\CMS\Core\Routing\RouteNotFoundException {}
Expand Up @@ -22,6 +22,4 @@
/**
* Exception thrown when a resource was found but the type (e.g. AJAX routes) did not match.
*/
class RouteTypeNotAllowedException extends Exception
{
}
class RouteTypeNotAllowedException extends Exception {}
Expand Up @@ -215,7 +215,7 @@ protected function printRecordMap(array $lines, array $tcaColumnsConfiguration,
if (!empty($lines[$columnKey])) {
$cellContent .= '
<ul class="list-unstyled">
' . implode(LF, array_map(static fn (string $line): string => '<li>' . $line . '</li>', $lines[$columnKey])) . '
' . implode(LF, array_map(static fn(string $line): string => '<li>' . $line . '</li>', $lines[$columnKey])) . '
</ul>';
}
}
Expand Down Expand Up @@ -255,7 +255,7 @@ protected function printRecordMap(array $lines, array $tcaColumnsConfiguration,
if (!empty($lines[$tcaColumnConfiguration['colPos']])) {
$cellContent .= '
<ul class="list-unstyled">
' . implode(LF, array_map(static fn (string $line): string => '<li>' . $line . '</li>', $lines[$tcaColumnConfiguration['colPos']])) . '
' . implode(LF, array_map(static fn(string $line): string => '<li>' . $line . '</li>', $lines[$tcaColumnConfiguration['colPos']])) . '
</ul>';
}
}
Expand Down

0 comments on commit ddc9ee1

Please sign in to comment.