Skip to content

Commit fe3dd57

Browse files
committed
[TASK] Add trailing commas to multiline arrays
1 parent 06b5a3c commit fe3dd57

11 files changed

+33
-32
lines changed

.php-cs-fixer.dist.php

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
'single_quote' => true,
6363
'single_space_around_construct' => true,
6464
'single_line_comment_style' => ['comment_types' => ['hash']],
65+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
6566
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
6667
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
6768
]);

Classes/Processor/FileMetadataProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function processFile(FileInterface $file): array
1616
'copyright' => 'copyright',
1717
'link' => 'link',
1818
'alternative' => 'alternative',
19-
'fileType' => 'extension'
19+
'fileType' => 'extension',
2020
];
2121

2222
$metaData = [];

Classes/Processor/FileProcessor.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FileProcessor
5757
'downloadDescriptionFallbackField' => '',
5858
'maxCharacters' => PHP_INT_MAX,
5959
'append' => '...',
60-
'respectWordBoundaries' => true
60+
'respectWordBoundaries' => true,
6161
];
6262

6363
/**
@@ -127,8 +127,8 @@ protected function getDownloadItem(FileReference $item): array
127127
'description' => $description,
128128
'name' => $item->getTitle(),
129129
'extension' => $item->getExtension(),
130-
'size' => $this->fileSizeProcessor->formatFileSize($item->getSize(), $fileFormatConfiguration)
131-
]
130+
'size' => $this->fileSizeProcessor->formatFileSize($item->getSize(), $fileFormatConfiguration),
131+
],
132132
],
133133
];
134134

Classes/Processor/ImageProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function renderImage(FileInterface $file, array $conf = []): array
4545
],
4646
'width' => $defaultImageResource[0],
4747
'height' => $defaultImageResource[1],
48-
'ratio' => $defaultImageResource[0] / $defaultImageResource[1]
48+
'ratio' => $defaultImageResource[0] / $defaultImageResource[1],
4949
];
5050

5151
self::clearAssetOptions($assetOptions, $conf);

Classes/Processor/MediaProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function renderImageElement(
106106
'image' => $this->pictureProcessor->renderPicture(
107107
$mediaElement,
108108
$imageConfiguration
109-
)
109+
),
110110
];
111111

112112
if (! empty($mediaData) && ! empty($imageThumbnailConfiguration)) {

Classes/Processor/PageElement/LanguageMenuProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function prepareLanguageInformation(array $menuData, array $pageData):
8484
'titleShort' => $menuData['navigationTitle'],
8585
'link' => $link,
8686
'current' => (bool)$menuData['active'],
87-
'sortValue' => (int)$menuData['active']
87+
'sortValue' => (int)$menuData['active'],
8888
];
8989

9090
return $languageData;

Classes/Processor/PageElement/MenuProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function injectContentObjectRenderer(ContentObjectRenderer $contentObject
2929
public function process(array $data, array $configuration): ?array
3030
{
3131
$defaultConfiguration = [
32-
'includePageData' => false
32+
'includePageData' => false,
3333
];
3434
$configuration = array_replace($defaultConfiguration, $configuration);
3535

Classes/Processor/TypoLinkStringProcessor.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function processTypoLinkString(string $typoLinkString): ?array
2727
$uri = $this->contentObject->typoLink_URL(
2828
[
2929
'parameter' => $typoLinkParts['url'],
30-
'additionalParams' => $typoLinkParts['additionalParams']
30+
'additionalParams' => $typoLinkParts['additionalParams'],
3131
]
3232
);
3333

@@ -40,8 +40,8 @@ public function processTypoLinkString(string $typoLinkString): ?array
4040
'uri' => $uri,
4141
'target' => $typoLinkParts['target'],
4242
'class' => $typoLinkParts['class'],
43-
'title' => $typoLinkParts['title']
44-
]
43+
'title' => $typoLinkParts['title'],
44+
],
4545
];
4646
}
4747
}

Classes/Processor/VideoProcessor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function renderVideo(FileInterface $file): ?array
3535
$videoData = [
3636
'default' => [
3737
'src' => $src,
38-
'type' => $file->getMimeType()
38+
'type' => $file->getMimeType(),
3939
],
4040
'metaData' => $this->fileMetaDataProcessor->processFile(($file)),
4141
];

Tests/Unit/Evaluator/PhoneNumberValidationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function telephoneIsProperlyEvaluatedDataProvider(): array
4747
'with preceding plus' => ['+43 699 12 54 12 1', '+43 699 12 54 12 1'],
4848
'with preceding 00' => ['0043 699 12 54 12 1', '+43 699 12 54 12 1'],
4949
'national format return same' => ['0699 12 54 12 1', '0699 12 54 12 1'],
50-
'with non numeric characters' => ['+43 699 12 54 12 1 -D:4', '+43 699 12 54 12 1 4']
50+
'with non numeric characters' => ['+43 699 12 54 12 1 -D:4', '+43 699 12 54 12 1 4'],
5151
];
5252
}
5353
}

Tests/Unit/Processor/FileSizeProcessorTest.php

+19-19
Original file line numberDiff line numberDiff line change
@@ -39,75 +39,75 @@ public static function defaultFormatDataProvider(): array
3939
[
4040
'fileSize' => 'invalid',
4141
[],
42-
'expected' => '0 B'
42+
'expected' => '0 B',
4343
],
4444
[
4545
'fileSize' => '',
4646
[],
47-
'expected' => '0 B'
47+
'expected' => '0 B',
4848
],
4949
[
5050
'fileSize' => [],
5151
[],
52-
'expected' => '0 B'
52+
'expected' => '0 B',
5353
],
5454
[
5555
'fileSize' => 123,
5656
[],
57-
'expected' => '123 B'
57+
'expected' => '123 B',
5858
],
5959
[
6060
'fileSize' => '43008',
6161
[
62-
'decimals' => 1
62+
'decimals' => 1,
6363
],
64-
'expected' => '42.0 KB'
64+
'expected' => '42.0 KB',
6565
],
6666
[
6767
'fileSize' => '1024',
6868
[
69-
'decimals' => 1
69+
'decimals' => 1,
7070
],
71-
'expected' => '1.0 KB'
71+
'expected' => '1.0 KB',
7272
],
7373
[
7474
'fileSize' => '1022',
7575
[
76-
'decimals' => 2
76+
'decimals' => 2,
7777
],
78-
'expected' => '1022.00 B'
78+
'expected' => '1022.00 B',
7979
],
8080
[
8181
'fileSize' => '1022',
8282
[
8383
'decimals' => 2,
84-
'thousandsSeparator' => ','
84+
'thousandsSeparator' => ',',
8585
],
86-
'expected' => '1,022.00 B'
86+
'expected' => '1,022.00 B',
8787
],
8888
[
8989
'fileSize' => 1073741823,
9090
[
9191
'decimals' => 1,
9292
'decimalSeparator' => ',',
93-
'thousandsSeparator' => '.'
93+
'thousandsSeparator' => '.',
9494
],
95-
'expected' => '1.024,0 MB'
95+
'expected' => '1.024,0 MB',
9696
],
9797
[
9898
'fileSize' => pow(1024, 5),
9999
[
100-
'decimals' => 1
100+
'decimals' => 1,
101101
],
102-
'expected' => '1.0 PB'
102+
'expected' => '1.0 PB',
103103
],
104104
[
105105
'fileSize' => pow(1024, 8),
106106
[
107-
'decimals' => 1
107+
'decimals' => 1,
108108
],
109-
'expected' => '1.0 YB'
110-
]
109+
'expected' => '1.0 YB',
110+
],
111111
];
112112
}
113113
}

0 commit comments

Comments
 (0)