Skip to content

Commit 100e339

Browse files
committed
Fix: Run 'make coding-standards'
1 parent 6f9efeb commit 100e339

File tree

21 files changed

+261
-220
lines changed

21 files changed

+261
-220
lines changed

ChangeLog-8.php

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

cached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
$abs = realpath($abs);
2323

2424
if (strncmp($abs, $pwd, strlen($pwd)) != 0) {
25-
header("Location: https://www.php.net/" . strtr($_GET["f"],array("\r"=>"", "\n"=>"")));
25+
header("Location: https://www.php.net/" . strtr($_GET["f"], array("\r"=>"", "\n"=>"")));
2626
exit;
2727
}
2828

cal.php

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
elseif ($cy && $cm && $cd) {
5050

5151
// Check if date is valid
52-
if (checkdate($cm,$cd,$cy)) {
52+
if (checkdate($cm, $cd, $cy)) {
5353

5454
// Date integer for that day
5555
$date = mktime(0, 0, 1, $cm, $cd, $cy);
@@ -68,7 +68,7 @@
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

@@ -80,7 +80,7 @@
8080
}
8181

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

127127
// Beginning and end of this month
128-
$bom = mktime(0, 0, 1, $cm, 1, $cy);
128+
$bom = mktime(0, 0, 1, $cm, 1, $cy);
129129
$eom = mktime(0, 0, 1, $cm+1, 0, $cy);
130130

131131
// Link to previous month (but do not link to too early dates)
@@ -138,11 +138,13 @@
138138

139139
$month = date('m', $lm);
140140
$monthName = date('F', $lm);
141-
return sprintf('<a href="/cal.php?cm=%s&amp;cy=%s">%s, %s</a>',
142-
urlencode($month),
143-
urlencode($year),
144-
htmlentities($monthName),
145-
htmlentities($year));
141+
return sprintf(
142+
'<a href="/cal.php?cm=%s&amp;cy=%s">%s, %s</a>',
143+
urlencode($month),
144+
urlencode($year),
145+
htmlentities($monthName),
146+
htmlentities($year)
147+
);
146148
})();
147149

148150
// Link to next month (but do not link to too early dates)
@@ -155,11 +157,13 @@
155157

156158
$month = date('m', $nm);
157159
$monthName = date('F', $nm);
158-
return sprintf('<a href="/cal.php?cm=%s&amp;cy=%s">%s, %s</a>',
159-
urlencode($month),
160-
urlencode($year),
161-
htmlentities($monthName),
162-
htmlentities($year));
160+
return sprintf(
161+
'<a href="/cal.php?cm=%s&amp;cy=%s">%s, %s</a>',
162+
urlencode($month),
163+
urlencode($year),
164+
htmlentities($monthName),
165+
htmlentities($year)
166+
);
163167
})();
164168

165169
// Print out navigation links for previous and next month
@@ -174,22 +178,22 @@
174178

175179
// Print out headers for weekdays
176180
for ($i = 0; $i < 7; $i++) {
177-
echo '<th width="14%">', date("l",mktime(0,0,1,4,$i+1,2001)), "</th>\n";
181+
echo '<th width="14%">', date("l", mktime(0, 0, 1, 4, $i+1, 2001)), "</th>\n";
178182
}
179183
echo "</tr>\n<tr>";
180184

181185
// Generate the requisite number of blank days to get things started
182-
for ($days = $i = date("w",$bom); $i > 0; $i--) {
186+
for ($days = $i = date("w", $bom); $i > 0; $i--) {
183187
echo '<td class="notaday">&nbsp;</td>';
184188
}
185189

186190
// Print out all the days in this month
187-
for ($i = 1; $i <= date("t",$bom); $i++) {
191+
for ($i = 1; $i <= date("t", $bom); $i++) {
188192

189193
// Print out day number and all events for the day
190194
echo '<td><a class="day" href="/cal.php', "?cm=$cm&amp;cd=$i&amp;cy=$cy",
191195
'">',$i,'</a>';
192-
display_events_for_day(date("Y-m-",$bom).sprintf("%02d",$i), $events);
196+
display_events_for_day(date("Y-m-", $bom).sprintf("%02d", $i), $events);
193197
echo '</td>';
194198

195199
// Break HTML table row if at end of week
@@ -218,11 +222,11 @@ function date_for_recur($recur, $day, $bom, $eom)
218222
if ($recur > 0) {
219223
$bomd = date("w", $bom) + 1;
220224
$days = (($day - $bomd + 7) % 7) + (($recur - 1) * 7);
221-
return mktime(0,0,1, date("m",$bom), $days + 1, date("Y",$bom));
225+
return mktime(0, 0, 1, date("m", $bom), $days + 1, date("Y", $bom));
222226
}
223227

224228
// ${recur}th to last $day of the month
225-
$eomd = date("w",$eom) + 1;
229+
$eomd = date("w", $eom) + 1;
226230
$days = (($eomd - $day + 7) % 7) + ((abs($recur) - 1) * 7);
227231

228232
return mktime(0, 0, 1, date("m", $bom)+1, -$days, date("Y", $bom));
@@ -256,7 +260,7 @@ function display_events_for_day($day, $events): void
256260
function load_event($id)
257261
{
258262
// Open events CSV file, return on error
259-
$fp = @fopen("backend/events.csv",'r');
263+
$fp = @fopen("backend/events.csv", 'r');
260264
if (!$fp) { return FALSE; }
261265

262266
// Read as we can, event by event
@@ -283,15 +287,15 @@ function load_events($from, $whole_month = FALSE)
283287
{
284288
// Take advantage of the equality behavior of this date format
285289
$from_date = date("Y-m-d", $from);
286-
$bom = mktime(0, 0, 1, date("m",$from), 1, date("Y",$from));
287-
$eom = mktime(0, 0, 1, date("m",$from) + 1, 0, date("Y",$from));
290+
$bom = mktime(0, 0, 1, date("m", $from), 1, date("Y", $from));
291+
$eom = mktime(0, 0, 1, date("m", $from) + 1, 0, date("Y", $from));
288292
$to_date = date("Y-m-d", $whole_month ? $eom : $from);
289293

290294
// Set arrays to their default
291295
$events = $seen = array();
292296

293297
// Try to open the events file for reading, return if unable to
294-
$fp = @fopen("backend/events.csv",'r');
298+
$fp = @fopen("backend/events.csv", 'r');
295299
if (!$fp) { return FALSE; }
296300

297301
// For all events, read in the event and check it if fits our scope

downloads.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
<p class="panel"><a href="/releases/">Old archives</a></p>
2626
';
2727

28-
site_header("Downloads",
28+
site_header(
29+
"Downloads",
2930
array(
3031
'link' => array(
3132
array(

index.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
$meta_image_path = $MYSITE . 'images/meta-image.png';
123123
$meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.";
124124

125-
site_header("Hypertext Preprocessor",
125+
site_header(
126+
"Hypertext Preprocessor",
126127
array(
127128
'current' => 'home',
128129
'headtags' => array(

manual/vote-note.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"vote" => $_REQUEST['vote'],
3434
"ip" => $_SERVER['REMOTE_ADDR']
3535
);
36-
if (($r = posttohost($master_url, $data)) === null || strpos($r,"failed to open socket to") !== false) {
36+
if (($r = posttohost($master_url, $data)) === null || strpos($r, "failed to open socket to") !== false) {
3737
$response["success"] = false;
3838
$response["msg"] = "Could not process your request at this time. Please try again later...";
3939
}
@@ -77,7 +77,7 @@
7777
"vote" => $_REQUEST['vote'],
7878
"ip" => $_SERVER['REMOTE_ADDR'],
7979
);
80-
if (($r = posttohost($master_url, $data)) !== null && strpos($r,"failed to open socket to") === false) {
80+
if (($r = posttohost($master_url, $data)) !== null && strpos($r, "failed to open socket to") === false) {
8181
$r = json_decode($r);
8282
if (isset($r->status, $r->votes) && $r->status) {
8383
$thankyou = true;
@@ -130,8 +130,12 @@
130130
$backID = htmlspecialchars($_REQUEST['id']);
131131
$backPAGE = htmlspecialchars($_REQUEST['page']);
132132
manual_note_display(
133-
$N[$_REQUEST['id']]['xwhen'], $N[$_REQUEST['id']]['user'], $N[$_REQUEST['id']]['note'], $N[$_REQUEST['id']]['id'],
134-
$N[$_REQUEST['id']]['votes'], false
133+
$N[$_REQUEST['id']]['xwhen'],
134+
$N[$_REQUEST['id']]['user'],
135+
$N[$_REQUEST['id']]['note'],
136+
$N[$_REQUEST['id']]['id'],
137+
$N[$_REQUEST['id']]['votes'],
138+
false
135139
);
136140
?>
137141
</div>
@@ -186,8 +190,12 @@
186190
$backID = htmlspecialchars($_REQUEST['id']);
187191
$backPAGE = htmlspecialchars($_REQUEST['page']);
188192
manual_note_display(
189-
$N[$_REQUEST['id']]['xwhen'], $N[$_REQUEST['id']]['user'], $N[$_REQUEST['id']]['note'], $N[$_REQUEST['id']]['id'],
190-
$N[$_REQUEST['id']]['votes'], false
193+
$N[$_REQUEST['id']]['xwhen'],
194+
$N[$_REQUEST['id']]['user'],
195+
$N[$_REQUEST['id']]['note'],
196+
$N[$_REQUEST['id']]['id'],
197+
$N[$_REQUEST['id']]['votes'],
198+
false
191199
);
192200
?>
193201
</div>

releases/8.0/common.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ function common_header(string $description): void {
77
global $MYSITE;
88

99
$meta_image_path = \htmlspecialchars(
10-
\filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL));
10+
\filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL)
11+
);
1112
$meta_description = \htmlspecialchars($description);
1213

1314
\site_header("PHP 8.0.0 Release Announcement", [

releases/8.0/de.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
'Es beinhaltet viele neue Funktionen und Optimierungen wie beispielsweise ' .
88
'Named Arguments, Union Types, Attribute, Constructor Property Promotion, ' .
99
'Match Ausdrücke, Nullsafe Operator, JIT und Verbesserungen des Typen-Systems, ' .
10-
'der Fehlerbehandlung und der Konsistenz.');
10+
'der Fehlerbehandlung und der Konsistenz.'
11+
);
1112

1213
?>
1314
<section class="php8-section php8-section_dark php8-section_header center">
@@ -44,17 +45,17 @@
4445
<div class="php8-compare__label">PHP 7</div>
4546
<div class="php8-code phpcode">
4647
<?php highlight_php_trimmed(
47-
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
48-
);?>
48+
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
49+
);?>
4950
</div>
5051
</div>
5152
<div class="php8-compare__arrow"></div>
5253
<div class="php8-compare__block example-contents">
5354
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
5455
<div class="php8-code phpcode">
5556
<?php highlight_php_trimmed(
56-
'htmlspecialchars($string, double_encode: false);'
57-
);?>
57+
'htmlspecialchars($string, double_encode: false);'
58+
);?>
5859
</div>
5960
</div>
6061
</div>

releases/8.0/en.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
'It contains many new features and optimizations including ' .
88
'named arguments, union types, attributes, constructor property promotion, ' .
99
'match expression, nullsafe operator, JIT, and ' .
10-
'improvements in the type system, error handling, and consistency.');
10+
'improvements in the type system, error handling, and consistency.'
11+
);
1112

1213
?>
1314
<section class="php8-section php8-section_dark php8-section_header center">
@@ -43,8 +44,8 @@
4344
<div class="php8-compare__label">PHP 7</div>
4445
<div class="php8-code phpcode">
4546
<?php highlight_php_trimmed(
46-
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
47-
);?>
47+
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
48+
);?>
4849
</div>
4950

5051

@@ -54,8 +55,8 @@
5455
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
5556
<div class="php8-code phpcode">
5657
<?php highlight_php_trimmed(
57-
'htmlspecialchars($string, double_encode: false);'
58-
);?>
58+
'htmlspecialchars($string, double_encode: false);'
59+
);?>
5960
</div>
6061
</div>
6162
</div>

releases/8.0/es.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
releases\php80\common_header(
66
'PHP 8.0 es una actualización importante del lenguaje php que contiene nuevos recursos y optimizaciones incluyendo ' .
77
'argumentos nombrados, tipos de uniones, atributos, promoción de propiedades constructivas, expresiones de equivalencia, ' .
8-
'operador nullsafe, JIT (traducción dinámica) y también mejoras en el sistema de tipos, manejo de errores y consistencia en general.');
8+
'operador nullsafe, JIT (traducción dinámica) y también mejoras en el sistema de tipos, manejo de errores y consistencia en general.'
9+
);
910

1011
?>
1112
<section class="php8-section php8-section_dark php8-section_header center">
@@ -42,8 +43,8 @@
4243
<div class="php8-compare__label">PHP 7</div>
4344
<div class="php8-code phpcode">
4445
<?php highlight_php_trimmed(
45-
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
46-
);?>
46+
'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);'
47+
);?>
4748
</div>
4849

4950

@@ -53,8 +54,8 @@
5354
<div class="php8-compare__label php8-compare__label_new">PHP 8</div>
5455
<div class="php8-code phpcode">
5556
<?php highlight_php_trimmed(
56-
'htmlspecialchars($string, double_encode: false);'
57-
);?>
57+
'htmlspecialchars($string, double_encode: false);'
58+
);?>
5859
</div>
5960
</div>
6061
</div>

0 commit comments

Comments
 (0)