Skip to content

Commit c093fb5

Browse files
authored
Enhancement: Enable trailing_comma_in_multiline fixer (#647)
* Enhancement: Enable and configure trailing_comma_in_multiline fixer * Fix: Run 'make coding-standards'
1 parent 4ac417b commit c093fb5

Some content is hidden

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

44 files changed

+278
-272
lines changed

.php-cs-fixer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@
5151
],
5252
'strict_param' => true,
5353
'switch_case_space' => true,
54+
'trailing_comma_in_multiline' => [
55+
'elements' => [
56+
'arguments',
57+
'arrays',
58+
],
59+
],
5460
'trim_array_spaces' => true,
5561
'unary_operator_spaces' => true,
5662
'visibility_required' => true,

credits.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
$credits = str_replace(
1717
["</center>", "& "],
1818
["</div>", "&amp; "],
19-
$credits
19+
$credits,
2020
);
2121

2222
// If there is something left, print it out

download-docs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
$link_to,
124124
(int) ($size / 1024),
125125
date("j M Y", $changed),
126-
$extension
126+
$extension,
127127
];
128128
$found_formats[$formatname] = 1;
129129
}

downloads.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"rel" => "alternate",
3333
"type" => "application/atom+xml",
3434
"href" => $MYSITE . "releases/feed.php",
35-
"title" => "PHP Release feed"
35+
"title" => "PHP Release feed",
3636
],
3737
],
3838
"current" => "downloads",
39-
]
39+
],
4040
);
4141
?>
4242
<?php $i = 0; foreach ($RELEASES as $MAJOR => $major_releases): /* major releases loop start */

elephpant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
<?php
3737
// Print the common footer.
3838
site_footer([
39-
'elephpants' => true
39+
'elephpants' => true,
4040
]);

error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@
711711
$fallback = (myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "404manual" : "404quickref");
712712
mirror_redirect(
713713
'/search.php?show=' . $fallback . '&lang=' . urlencode($LANG) .
714-
'&pattern=' . substr($_SERVER['REQUEST_URI'], 1)
714+
'&pattern=' . substr($_SERVER['REQUEST_URI'], 1),
715715
);
716716
/*
717717
* vim: set et ts=4 sw=4 ft=php: :

git-php.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"note" => $_POST['realpurpose'],
8787
"yesno" => $_POST['yesno'],
8888
"group" => $_POST['group'],
89-
]
89+
],
9090
);
9191
// Error while posting
9292
if ($error) {

images/elephpants.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
} else {
4040
header('HTTP/1.1 400', true, 400);
4141
echo json_encode([
42-
'error' => "Specify how many elephpants to serve via 'count'."
42+
'error' => "Specify how many elephpants to serve via 'count'.",
4343
]);
4444
exit;
4545
}
@@ -53,7 +53,7 @@
5353
if (!$photos || !is_array($photos)) {
5454
header('HTTP/1.1 500', true, 500);
5555
echo json_encode([
56-
'error' => "No elephpant metadata available."
56+
'error' => "No elephpant metadata available.",
5757
]);
5858
exit;
5959
}
@@ -79,7 +79,7 @@
7979
$elephpants[] = [
8080
'title' => $photo['title'],
8181
'url' => "http://flickr.com/photos/" . $photo['owner'] . "/" . $photo['id'],
82-
'data' => base64_encode(file_get_contents($path . '/' . $photo['filename']))
82+
'data' => base64_encode(file_get_contents($path . '/' . $photo['filename'])),
8383
];
8484
}
8585

include/branches.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ function format_interval($from, DateTime $to) {
6868
return "$t[0] $t[1]" .
6969
($t[0] != 1 ? 's' : '');
7070
},
71-
$times
72-
)
71+
$times,
72+
),
7373
);
7474

7575
if ($diff->invert) {
@@ -378,7 +378,7 @@ function version_array(string $version, ?int $length = null)
378378
{
379379
$versionArray = array_map(
380380
'intval',
381-
explode('.', $version)
381+
explode('.', $version),
382382
);
383383

384384
if (is_int($length)) {
@@ -387,7 +387,7 @@ function version_array(string $version, ?int $length = null)
387387
: array_slice(
388388
$versionArray,
389389
0,
390-
$length
390+
$length,
391391
);
392392
}
393393

include/get-download.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $possible_files = [$df, "manual/$df"];
1212

1313
$site_config = [
1414
'current' => 'downloads',
15-
'css' => ['mirror.css']
15+
'css' => ['mirror.css'],
1616
];
1717

1818
// Find out what is the exact file requested

0 commit comments

Comments
 (0)