From 326ec8854f37cae8a6ad59c92eb6ae08273fee6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 11 Sep 2022 22:53:08 +0200 Subject: [PATCH 1/2] Enhancement: Enable new_with_braces fixer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andreas Möller Co-authored-by: Mathias Reker --- .php-cs-fixer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 42c7e609c4..dead2fbc7f 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -29,6 +29,7 @@ 'constant_case' => true, 'indentation_type' => true, 'line_ending' => true, + 'new_with_braces' => true, 'no_extra_blank_lines' => true, 'no_trailing_whitespace' => true, 'ordered_class_elements' => true, From bfa526827be764555e25010da78883442c28f1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 11 Sep 2022 22:55:31 +0200 Subject: [PATCH 2/2] Fix: Run 'make coding-standards' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Andreas Möller Co-authored-by: Mathias Reker --- images/supported-versions.php | 2 +- include/branches.inc | 6 +++--- include/shared-manual.inc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/images/supported-versions.php b/images/supported-versions.php index 3c28e29a61..d1e0375810 100644 --- a/images/supported-versions.php +++ b/images/supported-versions.php @@ -154,7 +154,7 @@ function date_horiz_coord(DateTime $date) { diff --git a/include/branches.inc b/include/branches.inc index 23ffd66018..5a2ac26d24 100644 --- a/include/branches.inc +++ b/include/branches.inc @@ -130,7 +130,7 @@ function get_all_branches() { function get_active_branches($include_recent_eols = true) { $branches = []; - $now = new DateTime; + $now = new DateTime(); foreach ($GLOBALS['RELEASES'] as $major => $releases) { foreach ($releases as $version => $release) { @@ -164,7 +164,7 @@ function get_active_branches($include_recent_eols = true) { function get_eol_branches($always_include = null) { $always_include = $always_include ?: []; $branches = []; - $now = new DateTime; + $now = new DateTime(); // Gather the last release on each branch into a convenient array. foreach ($GLOBALS['OLDRELEASES'] as $major => $releases) { @@ -325,7 +325,7 @@ function get_branch_support_state($branch) { $security = get_branch_security_eol_date($branch); if ($initial && $bug && $security) { - $now = new DateTime; + $now = new DateTime(); if ($now >= $security) { return 'eol'; diff --git a/include/shared-manual.inc b/include/shared-manual.inc index 1461866265..e6b6001acb 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -35,7 +35,7 @@ function manual_notes($notes) { $filename = substr($filename, 0, -4); } - $sorter = new Sorter; + $sorter = new Sorter(); $sorter->sort($notes); // Link target to add a note to the current manual page, @@ -402,7 +402,7 @@ function manual_footer() { // This function takes a DateTime object and returns a formated string of the time difference relative to now function relTime(DateTime $date) { - $current = new DateTime; + $current = new DateTime(); $diff = $current->diff($date); $units = ["year" => $diff->format("%y"), "month" => $diff->format("%m"),