From 357c190dcac30f092735d68f298734669966ed2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 12 Jul 2022 13:44:16 +0200 Subject: [PATCH 1/2] Enhancement: Enable method_argument_space fixer --- .php-cs-fixer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index c3be35e958..e32ce2808a 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -33,6 +33,7 @@ ], 'indentation_type' => true, 'line_ending' => true, + 'method_argument_space' => true, 'new_with_parentheses' => true, 'no_extra_blank_lines' => true, 'no_trailing_whitespace' => true, From 29484f9d266cb436f8338de0e56497c48af7b762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Tue, 5 Dec 2023 16:18:19 +0100 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' --- ChangeLog-8.php | 222 +++++++++++++++++------------------ cached.php | 2 +- cal.php | 52 ++++---- downloads.php | 3 +- include/branches.inc | 13 +- include/email-validation.inc | 2 +- include/gpg-keys.inc | 3 +- include/langchooser.inc | 6 +- include/layout.inc | 51 +++++--- include/results.inc | 6 +- index.php | 3 +- manual/vote-note.php | 4 +- releases/8.0/common.php | 3 +- releases/8.0/de.php | 19 +-- releases/8.0/en.php | 19 +-- releases/8.0/es.php | 19 +-- releases/8.0/fr.php | 19 +-- releases/8.0/it.php | 19 +-- releases/8.0/ja.php | 19 +-- releases/8.0/ka.php | 19 +-- releases/8.0/nl.php | 19 +-- releases/8.0/pt_BR.php | 19 +-- releases/8.0/ru.php | 19 +-- releases/8.0/tr.php | 19 +-- releases/8.0/zh.php | 19 +-- releases/8.1/common.php | 3 +- releases/8.1/release.inc | 26 ++-- releases/8.2/common.php | 3 +- releases/8.2/release.inc | 48 ++++---- releases/8.3/common.php | 3 +- releases/8.3/release.inc | 23 ++-- releases/index.php | 40 ++++--- 32 files changed, 390 insertions(+), 354 deletions(-) diff --git a/ChangeLog-8.php b/ChangeLog-8.php index da96c9eb37..0250244066 100644 --- a/ChangeLog-8.php +++ b/ChangeLog-8.php @@ -2737,19 +2737,19 @@ @@ -2812,7 +2812,7 @@ @@ -3794,7 +3794,7 @@ @@ -3992,11 +3992,11 @@ @@ -4042,8 +4042,8 @@
  • Hash:
      -
    • Fixed bug (Incorrect return types for hash() and hash_hmac()).
    • -
    • Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
    • +
    • Fixed bug (Incorrect return types for hash() and hash_hmac()).
    • +
    • Fixed bug (Inconsistent argument name in hash_hmac_file and hash_file).
  • MySQLnd:
      @@ -4051,7 +4051,7 @@
  • OCI8:
      -
    • Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
    • +
    • Fixed bug (php_oci_cleanup_global_handles segfaults at second call).
  • OPcache:
      diff --git a/cached.php b/cached.php index 766afb2e65..4a8dbd112f 100644 --- a/cached.php +++ b/cached.php @@ -22,7 +22,7 @@ $abs = realpath($abs); if (strncmp($abs, $pwd, strlen($pwd)) != 0) { - header("Location: https://www.php.net/" . strtr($_GET["f"],["\r" => "", "\n" => ""])); + header("Location: https://www.php.net/" . strtr($_GET["f"], ["\r" => "", "\n" => ""])); exit; } diff --git a/cal.php b/cal.php index 68b5ca1331..5f387f9eff 100644 --- a/cal.php +++ b/cal.php @@ -49,7 +49,7 @@ elseif ($cy && $cm && $cd) { // Check if date is valid - if (checkdate($cm,$cd,$cy)) { + if (checkdate($cm, $cd, $cy)) { // Date integer for that day $date = mktime(0, 0, 1, $cm, $cd, $cy); @@ -68,7 +68,7 @@ // Unable to load events for that day else { - $errors[] = "There are no events for the specified date (" . date("F j, Y",$date) . ")."; + $errors[] = "There are no events for the specified date (" . date("F j, Y", $date) . ")."; } } @@ -80,7 +80,7 @@ } // Check if month and year is valid -if ($cm && $cy && !checkdate($cm,1,$cy)) { +if ($cm && $cy && !checkdate($cm, 1, $cy)) { $errors[] = "The specified year and month (" . htmlentities("$cy, $cm", ENT_QUOTES | ENT_IGNORE, 'UTF-8') . ") are not valid."; unset($cm, $cy); } @@ -125,7 +125,7 @@ } // Beginning and end of this month -$bom = mktime(0, 0, 1, $cm, 1, $cy); +$bom = mktime(0, 0, 1, $cm, 1, $cy); $eom = mktime(0, 0, 1, $cm + 1, 0, $cy); // Link to previous month (but do not link to too early dates) @@ -138,11 +138,13 @@ $month = date('m', $lm); $monthName = date('F', $lm); - return sprintf('%s, %s', - urlencode($month), - urlencode($year), - htmlentities($monthName), - htmlentities($year)); + return sprintf( + '%s, %s', + urlencode($month), + urlencode($year), + htmlentities($monthName), + htmlentities($year) + ); })(); // Link to next month (but do not link to too early dates) @@ -155,11 +157,13 @@ $month = date('m', $nm); $monthName = date('F', $nm); - return sprintf('%s, %s', - urlencode($month), - urlencode($year), - htmlentities($monthName), - htmlentities($year)); + return sprintf( + '%s, %s', + urlencode($month), + urlencode($year), + htmlentities($monthName), + htmlentities($year) + ); })(); // Print out navigation links for previous and next month @@ -174,22 +178,22 @@ // Print out headers for weekdays for ($i = 0; $i < 7; $i++) { - echo '', date("l",mktime(0,0,1,4,$i + 1,2001)), "\n"; + echo '', date("l", mktime(0, 0, 1, 4, $i + 1, 2001)), "\n"; } echo "\n"; // Generate the requisite number of blank days to get things started -for ($days = $i = date("w",$bom); $i > 0; $i--) { +for ($days = $i = date("w", $bom); $i > 0; $i--) { echo ' '; } // Print out all the days in this month -for ($i = 1; $i <= date("t",$bom); $i++) { +for ($i = 1; $i <= date("t", $bom); $i++) { // Print out day number and all events for the day echo '',$i,''; - display_events_for_day(date("Y-m-",$bom) . sprintf("%02d",$i), $events); + display_events_for_day(date("Y-m-", $bom) . sprintf("%02d", $i), $events); echo ''; // Break HTML table row if at end of week @@ -218,11 +222,11 @@ function date_for_recur($recur, $day, $bom, $eom) if ($recur > 0) { $bomd = date("w", $bom) + 1; $days = (($day - $bomd + 7) % 7) + (($recur - 1) * 7); - return mktime(0,0,1, date("m",$bom), $days + 1, date("Y",$bom)); + return mktime(0, 0, 1, date("m", $bom), $days + 1, date("Y", $bom)); } // ${recur}th to last $day of the month - $eomd = date("w",$eom) + 1; + $eomd = date("w", $eom) + 1; $days = (($eomd - $day + 7) % 7) + ((abs($recur) - 1) * 7); 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 function load_event($id) { // Open events CSV file, return on error - $fp = @fopen("backend/events.csv",'r'); + $fp = @fopen("backend/events.csv", 'r'); if (!$fp) { return false; } // Read as we can, event by event @@ -283,15 +287,15 @@ function load_events($from, $whole_month = false) { // Take advantage of the equality behavior of this date format $from_date = date("Y-m-d", $from); - $bom = mktime(0, 0, 1, date("m",$from), 1, date("Y",$from)); - $eom = mktime(0, 0, 1, date("m",$from) + 1, 0, date("Y",$from)); + $bom = mktime(0, 0, 1, date("m", $from), 1, date("Y", $from)); + $eom = mktime(0, 0, 1, date("m", $from) + 1, 0, date("Y", $from)); $to_date = date("Y-m-d", $whole_month ? $eom : $from); // Set arrays to their default $events = $seen = []; // Try to open the events file for reading, return if unable to - $fp = @fopen("backend/events.csv",'r'); + $fp = @fopen("backend/events.csv", 'r'); if (!$fp) { return false; } // For all events, read in the event and check it if fits our scope diff --git a/downloads.php b/downloads.php index b82abe3513..4ba94b8aa2 100644 --- a/downloads.php +++ b/downloads.php @@ -25,7 +25,8 @@

      Old archives

      '; -site_header("Downloads", +site_header( + "Downloads", [ 'link' => [ [ diff --git a/include/branches.inc b/include/branches.inc index 5a2ac26d24..8514f86e04 100644 --- a/include/branches.inc +++ b/include/branches.inc @@ -63,15 +63,16 @@ function format_interval($from, $to) { $eolPeriod = 'midnight'; } if ($times) { - $eolPeriod = implode(', ', - array_map( - function ($t) { + $eolPeriod = implode( + ', ', + array_map( + function ($t) { return "$t[0] $t[1]" . ($t[0] != 1 ? 's' : ''); }, - $times - ) - ); + $times + ) + ); if ($diff->invert) { $eolPeriod = "$eolPeriod ago"; diff --git a/include/email-validation.inc b/include/email-validation.inc index 4a8b6b98d4..67e7a85010 100644 --- a/include/email-validation.inc +++ b/include/email-validation.inc @@ -103,6 +103,6 @@ function blacklisted($email) { '@conferenceseries.com', ]; foreach ($mosquitoes as $m) { - if (preg_match('/' . preg_quote($m, '/') . '/i',$email)) return true; + if (preg_match('/' . preg_quote($m, '/') . '/i', $email)) return true; } } diff --git a/include/gpg-keys.inc b/include/gpg-keys.inc index df5bc8c61c..adf68dcb48 100644 --- a/include/gpg-keys.inc +++ b/include/gpg-keys.inc @@ -191,7 +191,8 @@ function gpg_key_show_keys(bool $activeOnly): void { foreach (gpg_key_get_branches($activeOnly) as $branch => $rms) { $keys = array_filter( array_map(function ($rm) { return gpg_key_get($rm); }, $rms), - function ($key) { return $key !== null; }); + function ($key) { return $key !== null; } + ); if (empty($keys)) { continue; } $branch = htmlentities($branch, ENT_QUOTES, 'UTF-8'); diff --git a/include/langchooser.inc b/include/langchooser.inc index a1897fe725..1b66427176 100644 --- a/include/langchooser.inc +++ b/include/langchooser.inc @@ -56,7 +56,7 @@ function language_choose_code() } // Specified in a shortcut URL (eg. /en/echo or /pt_br/echo) - if (preg_match("!^/(\\w{2}(_\\w{2})?)/!", htmlspecialchars($_SERVER['REQUEST_URI'],ENT_QUOTES, 'UTF-8'), $flang)) { + if (preg_match("!^/(\\w{2}(_\\w{2})?)/!", htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8'), $flang)) { // Put language into preference list $rlang = language_add($flang[1], $languages); @@ -68,7 +68,9 @@ function language_choose_code() // Drop out langauge specification from URL, as this is already handled $_SERVER['STRIPPED_URI'] = preg_replace( - "!^/$flang[1]/!", "/", htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') + "!^/$flang[1]/!", + "/", + htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES, 'UTF-8') ); } diff --git a/include/layout.inc b/include/layout.inc index 563ed8bade..84b19075d6 100644 --- a/include/layout.inc +++ b/include/layout.inc @@ -6,8 +6,8 @@ $_SERVER['MYSITE'] = $MYSITE; ini_set('highlight.comment', 'comment'); ini_set('highlight.default', 'default'); ini_set('highlight.keyword', 'keyword'); -ini_set('highlight.string', 'string'); -ini_set('highlight.html', 'html'); +ini_set('highlight.string', 'string'); +ini_set('highlight.html', 'html'); // Highlight PHP code function highlight_php($code, $return = false) @@ -57,7 +57,7 @@ function commonFooter(): void { site_footer(); } function resize_image($img, $width = 1, $height = 1) { // Drop width and height values from image if available - $str = preg_replace('!width=\"([0-9]+?)\"!i', '', $img); + $str = preg_replace('!width=\"([0-9]+?)\"!i', '', $img); $str = preg_replace('!height=\"([0-9]+?)\"!i', '', $str); // Return image with new width and height added @@ -69,8 +69,14 @@ function resize_image($img, $width = 1, $height = 1) } // Return an tag for a given image file available on the server -function make_image($file, $alt = false, $align = false, $extras = false, - $dir = '/images', $addsize = true) +function make_image( + $file, + $alt = false, + $align = false, + $extras = false, + $dir = '/images', + $addsize = true +) { // If no / was provided at the start of $dir, add it $webdir = $_SERVER['MYSITE'] . ($dir[0] == '/' ? '' : '/') . $dir; @@ -93,7 +99,8 @@ function make_image($file, $alt = false, $align = false, $extras = false, } // Return with image built up - return sprintf('%s', + return sprintf( + '%s', $webdir, $file, ($alt ?: ''), @@ -104,8 +111,13 @@ function make_image($file, $alt = false, $align = false, $extras = false, } // Print an tag out for a given file -function print_image($file, $alt = false, $align = false, $extras = false, - $dir = '/images'): void +function print_image( + $file, + $alt = false, + $align = false, + $extras = false, + $dir = '/images' +): void { echo make_image($file, $alt, $align, $extras, $dir); } @@ -122,8 +134,14 @@ function news_image($URL, $image, $alt, $print = true) } // Return HTML code for a submit button image -function make_submit($file, $alt = false, $align = false, $extras = false, - $dir = '/images', $border = 0) +function make_submit( + $file, + $alt = false, + $align = false, + $extras = false, + $dir = '/images', + $border = 0 +) { // Get an image without size info and convert the // border attribute to use CSS, as border="" is not @@ -149,12 +167,13 @@ function make_link (string $url, string $linktext = ''): string // return a hyperlink to something, within the site, that pops up a new window // function make_popup_link ($url, $linktext = false, $target = false, $windowprops = "", $extras = false) { - return sprintf("%s", + return sprintf( + "%s", htmlspecialchars($url, ENT_QUOTES | ENT_IGNORE), ($target ?: "_new"), htmlspecialchars($url, ENT_QUOTES | ENT_IGNORE), ($target ?: "_new"), - $windowprops, + $windowprops, ($extras ? ' ' . $extras : ''), ($linktext ?: $url) ); @@ -279,13 +298,13 @@ function display_event($event, $include_date = 1): void ]; if (!isset($event['start']) && isset($event['sday'])) { - $sday = mktime(12,0,0,$event['smonth'],$event['sday'],$event['syear']); + $sday = mktime(12, 0, 0, $event['smonth'], $event['sday'], $event['syear']); } else { $sday = (isset($event['start']) && !empty($event['start'])) ? strtotime($event['start']) : 0; } if (!isset($event['end']) && isset($event['eday'])) { - $eday = mktime(12,0,0,$event['emonth'],$event['eday'],$event['eyear']); + $eday = mktime(12, 0, 0, $event['emonth'], $event['eday'], $event['eyear']); } else { $eday = (isset($event['end']) && !empty($event['end'])) ? strtotime($event['end']) : 0; } @@ -311,7 +330,7 @@ function display_event($event, $include_date = 1): void case 2: case 'multi': $dtend = date("Y-m-d", strtotime("+1 day", $eday)); - echo " (", date("Y-m-d",$sday), " to ", date("Y-m-d",$eday), ")"; + echo " (", date("Y-m-d", $sday), " to ", date("Y-m-d", $eday), ")"; break; case 3: case 'recur': @@ -340,7 +359,7 @@ function display_event($event, $include_date = 1): void
      ", trim(htmlentities($event['ldesc'],ENT_QUOTES | ENT_IGNORE, 'UTF-8'))); + echo preg_replace("/\r?\n\r?\n/", "

      ", trim(htmlentities($event['ldesc'], ENT_QUOTES | ENT_IGNORE, 'UTF-8'))); // If we have an URL, print it out if ($event['url']) { echo '

      URL: ', diff --git a/include/results.inc b/include/results.inc index 25f93bf64b..da95f51934 100644 --- a/include/results.inc +++ b/include/results.inc @@ -41,9 +41,9 @@ function search_results($res, $q, $profile = 'all', $per_page = 10, $s = 0, $l = // rewrite mirrors urls (\w\w\d? or www, but not qa, doc, gtk and ~/user) $real_url = preg_replace('@^http://(?!doc|qa|gtk)\w{2,3}\.php\.net(?!/~)(.*)$@', '$1', $hit['Url']); $displayurl = preg_replace('@^http://(?:(?!doc|qa|php|gtk)\w{2,3}\.)?(.+[^/])/?$@', '$1', $hit['Url']); - $type = substr($displayurl,0,strpos($displayurl,'.')); - if($type == 'pecl' && strstr($displayurl,"/bugs/")) $type = "peclbugs"; - if($type == 'pear' && strstr($displayurl,"/bugs/")) $type = "pearbugs"; + $type = substr($displayurl, 0, strpos($displayurl, '.')); + if($type == 'pecl' && strstr($displayurl, "/bugs/")) $type = "peclbugs"; + if($type == 'pear' && strstr($displayurl, "/bugs/")) $type = "pearbugs"; if($type == 'smarty') continue; $display_title = str_replace(['PHP:', '&'], ['', '&'], $hit['Title']); diff --git a/index.php b/index.php index 820b9e1b78..b5ff67f724 100644 --- a/index.php +++ b/index.php @@ -121,7 +121,8 @@ $meta_image_path = $MYSITE . 'images/meta-image.png'; $meta_description = "PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world."; -site_header("Hypertext Preprocessor", +site_header( + "Hypertext Preprocessor", [ 'current' => 'home', 'headtags' => [ diff --git a/manual/vote-note.php b/manual/vote-note.php index dae5b8b559..7d0f0ea269 100644 --- a/manual/vote-note.php +++ b/manual/vote-note.php @@ -30,7 +30,7 @@ "vote" => $_REQUEST['vote'], "ip" => $_SERVER['REMOTE_ADDR'] ]; - if (($r = posttohost($master_url, $data)) === null || strpos($r,"failed to open socket to") !== false) { + if (($r = posttohost($master_url, $data)) === null || strpos($r, "failed to open socket to") !== false) { $response["success"] = false; $response["msg"] = "Could not process your request at this time. Please try again later..."; } @@ -72,7 +72,7 @@ "vote" => $_REQUEST['vote'], "ip" => $_SERVER['REMOTE_ADDR'], ]; - if (($r = posttohost($master_url, $data)) !== null && strpos($r,"failed to open socket to") === false) { + if (($r = posttohost($master_url, $data)) !== null && strpos($r, "failed to open socket to") === false) { $r = json_decode($r); if (isset($r->status, $r->votes) && $r->status) { $thankyou = true; diff --git a/releases/8.0/common.php b/releases/8.0/common.php index f25c034cf4..9f02b4934b 100644 --- a/releases/8.0/common.php +++ b/releases/8.0/common.php @@ -7,7 +7,8 @@ function common_header(string $description): void { global $MYSITE; $meta_image_path = \htmlspecialchars( - \filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL)); + \filter_var($MYSITE . 'images/php8/php_8_released.png', \FILTER_VALIDATE_URL) + ); $meta_description = \htmlspecialchars($description); \site_header("PHP 8.0.0 Release Announcement", [ diff --git a/releases/8.0/de.php b/releases/8.0/de.php index 939ec822ab..b80bd54357 100644 --- a/releases/8.0/de.php +++ b/releases/8.0/de.php @@ -7,7 +7,8 @@ 'Es beinhaltet viele neue Funktionen und Optimierungen wie beispielsweise ' . 'Named Arguments, Union Types, Attribute, Constructor Property Promotion, ' . 'Match Ausdrücke, Nullsafe Operator, JIT und Verbesserungen des Typen-Systems, ' . - 'der Fehlerbehandlung und der Konsistenz.'); + 'der Fehlerbehandlung und der Konsistenz.' +); ?>
      @@ -44,8 +45,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -53,8 +54,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -76,14 +77,14 @@
      PHP 7
      +);?>
      @@ -91,12 +92,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/en.php b/releases/8.0/en.php index 78228d7681..8b82e7b317 100644 --- a/releases/8.0/en.php +++ b/releases/8.0/en.php @@ -7,7 +7,8 @@ 'It contains many new features and optimizations including ' . 'named arguments, union types, attributes, constructor property promotion, ' . 'match expression, nullsafe operator, JIT, and ' . - 'improvements in the type system, error handling, and consistency.'); + 'improvements in the type system, error handling, and consistency.' +); ?>
      @@ -43,8 +44,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -54,8 +55,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -77,14 +78,14 @@
      PHP 7
      +);?>
      @@ -92,12 +93,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/es.php b/releases/8.0/es.php index 474a776fdb..16925a78c6 100644 --- a/releases/8.0/es.php +++ b/releases/8.0/es.php @@ -5,7 +5,8 @@ releases\php80\common_header( 'PHP 8.0 es una actualización importante del lenguaje php que contiene nuevos recursos y optimizaciones incluyendo ' . 'argumentos nombrados, tipos de uniones, atributos, promoción de propiedades constructivas, expresiones de equivalencia, ' . - 'operador nullsafe, JIT (traducción dinámica) y también mejoras en el sistema de tipos, manejo de errores y consistencia en general.'); + 'operador nullsafe, JIT (traducción dinámica) y también mejoras en el sistema de tipos, manejo de errores y consistencia en general.' +); ?>
      @@ -42,8 +43,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -53,8 +54,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -76,14 +77,14 @@
      PHP 7
      +);?>
      @@ -91,12 +92,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/fr.php b/releases/8.0/fr.php index babed19134..52824e012d 100644 --- a/releases/8.0/fr.php +++ b/releases/8.0/fr.php @@ -9,7 +9,8 @@ "promotion de propriétés de constructeur, l'expression match, " . "l'opérateur nullsafe, JIT (Compilation à la Volée), " . "et des améliorations dans le système de typage, " . - "la gestion d'erreur, et de cohérence."); + "la gestion d'erreur, et de cohérence." +); ?>
      @@ -47,8 +48,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -58,8 +59,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -81,12 +82,12 @@
      PHP 7
      +);?>
      @@ -94,10 +95,10 @@ class User
      PHP 8
      +);?>
      diff --git a/releases/8.0/it.php b/releases/8.0/it.php index e5e4b7e24b..ebd4225542 100644 --- a/releases/8.0/it.php +++ b/releases/8.0/it.php @@ -7,7 +7,8 @@ 'Contiene molte nuove funzionalità ed ottimizzazioni quali ' . 'i named arguments, la definizione di tipi unione, gli attributi, la promozione a proprietà degli argomenti del costruttore, ' . 'l\'espressione match, l\'operatore nullsafe, la compilazione JIT e ' . - 'miglioramenti al sistema dei tipi, alla gestione degli errori e alla consistenza.'); + 'miglioramenti al sistema dei tipi, alla gestione degli errori e alla consistenza.' +); ?>
      @@ -45,8 +46,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -56,8 +57,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -79,14 +80,14 @@
      PHP 7
      +);?>
      @@ -94,12 +95,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/ja.php b/releases/8.0/ja.php index b00afdf42f..fa9a6ec209 100644 --- a/releases/8.0/ja.php +++ b/releases/8.0/ja.php @@ -7,7 +7,8 @@ 'このアップデートには、たくさんの新機能や最適化が含まれています。たとえば' . '名前付き引数、union 型、アトリビュート、コンストラクタでのプロパティのプロモーション、' . 'match 式、 nullsafe 演算子、JIT、' . - '型システムの改善、エラーハンドリング、一貫性の向上などです。'); + '型システムの改善、エラーハンドリング、一貫性の向上などです。' +); ?>
      @@ -42,8 +43,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -53,8 +54,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -76,14 +77,14 @@
      PHP 7
      +);?>
      @@ -91,12 +92,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/ka.php b/releases/8.0/ka.php index 71fb72e5d4..3fe54eb42f 100644 --- a/releases/8.0/ka.php +++ b/releases/8.0/ka.php @@ -8,7 +8,8 @@ 'მათ შორის დასახელებული არგუმენტები, union type, ატრიბუტები, ' . 'თვისებების გამარტივებული განსაზღვრა კონსტრუქტორში, გამოსახულება match, ' . 'ოპერატორი nullsafe, JIT და გაუმჯობესებები ტიპის სისტემაში, ' . - 'შეცდომების დამუშავება და თანმიმდევრულობა.'); + 'შეცდომების დამუშავება და თანმიმდევრულობა.' +); ?>
      @@ -44,8 +45,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -55,8 +56,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -78,14 +79,14 @@
      PHP 7
      +);?>
      @@ -93,12 +94,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/nl.php b/releases/8.0/nl.php index e9cedcaa8b..2b11752085 100644 --- a/releases/8.0/nl.php +++ b/releases/8.0/nl.php @@ -7,7 +7,8 @@ 'Het bevat veel nieuwe mogelijkheden en optimalisaties, waaronder ' . 'argument naamgeving, unie types, attributen, promotie van constructor eigenschappen, ' . 'expressie vergelijking, null-veilige operator, JIT, en ' . - 'verbeteringen aan het type systeem, foute afhandeling, en consistentie.'); + 'verbeteringen aan het type systeem, foute afhandeling, en consistentie.' +); ?>
      @@ -44,8 +45,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -55,8 +56,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -78,14 +79,14 @@
      PHP 7
      +);?>
      @@ -93,12 +94,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/pt_BR.php b/releases/8.0/pt_BR.php index 1b517b1027..ce7d549dce 100644 --- a/releases/8.0/pt_BR.php +++ b/releases/8.0/pt_BR.php @@ -8,7 +8,8 @@ 'incluindo argumentos nomeados, união de tipos, atributos, ' . 'promoção de propriedade do construtor, expressão match, ' . 'operador nullsafe, JIT e melhorias no sistema de tipos, ' . - 'tratamento de erros e consistência.'); + 'tratamento de erros e consistência.' +); ?>
      @@ -45,8 +46,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -54,8 +55,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -77,14 +78,14 @@
      PHP 7
      +);?>
      @@ -92,12 +93,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/ru.php b/releases/8.0/ru.php index 4fbf0d9fb3..adf6340cd3 100644 --- a/releases/8.0/ru.php +++ b/releases/8.0/ru.php @@ -8,7 +8,8 @@ 'включая именованные аргументы, тип union, атрибуты, ' . 'упрощённое определение свойств в конструкторе, выражение match, ' . 'оператор nullsafe, JIT и улучшения в системе типов, ' . - 'обработке ошибок и консистентности.'); + 'обработке ошибок и консистентности.' +); ?>
      @@ -44,8 +45,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -53,8 +54,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -76,14 +77,14 @@
      PHP 7
      +);?>
      @@ -91,12 +92,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/tr.php b/releases/8.0/tr.php index c8eb19be5c..b81c875b76 100644 --- a/releases/8.0/tr.php +++ b/releases/8.0/tr.php @@ -5,7 +5,8 @@ releases\php80\common_header( 'PHP 8.0, PHP dili için önemli bir güncellemedir. Optimizasyonlar ve yeni özellikler: Adlandırılmış ' . 'Değişkenler, Union Types, Attributes, Kurucularda Özellik Tanımı, Match İfadesi, Nullsafe Operatorü, ' . - 'JIT(Anında Derleme) yanında tip sistemi, hata işleme ve tutarlılıkta iyileştirmeler içerir.'); + 'JIT(Anında Derleme) yanında tip sistemi, hata işleme ve tutarlılıkta iyileştirmeler içerir.' +); ?>
      @@ -41,8 +42,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -52,8 +53,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -75,14 +76,14 @@
      PHP 7
      +);?>
      @@ -90,12 +91,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.0/zh.php b/releases/8.0/zh.php index 49399c5056..100db6e9ce 100644 --- a/releases/8.0/zh.php +++ b/releases/8.0/zh.php @@ -5,7 +5,8 @@ releases\php80\common_header( 'PHP 8.0 是 PHP 语言的一个主版本更新。它包含了很多新功能与优化项,' . '包括命名参数、联合类型、注解、构造器属性提升、match 表达式、' . - 'Nullsafe 运算符、JIT,并改进了类型系统、错误处理、语法一致性。'); + 'Nullsafe 运算符、JIT,并改进了类型系统、错误处理、语法一致性。' +); ?>
      @@ -41,8 +42,8 @@
      PHP 7
      + 'htmlspecialchars($string, ENT_COMPAT | ENT_HTML401, \'UTF-8\', false);' +);?>
      @@ -52,8 +53,8 @@
      PHP 8
      + 'htmlspecialchars($string, double_encode: false);' +);?>
      @@ -75,14 +76,14 @@
      PHP 7
      +);?>
      @@ -90,12 +91,12 @@ public function get($id) { /* ... */ }
      PHP 8
      +);?>
      diff --git a/releases/8.1/common.php b/releases/8.1/common.php index 1426de3cf3..e9bdd68c87 100644 --- a/releases/8.1/common.php +++ b/releases/8.1/common.php @@ -8,7 +8,8 @@ function common_header(string $description): void { global $MYSITE; $meta_image_path = \htmlspecialchars( - \filter_var($MYSITE . 'images/php8/php_8_1_released.png', \FILTER_VALIDATE_URL)); + \filter_var($MYSITE . 'images/php8/php_8_1_released.png', \FILTER_VALIDATE_URL) + ); $meta_description = \htmlspecialchars($description); \site_header("PHP 8.1.0 Release Announcement", [ diff --git a/releases/8.1/release.inc b/releases/8.1/release.inc index 8837788c04..8d2eb4443b 100644 --- a/releases/8.1/release.inc +++ b/releases/8.1/release.inc @@ -44,7 +44,7 @@ common_header(message('common_header', $lang));
      PHP < 8.1
      +);?>
      @@ -62,7 +61,7 @@ PHP
      PHP 8.1
      +);?>
      @@ -91,7 +89,7 @@ PHP
      PHP < 8.1
      +);?>
      @@ -116,7 +113,7 @@ PHP
      PHP 8.1
      +);?>
      @@ -287,7 +284,6 @@ function count_and_iterate(Iterator $value) { count($value); } PHP - );?> @@ -335,7 +331,6 @@ function redirectToLoginPage() { echo 'Hello'; // <- dead code } PHP - );?> @@ -355,7 +350,6 @@ function redirectToLoginPage(): never { echo 'Hello'; // <- dead code detected by static analysis } PHP - );?> @@ -386,7 +380,6 @@ class Bar extends Foo public const XX = "bar"; // No error } PHP - );?> @@ -406,7 +399,6 @@ class Bar extends Foo public const XX = "bar"; // Fatal error } PHP - );?> @@ -430,7 +422,6 @@ PHP 016 === 16; // false because `016` is octal for `14` and it's confusing 016 === 14; // true PHP - );?> @@ -471,7 +462,6 @@ $httpClient->request('https://example.com/') print json_decode($responseBody)['code']; }); PHP - );?> diff --git a/releases/8.2/common.php b/releases/8.2/common.php index 755ce48a53..0ce7c392e1 100644 --- a/releases/8.2/common.php +++ b/releases/8.2/common.php @@ -14,7 +14,8 @@ function common_header(string $description): void { global $MYSITE; $meta_image_path = \htmlspecialchars( - \filter_var($MYSITE . 'images/php8/php_8_2_released.png', \FILTER_VALIDATE_URL)); + \filter_var($MYSITE . 'images/php8/php_8_2_released.png', \FILTER_VALIDATE_URL) + ); $meta_description = \htmlspecialchars($description); \site_header("PHP 8.2.0 Release Announcement", [ diff --git a/releases/8.2/release.inc b/releases/8.2/release.inc index e291205e52..d4d0840f4a 100644 --- a/releases/8.2/release.inc +++ b/releases/8.2/release.inc @@ -43,16 +43,16 @@ common_header(message('common_header', $lang)); RFC + 'documentation', + $lang +) ?>
      PHP < 8.2
      +); ?>
      @@ -75,7 +74,7 @@ PHP
      PHP 8.2
      +); ?>
      @@ -101,16 +100,16 @@ PHP RFC + 'documentation', + $lang +) ?>
      PHP < 8.2
      + ); ?>
      @@ -167,7 +165,6 @@ class Falsy public function almostNull(): string|null { /* ... */ *} } PHP - ); ?>
      @@ -176,7 +173,7 @@ PHP
      PHP 8.2
      + ); ?>
      @@ -251,9 +248,9 @@ PHP RFC + 'documentation', + $lang + ) ?>
      @@ -289,9 +286,9 @@ PHP RFC + 'documentation', + $lang + ) ?>
      @@ -310,7 +307,6 @@ $user->last_name = 'Doe'; $user = new stdClass(); $user->last_name = 'Doe'; PHP - ); ?>
      @@ -319,7 +315,7 @@ PHP
      PHP 8.2
      last_name = 'Doe'; // Deprecated notice $user = new stdClass(); $user->last_name = 'Doe'; // Still allowed PHP - ); ?> + ); ?>
      diff --git a/releases/8.3/common.php b/releases/8.3/common.php index 3a28d7235c..d9f15c37ce 100644 --- a/releases/8.3/common.php +++ b/releases/8.3/common.php @@ -14,7 +14,8 @@ function common_header(string $description): void { global $MYSITE; $meta_image_path = \htmlspecialchars( - \filter_var($MYSITE . 'images/php8/php_8_3_released.png', \FILTER_VALIDATE_URL)); + \filter_var($MYSITE . 'images/php8/php_8_3_released.png', \FILTER_VALIDATE_URL) + ); $meta_description = \htmlspecialchars($description); \site_header("PHP 8.3.0 Release Announcement", [ diff --git a/releases/8.3/release.inc b/releases/8.3/release.inc index 4e7aaf46aa..545ca0cb24 100644 --- a/releases/8.3/release.inc +++ b/releases/8.3/release.inc @@ -47,7 +47,7 @@ common_header(message('common_header', $lang));
      PHP < 8.3
      +); ?>
      @@ -67,7 +66,7 @@ PHP
      PHP 8.3
      +); ?>
      @@ -95,7 +94,7 @@ PHP
      PHP < 8.3
      +); ?>
      @@ -113,7 +111,7 @@ PHP
      PHP 8.3
      +); ?>
      @@ -157,7 +155,6 @@ final class MyTest extends TestCase { // The log file will never be removed, because the // method name was mistyped (taerDown vs tearDown). PHP - ); ?> @@ -226,7 +223,6 @@ $cloned = clone $instance; // Fatal error: Cannot modify readonly property Foo::$php PHP - ); ?> @@ -285,7 +281,6 @@ function json_validate(string $string): bool { var_dump(json_validate('{ "test": { "foo": "bar" } }')); // true PHP - ); ?> @@ -342,7 +337,6 @@ $randomDomain = sprintf( echo $randomDomain; PHP - ); ?> @@ -406,7 +400,6 @@ $chanceForTrue = 0.1; // introducing a small bias. $myBoolean = getFloat(0, 1) < $chanceForTrue; PHP - ); ?> diff --git a/releases/index.php b/releases/index.php index cbfd16eefa..937bb377a7 100644 --- a/releases/index.php +++ b/releases/index.php @@ -181,16 +181,20 @@ function recentEOLBranchesHTML(): string { /** * @param bool|array $announcement */ -function mk_rel(int $major, - string $ver, - string $date, - $announcement, - array $source, - array $windows, - bool $museum): void { - printf("\n

      %1\$s

      \n
        \n
      • Released: %s
      • \n
      • Announcement: ", - ($pos = strpos($ver, " ")) ? substr($ver, 0, $pos) : $ver, - $date); +function mk_rel( + int $major, + string $ver, + string $date, + $announcement, + array $source, + array $windows, + bool $museum +): void { + printf( + "\n

        %1\$s

        \n
          \n
        • Released: %s
        • \n
        • Announcement: ", + ($pos = strpos($ver, " ")) ? substr($ver, 0, $pos) : $ver, + $date + ); if ($announcement) { if (is_array($announcement)) { @@ -236,12 +240,20 @@ function mk_rel(int $major, if (!isset($src["filename"])) { continue; } - printf('
        • %s
        • ', - $major, $src["filename"], $src["name"]); + printf( + '
        • %s
        • ', + $major, + $src["filename"], + $src["name"] + ); } foreach ($windows as $src) { - printf('
        • %s
        • ', - ($major == 5 ? "php5" : "win32"), $src["filename"], $src["name"]); + printf( + '
        • %s
        • ', + ($major == 5 ? "php5" : "win32"), + $src["filename"], + $src["name"] + ); } }