Skip to content

Commit

Permalink
[TASK] Add trailing comma in multiline fixer rule
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Oct 9, 2024
1 parent 82e0932 commit b7bf7e1
Show file tree
Hide file tree
Showing 58 changed files with 432 additions and 427 deletions.
7 changes: 6 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@
'native_function_casing' => true,
'self_accessor' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true
'no_unneeded_control_parentheses' => true,
'trailing_comma_in_multiline' => [
'elements' => [
'arrays',
],
],
])
->setFinder(
PhpCsFixer\Finder::create()
Expand Down
6 changes: 3 additions & 3 deletions Build/deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
'config',
'web/fileadmin',
'web/typo3temp',
'web/uploads'
'web/uploads',
]);
set('shared_files', [
'composer.json',
'web/.htaccess',
'web/typo3conf/AdditionalConfiguration.php',
'web/typo3conf/LocalConfiguration.php',
'web/typo3conf/PackageStates.php'
'web/typo3conf/PackageStates.php',
]);

// Set Writeable files
Expand All @@ -70,7 +70,7 @@
'web/fileadmin',
'web/typo3temp',
'web/typo3conf',
'web/uploads'
'web/uploads',
]);

// Misc
Expand Down
2 changes: 1 addition & 1 deletion Classes/DataProcessing/CsvFileProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$fieldDelimiter,
$fieldEnclosure,
$maximumColumns
)
),
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/ExpressionLanguage/ConditionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ConditionProvider extends AbstractProvider
public function __construct()
{
$this->expressionLanguageVariables = [
'extension' => GeneralUtility::makeInstance(ExtensionWrapper::class)
'extension' => GeneralUtility::makeInstance(ExtensionWrapper::class),
];
}
}
2 changes: 1 addition & 1 deletion Classes/Hooks/PageRenderer/GoogleFontHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class GoogleFontHook
*/
protected $includeMapping = [
'includeCSSLibs' => 'cssLibs',
'includeCSS' => 'cssFiles'
'includeCSS' => 'cssFiles',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion Classes/Icons/FileIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function render(): string

$processingInstructions = [
'width' => $width . 'c',
'height' => $height . 'c'
'height' => $height . 'c',
];
$processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);
$imageUri = $imageService->getImageUri($processedImage);
Expand Down
4 changes: 2 additions & 2 deletions Classes/Parser/ScssParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ function ($args) use (
'etag' => md5($css),
'files' => $compilationResult->getIncludedFiles(),
'variables' => $settings['variables'],
'sourceMap' => $settings['options']['sourceMap']
]
'sourceMap' => $settings['options']['sourceMap'],
],
];
}
}
6 changes: 3 additions & 3 deletions Classes/Service/CompileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getCompiledFile(ServerRequestInterface $request, string $file):
'file' => [
'absolute' => $absoluteFile,
'relative' => $file,
'info' => pathinfo($absoluteFile)
'info' => pathinfo($absoluteFile),
],
'cache' => [
'tempDirectory' => $this->tempDirectory,
Expand All @@ -59,9 +59,9 @@ public function getCompiledFile(ServerRequestInterface $request, string $file):
'options' => [
'override' => (bool) ($configuration['overrideParserVariables'] ?? false),
'sourceMap' => (bool) ($configuration['cssSourceMapping'] ?? false),
'compress' => true
'compress' => true,
],
'variables' => []
'variables' => [],
];

// Parser
Expand Down
2 changes: 1 addition & 1 deletion Classes/Service/GoogleFontService.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function cacheFile(string $file): bool

/** @var ResponseInterface */
$response = $requestFactory->request($file, 'GET', [
'headers' => ['User-Agent' => 'Mozilla/5.0 Gecko/20100101 Firefox/94.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55']
'headers' => ['User-Agent' => 'Mozilla/5.0 Gecko/20100101 Firefox/94.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55'],
]);

if ($response->getStatusCode() >= 300) {
Expand Down
6 changes: 3 additions & 3 deletions Classes/Service/IconService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getIconSetItems(array &$configuration): void
foreach ($iconProviders as $iconProvider) {
$iconSets[] = [
$iconProvider->getName(),
$iconProvider->getIdentifier()
$iconProvider->getIdentifier(),
];
}

Expand All @@ -40,7 +40,7 @@ public function getIconItems(array &$configuration): void
$iconItems[] = [
'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.none',
0,
'EXT:bootstrap_package/Resources/Public/Images/Icons/none.svg'
'EXT:bootstrap_package/Resources/Public/Images/Icons/none.svg',
];

$iconSetField = $configuration['config']['itemsProcConfig']['iconSetField'] ?? 'icon_set';
Expand All @@ -52,7 +52,7 @@ public function getIconItems(array &$configuration): void
$iconItems[] = [
$icon->getName(),
$icon->getIdentifier(),
$icon->getPreviewImage()
$icon->getPreviewImage(),
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/AbstractUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getDescription(): string
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class
DatabaseUpdatedPrerequisite::class,
];
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/AccordionMediaOrientUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AccordionMediaOrientUpdate extends AbstractUpdate implements UpgradeWizard
*/
protected $mapping = [
0 => 'left',
1 => 'right'
1 => 'right',
];

public function updateNecessary(): bool
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/BackendLayoutUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BackendLayoutUpdate extends AbstractUpdate implements UpgradeWizardInterfa
'pagets__default_subnavigation_right' => 'pagets__subnavigation_right',
'pagets__default_subnavigation_right_2_columns' => 'pagets__subnavigation_right_2_columns',
'pagets__default_subnavigation_left' => 'pagets__subnavigation_left',
'pagets__default_subnavigation_left_2_columns' => 'pagets__subnavigation_left_2_columns'
'pagets__default_subnavigation_left_2_columns' => 'pagets__subnavigation_left_2_columns',
];

public function updateNecessary(): bool
Expand Down Expand Up @@ -71,7 +71,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
'backend_layout' => $this->mapValues(strval($record['backend_layout'])),
'backend_layout_next_level' => $this->mapValues(strval($record['backend_layout_next_level']))
'backend_layout_next_level' => $this->mapValues(strval($record['backend_layout_next_level'])),
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/BulletContentElementUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
'layout' => (string) 0,
'bullets_type' => (string) $this->mapValues(intval($record['layout']))
'bullets_type' => (string) $this->mapValues(intval($record['layout'])),
]
);
}
Expand All @@ -65,7 +65,7 @@ public function executeUpdate(): bool
protected function mapValues(int $layout): int
{
$mapping = [
110 => 1
110 => 1,
];
if (array_key_exists($layout, $mapping)) {
return $mapping[$layout];
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/CarouselContentElementUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
'layout' => $this->resetLayout(intval($record['layout'])),
'CType' => $this->mapValues(intval($record['layout']))
'CType' => $this->mapValues(intval($record['layout'])),
]
);
}
Expand All @@ -68,7 +68,7 @@ protected function mapValues(int $layout): string
{
$mapping = [
110 => 'carousel_small',
120 => 'carousel_fullscreen'
120 => 'carousel_fullscreen',
];
if (array_key_exists($layout, $mapping)) {
return $mapping[$layout];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/CarouselItemTypeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function mapValues(string $type): string
{
$mapping = [
'textandimage' => 'text_and_image',
'backgroundimage' => 'background_image'
'backgroundimage' => 'background_image',
];
if (array_key_exists($type, $mapping)) {
return $mapping[$type];
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/FrameClassToBackgroundUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FrameClassToBackgroundUpdate extends AbstractUpdate implements UpgradeWiza
*/
protected $mapping = [
'well' => 'light',
'jumbotron' => 'primary'
'jumbotron' => 'primary',
];

public function updateNecessary(): bool
Expand All @@ -62,7 +62,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
$this->field => 'default',
'background_color_class' => $newValue
'background_color_class' => $newValue,
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/FrameClassToOptionsUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FrameClassToOptionsUpdate extends AbstractUpdate implements UpgradeWizardI
'ruler-after' => 'ruler-after',
'indent' => 'indent-left,indent-right',
'indent-left' => 'indent-left',
'indent-right' => 'indent-right'
'indent-right' => 'indent-right',
];

public function updateNecessary(): bool
Expand All @@ -65,7 +65,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
$this->field => 'default',
'frame_options' => $newValue
'frame_options' => $newValue,
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/FrameClassUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
'section_frame' => '0',
'frame_class' => $this->mapSectionFrame(intval($record['section_frame']))
'frame_class' => $this->mapSectionFrame(intval($record['section_frame'])),
]
);
}
Expand All @@ -71,7 +71,7 @@ protected function mapSectionFrame(int $sectionFrame): string
12 => 'indent-right',
20 => 'well',
21 => 'jumbotron',
66 => 'none'
66 => 'none',
];
if (array_key_exists($sectionFrame, $mapping)) {
return $mapping[$sectionFrame];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/PanelContentElementUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function executeUpdate(): bool
[
'CType' => 'panel',
'layout' => '0',
'panel_class' => $this->mapValues(intval($record['layout']))
'panel_class' => $this->mapValues(intval($record['layout'])),
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/TabMediaOrientUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TabMediaOrientUpdate extends AbstractUpdate implements UpgradeWizardInterf
*/
protected $mapping = [
0 => 'left',
1 => 'right'
1 => 'right',
];

public function updateNecessary(): bool
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/TableContentElementUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function executeUpdate(): bool
(int) $record['uid'],
[
'layout' => '0',
'table_class' => $this->mapValues(intval($record['layout']))
'table_class' => $this->mapValues(intval($record['layout'])),
]
);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Updates/TexticonIconUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function updateNecessary(): bool
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createLikeCriteria($queryBuilder, 'icon', 'Glyphicons%'),
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%')
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%'),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);

Expand All @@ -45,7 +45,7 @@ public function executeUpdate(): bool
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createLikeCriteria($queryBuilder, 'icon', 'Glyphicons%'),
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%')
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%'),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);

Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/TexticonSizeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TexticonSizeUpdate extends AbstractUpdate implements UpgradeWizardInterfac
0 => 'default',
1 => 'medium',
2 => 'large',
3 => 'awesome'
3 => 'awesome',
];

public function updateNecessary(): bool
Expand Down
2 changes: 1 addition & 1 deletion Classes/Updates/TexticonTypeUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class TexticonTypeUpdate extends AbstractUpdate implements UpgradeWizardInterfac
protected $mapping = [
0 => 'default',
1 => 'square',
2 => 'circle'
2 => 'circle',
];

public function updateNecessary(): bool
Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/ExternalMediaUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ExternalMediaUtility
protected array $mediaProvider = [
'youtube',
'youtu',
'vimeo'
'vimeo',
];

/**
Expand All @@ -44,7 +44,7 @@ public function getEmbedCode(?string $url, ?string $class, ?string $title = null
if ($embedUrl !== null) {
$attributes = [
'src' => $embedUrl,
'frameborder' => '0'
'frameborder' => '0',
];
if ($title !== null && trim($title) !== '') {
$attributes['title'] = trim($title);
Expand Down
14 changes: 7 additions & 7 deletions Classes/Utility/ImageVariantsUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ class ImageVariantsUtility
protected static $defaultVariants = [
'default' => [
'breakpoint' => 1400,
'width' => 1280
'width' => 1280,
],
'xlarge' => [
'breakpoint' => 1200,
'width' => 1100
'width' => 1100,
],
'large' => [
'breakpoint' => 992,
'width' => 920
'width' => 920,
],
'medium' => [
'breakpoint' => 768,
'width' => 680
'width' => 680,
],
'small' => [
'breakpoint' => 576,
'width' => 500
'width' => 500,
],
'extrasmall' => [
'width' => 374
]
'width' => 374,
],
];

/**
Expand Down
Loading

0 comments on commit b7bf7e1

Please sign in to comment.