Skip to content

Commit 57f505e

Browse files
authored
Enhancement: Enable and configure concat_space fixer
Closes GH-657.
1 parent d9bcfed commit 57f505e

20 files changed

+58
-55
lines changed

.php-cs-fixer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
'array_indentation' => true,
2323
'array_syntax' => true,
2424
'class_attributes_separation' => true,
25+
'concat_space' => [
26+
'spacing' => 'one',
27+
],
2528
'constant_case' => true,
2629
'indentation_type' => true,
2730
'line_ending' => true,

cached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
exit;
1919
}
2020
$pwd = realpath($_SERVER["DOCUMENT_ROOT"]);
21-
$abs = $pwd. "/" .(string)$_GET["f"];
21+
$abs = $pwd . "/" . (string)$_GET["f"];
2222
$abs = realpath($abs);
2323

2424
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {

cal.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242
// Unable to find event, put this to the error messages' list
4343
else {
44-
$errors[] = "There is no event for specified id ('".htmlentities($id, ENT_QUOTES | ENT_IGNORE, 'UTF-8')."')";
44+
$errors[] = "There is no event for specified id ('" . htmlentities($id, ENT_QUOTES | ENT_IGNORE, 'UTF-8') . "')";
4545
}
4646
}
4747

@@ -57,7 +57,7 @@
5757
// Try to load events for that day, and display them all
5858
if ($events = load_events($date)) {
5959
$site_header_config = ['classes' => 'calendar calendar-day'] + $site_header_config;
60-
site_header("Events: ".date("F j, Y", $date), $site_header_config);
60+
site_header("Events: " . date("F j, Y", $date), $site_header_config);
6161
echo "<h2>", date("F j, Y", $date), "</h2>\n";
6262
foreach ($events as $event) {
6363
display_event($event, 0);
@@ -68,20 +68,20 @@
6868

6969
// Unable to load events for that day
7070
else {
71-
$errors[] = "There are no events for the specified date (".date("F j, Y",$date).").";
71+
$errors[] = "There are no events for the specified date (" . date("F j, Y",$date) . ").";
7272
}
7373
}
7474

7575
// Wrong date specified
7676
else {
77-
$errors[] = "The specified date (".htmlentities("$cy/$cm/$cd", ENT_QUOTES | ENT_IGNORE, 'UTF-8').") was not valid.";
77+
$errors[] = "The specified date (" . htmlentities("$cy/$cm/$cd", ENT_QUOTES | ENT_IGNORE, 'UTF-8') . ") was not valid.";
7878
unset($cm, $cd, $cy);
7979
}
8080
}
8181

8282
// Check if month and year is valid
8383
if ($cm && $cy && !checkdate($cm,1,$cy)) {
84-
$errors[] = "The specified year and month (".htmlentities("$cy, $cm", ENT_QUOTES | ENT_IGNORE, 'UTF-8').") are not valid.";
84+
$errors[] = "The specified year and month (" . htmlentities("$cy, $cm", ENT_QUOTES | ENT_IGNORE, 'UTF-8') . ") are not valid.";
8585
unset($cm, $cy);
8686
}
8787

@@ -93,7 +93,7 @@
9393
$date = mktime(0, 0, 1, $cm, 1, $cy);
9494

9595
if (!$begun) {
96-
site_header("Events: ".date("F Y", $date), $site_header_config);
96+
site_header("Events: " . date("F Y", $date), $site_header_config);
9797
?>
9898
<div class="tip">
9999
<p>
@@ -189,7 +189,7 @@
189189
// Print out day number and all events for the day
190190
echo '<td><a class="day" href="/cal.php', "?cm=$cm&amp;cd=$i&amp;cy=$cy",
191191
'">',$i,'</a>';
192-
display_events_for_day(date("Y-m-",$bom).sprintf("%02d",$i), $events);
192+
display_events_for_day(date("Y-m-",$bom) . sprintf("%02d",$i), $events);
193193
echo '</td>';
194194

195195
// Break HTML table row if at end of week

conferences/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
$id = parse_url($entry["id"], PHP_URL_FRAGMENT);
3232
$date = date_format(date_create($entry["updated"]), 'Y-m-d');
3333
$content .= '<div class="newsentry">';
34-
$content .= '<h3 class="newstitle title"><a href="'. $MYSITE.$link .'" id="' . $id . '">' . $entry["title"] . '</a></h3>';
34+
$content .= '<h3 class="newstitle title"><a href="' . $MYSITE . $link . '" id="' . $id . '">' . $entry["title"] . '</a></h3>';
3535
$content .= '<div class="newsimage">';
3636

3737
if (isset($entry["newsImage"])) {

error.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@
664664
}
665665
// BC. The class methods are now classname.methodname
666666
if (preg_match("!^manual/(.+)/function\.(.+)-(.+).php$!", $URI, $array)) {
667-
$try = find_manual_page($array[1], $array[2]. "." .$array[3]);
667+
$try = find_manual_page($array[1], $array[2] . "." . $array[3]);
668668
if ($try) {
669669
status_header(301);
670670
mirror_redirect($try);

git-php.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// Force the account requests to php.net
88
if (!is_primary_site()) {
9-
header('Location: https://www.php.net/'.$_SERVER['BASE_PAGE']);
9+
header('Location: https://www.php.net/' . $_SERVER['BASE_PAGE']);
1010
exit;
1111
}
1212

@@ -49,7 +49,7 @@
4949
if (empty($_POST['id'])) {
5050
$error .= "You must supply a desired Git user id. <br>";
5151
} elseif (!preg_match('!^[a-z]\w+$!', $_POST['id']) || strlen($_POST['id']) > 16) {
52-
$error .= "Your user id must be from 1-16 characters long, start with ".
52+
$error .= "Your user id must be from 1-16 characters long, start with " .
5353
"a letter and contain nothing but a-z, 0-9, and _ <br>";
5454
}
5555
if (empty($_POST['fullname'])) {

images/supported-versions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ function date_horiz_coord(DateTime $date) {
159159
?>
160160
<line x1="<?php echo $x ?>" y1="<?php echo $header_height ?>" x2="<?php echo $x ?>" y2="<?php echo $header_height + (count($branches) * $branch_height) ?>" />
161161
<text x="<?php echo $x ?>" y="<?php echo $header_height + (count($branches) * $branch_height) + (0.8 * $footer_height) ?>">
162-
<?php echo 'Today: '.$now->format('j M Y') ?>
162+
<?php echo 'Today: ' . $now->format('j M Y') ?>
163163
</text>
164164
</g>
165165
</svg>

include/email-validation.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ function blacklisted($email) {
103103
'@conferenceseries.com',
104104
];
105105
foreach ($mosquitoes as $m) {
106-
if (preg_match('/'.preg_quote($m, '/').'/i',$email)) return true;
106+
if (preg_match('/' . preg_quote($m, '/') . '/i',$email)) return true;
107107
}
108108
}

include/footer.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
<?php
9090
$jsfiles = ["ext/hogan-3.0.2.min.js", "ext/typeahead.min.js", "ext/mousetrap.min.js", "ext/jquery.scrollTo.min.js", "search.js", "common.js"];
9191
foreach ($jsfiles as $filename) {
92-
$path = dirname(__DIR__).'/js/'.$filename;
93-
echo '<script src="/cached.php?t=' . @filemtime($path) . '&amp;f=/js/' . $filename . '"></script>'."\n";
92+
$path = dirname(__DIR__) . '/js/' . $filename;
93+
echo '<script src="/cached.php?t=' . @filemtime($path) . '&amp;f=/js/' . $filename . '"></script>' . "\n";
9494
}
9595
?>
9696

include/gpg-keys.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ function gpg_key_get(string $rm): ?string {
109109
return
110110
"pub rsa4096 2021-03-26 [SC] [expires: 2030-03-26]\n" .
111111
" E609 13E4 DF20 9907 D8E3 0D96 659A 97C9 CF2A 795A\n" .
112-
"uid [ultimate] Sergey Panteleev <[email protected]>\n".
113-
"uid [ultimate] Sergey Panteleev <[email protected]>\n".
114-
"uid [ultimate] Sergey Panteleev <[email protected]>\n".
112+
"uid [ultimate] Sergey Panteleev <[email protected]>\n" .
113+
"uid [ultimate] Sergey Panteleev <[email protected]>\n" .
114+
"uid [ultimate] Sergey Panteleev <[email protected]>\n" .
115115
"sub rsa4096 2021-03-26 [E] [expires: 2025-03-26]";
116116

117117
case 'stas':

0 commit comments

Comments
 (0)