Skip to content

Commit 77957a6

Browse files
committed
Add trailing comma for multi-line functions
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 2137664 commit 77957a6

679 files changed

Lines changed: 5813 additions & 5836 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

libraries/classes/Advisory/Advisor.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static function (): void {
9595
array $arguments,
9696
int $value,
9797
int $limes = 6,
98-
int $comma = 0
98+
int $comma = 0,
9999
) => implode(' ', (array) Util::formatByteDown($value, $limes, $comma))
100100
);
101101
$this->expression->register(
@@ -111,7 +111,7 @@ function (array $arguments, int|string $value) {
111111
}
112112

113113
return '0';
114-
}
114+
},
115115
);
116116
/* Some global variables for advisor */
117117
$this->globals = [
@@ -186,7 +186,7 @@ private function storeError(string $description, Throwable $exception): void
186186
{
187187
$this->runResult['errors'][] = $description . ' ' . sprintf(
188188
__('Error when evaluating: %s'),
189-
$exception->getMessage()
189+
$exception->getMessage(),
190190
);
191191
}
192192

@@ -213,9 +213,9 @@ private function runRules(): void
213213
$this->storeError(
214214
sprintf(
215215
__('Failed evaluating precondition for rule \'%s\'.'),
216-
$rule['name']
216+
$rule['name'],
217217
),
218-
$e
218+
$e,
219219
);
220220
continue;
221221
}
@@ -233,9 +233,9 @@ private function runRules(): void
233233
$this->storeError(
234234
sprintf(
235235
__('Failed calculating value for rule \'%s\'.'),
236-
$rule['name']
236+
$rule['name'],
237237
),
238-
$e
238+
$e,
239239
);
240240
continue;
241241
}
@@ -252,9 +252,9 @@ private function runRules(): void
252252
$this->storeError(
253253
sprintf(
254254
__('Failed running test for rule \'%s\'.'),
255-
$rule['name']
255+
$rule['name'],
256256
),
257-
$e
257+
$e,
258258
);
259259
}
260260
}
@@ -281,7 +281,7 @@ public function addRule(string $type, array $rule): void
281281
} catch (Throwable $e) {
282282
$this->storeError(
283283
sprintf(__('Failed formatting string for rule \'%s\'.'), $rule['name']),
284-
$e
284+
$e,
285285
);
286286

287287
return;
@@ -295,19 +295,19 @@ public function addRule(string $type, array $rule): void
295295
$rule['recommendation'] = preg_replace_callback(
296296
'/\{([a-z_0-9]+)\}/Ui',
297297
fn (array $matches) => $this->replaceVariable($matches),
298-
$rule['recommendation']
298+
$rule['recommendation'],
299299
);
300300
$rule['issue'] = preg_replace_callback(
301301
'/\{([a-z_0-9]+)\}/Ui',
302302
fn (array $matches) => $this->replaceVariable($matches),
303-
$rule['issue']
303+
$rule['issue'],
304304
);
305305

306306
// Replaces external Links with Core::linkURL() generated links
307307
$rule['recommendation'] = preg_replace_callback(
308308
'#href=("|\')(https?://[^"\']+)\1#i',
309309
fn (array $matches) => $this->replaceLinkURL($matches),
310-
$rule['recommendation']
310+
$rule['recommendation'],
311311
);
312312

313313
$this->runResult[$type][] = $rule;

libraries/classes/Advisory/Rules.php

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

libraries/classes/Bookmark.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public function applyVariables(array $variables): string
191191
public static function createBookmark(
192192
DatabaseInterface $dbi,
193193
array $bkm_fields,
194-
bool $all_users = false
194+
bool $all_users = false,
195195
): Bookmark|false {
196196
if (
197197
! (isset($bkm_fields['bkm_sql_query'], $bkm_fields['bkm_label'])
@@ -237,7 +237,7 @@ public static function getList(
237237
BookmarkFeature $bookmarkFeature,
238238
DatabaseInterface $dbi,
239239
string $user,
240-
string|false $db = false
240+
string|false $db = false,
241241
): array {
242242
$query = 'SELECT * FROM ' . Util::backquote($bookmarkFeature->database)
243243
. '.' . Util::backquote($bookmarkFeature->bookmark)
@@ -253,7 +253,7 @@ public static function getList(
253253
$query,
254254
null,
255255
null,
256-
Connection::TYPE_CONTROL
256+
Connection::TYPE_CONTROL,
257257
);
258258

259259
$bookmarks = [];
@@ -284,7 +284,7 @@ public static function get(
284284
int|string $id,
285285
string $id_field = 'id',
286286
bool $action_bookmark_all = false,
287-
bool $exact_user_match = false
287+
bool $exact_user_match = false,
288288
): self|null {
289289
$relation = new Relation($dbi);
290290
$bookmarkFeature = $relation->getRelationParameters()->bookmarkFeature;

libraries/classes/BrowseForeigners.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private function getHtmlForOneKey(
6060
int $indexByKeyname,
6161
array $descriptions,
6262
int $indexByDescription,
63-
string $currentValue
63+
string $currentValue,
6464
): array {
6565
$GLOBALS['theme'] ??= null;
6666

@@ -160,7 +160,7 @@ public function getHtmlForRelationalFieldSelection(
160160
string $field,
161161
array $foreignData,
162162
string|null $fieldKey,
163-
string $currentValue
163+
string $currentValue,
164164
): string {
165165
$gotoPage = $this->getHtmlForGotoPage($foreignData);
166166
$foreignShowAll = $this->template->render('table/browse_foreigners/show_all', [
@@ -249,7 +249,7 @@ public function getHtmlForRelationalFieldSelection(
249249
$indexByKeyname,
250250
$descriptions,
251251
$indexByDescription,
252-
$currentValue
252+
$currentValue,
253253
);
254254
$output .= $html;
255255
}
@@ -308,7 +308,7 @@ private function getHtmlForGotoPage(array|null $foreignData): string
308308
5,
309309
20,
310310
10,
311-
__('Page number:')
311+
__('Page number:'),
312312
);
313313
}
314314

libraries/classes/Charsets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public static function getServerCharset(DatabaseInterface $dbi, bool $disableIs)
172172
[
173173
'Charset' => __('Unknown'),
174174
'Description' => __('Unknown'),
175-
]
175+
],
176176
);
177177
}
178178

@@ -214,7 +214,7 @@ public static function getCollations(DatabaseInterface $dbi, bool $disableIs): a
214214
public static function findCollationByName(
215215
DatabaseInterface $dbi,
216216
bool $disableIs,
217-
string $name
217+
string $name,
218218
): Collation|null {
219219
$charset = explode('_', $name)[0];
220220
$collations = self::getCollations($dbi, $disableIs);

libraries/classes/Charsets/Charset.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private function __construct(
4242
string $name,
4343
string $description,
4444
string $defaultCollation,
45-
int $maxLength
45+
int $maxLength,
4646
) {
4747
$this->name = $name;
4848
$this->description = $description;
@@ -62,7 +62,7 @@ public static function fromServer(array $state): self
6262
$state['Charset'] ?? '',
6363
$state['Description'] ?? '',
6464
$state['Default collation'] ?? '',
65-
(int) ($state['Maxlen'] ?? 0)
65+
(int) ($state['Maxlen'] ?? 0),
6666
);
6767
}
6868

libraries/classes/Charsets/Collation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function __construct(
7474
bool $isDefault,
7575
bool $isCompiled,
7676
int $sortLength,
77-
string $padAttribute
77+
string $padAttribute,
7878
) {
7979
$this->name = $name;
8080
$this->charset = $charset;
@@ -98,7 +98,7 @@ public static function fromServer(array $state): self
9898
isset($state['Default']) && ($state['Default'] === 'Yes' || $state['Default'] === '1'),
9999
isset($state['Compiled']) && ($state['Compiled'] === 'Yes' || $state['Compiled'] === '1'),
100100
(int) ($state['Sortlen'] ?? 0),
101-
$state['Pad_attribute'] ?? ''
101+
$state['Pad_attribute'] ?? '',
102102
);
103103
}
104104

@@ -306,7 +306,7 @@ private function getNameForLevel0(
306306
bool $unicode,
307307
bool $unknown,
308308
string $part,
309-
string|null $variant
309+
string|null $variant,
310310
): array {
311311
switch ($part) {
312312
case 'binary':
@@ -427,7 +427,7 @@ private function getNameForLevel1(
427427
bool $unknown,
428428
string $part,
429429
string $name,
430-
int $level
430+
int $level,
431431
): array {
432432
$found = true;
433433

libraries/classes/CheckUserPrivileges.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public function getItemsFromShowGrantsRow(string $row): array
5555
$showGrantsString = mb_substr(
5656
$row,
5757
6,
58-
mb_strpos($row, ' ON ') - 6
58+
mb_strpos($row, ' ON ') - 6,
5959
);
6060

6161
$showGrantsTableName = mb_substr(
6262
$row,
6363
$tableNameStartOffset + 1,
64-
$tableNameEndOffset - $tableNameStartOffset - 1
64+
$tableNameEndOffset - $tableNameStartOffset - 1,
6565
);
6666
$showGrantsTableName = Util::unQuote($showGrantsTableName, '`');
6767

@@ -83,7 +83,7 @@ public function getItemsFromShowGrantsRow(string $row): array
8383
public function checkRequiredPrivilegesForAdjust(
8484
string $showGrantsString,
8585
string $showGrantsDbName,
86-
string $showGrantsTableName
86+
string $showGrantsTableName,
8787
): void {
8888
// '... ALL PRIVILEGES ON *.* ...' OR '... ALL PRIVILEGES ON `mysql`.* ..'
8989
// OR
@@ -253,8 +253,8 @@ private function analyseShowGrant(): void
253253
'USE ' . preg_replace(
254254
'/' . $re1 . '(%|_)/',
255255
'\\1\\3',
256-
$dbNameToTest
257-
)
256+
$dbNameToTest,
257+
),
258258
)
259259
|| mb_substr($this->dbi->getError(), 1, 4) == 1044)
260260
) {

libraries/classes/Command/CacheWarmupCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function configure(): void
4444
null,
4545
InputArgument::OPTIONAL,
4646
'Defines the environment (production or development) for twig warmup',
47-
'production'
47+
'production',
4848
);
4949
$this->setHelp('The <info>%command.name%</info> command warms up the cache of the Twig templates.');
5050
}
@@ -106,9 +106,9 @@ private function warmUpRoutingCache(OutputInterface $output): int
106106
$output->writeln(
107107
sprintf(
108108
'Warm up did not work, the folder "%s" is probably not writable.',
109-
CACHE_DIR
109+
CACHE_DIR,
110110
),
111-
OutputInterface::VERBOSITY_NORMAL
111+
OutputInterface::VERBOSITY_NORMAL,
112112
);
113113

114114
return Command::FAILURE;
@@ -117,7 +117,7 @@ private function warmUpRoutingCache(OutputInterface $output): int
117117
private function warmUpTwigCache(
118118
OutputInterface $output,
119119
string $environment,
120-
bool $writeReplacements
120+
bool $writeReplacements,
121121
): int {
122122
$GLOBALS['config'] ??= null;
123123

@@ -134,15 +134,15 @@ private function warmUpTwigCache(
134134

135135
$templates = new RecursiveIteratorIterator(
136136
new RecursiveDirectoryIterator(Template::TEMPLATES_FOLDER),
137-
RecursiveIteratorIterator::LEAVES_ONLY
137+
RecursiveIteratorIterator::LEAVES_ONLY,
138138
);
139139

140140
/** @var CacheInterface $twigCache */
141141
$twigCache = $twig->getCache(false);
142142
$replacements = [];
143143
$output->writeln(
144144
'Twig debug is: ' . ($twig->isDebug() ? 'enabled' : 'disabled'),
145-
OutputInterface::VERBOSITY_DEBUG
145+
OutputInterface::VERBOSITY_DEBUG,
146146
);
147147

148148
$output->writeln('Warming templates', OutputInterface::VERBOSITY_VERY_VERBOSE);

libraries/classes/Command/FixPoTwigCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function configure(): void
3030
$this->setDescription('Fixes POT file for Twig templates');
3131
$this->setHelp(
3232
'The <info>%command.name%</info> command fixes the Twig file name and line number in the'
33-
. ' POT file to match the Twig template and not the compiled Twig file.'
33+
. ' POT file to match the Twig template and not the compiled Twig file.',
3434
);
3535
}
3636

@@ -67,7 +67,7 @@ static function (array $matches) use ($replacements): string {
6767

6868
return $replace[0] . ':0';
6969
},
70-
$pot
70+
$pot,
7171
);
7272
if ($pot === null) {
7373
return Command::FAILURE;

0 commit comments

Comments
 (0)