Skip to content

Enhancement: Enable new_with_braces fixer #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion images/supported-versions.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function date_horiz_coord(DateTime $date) {
<!-- Today -->
<g class="today">
<?php
$now = new DateTime;
$now = new DateTime();
$x = date_horiz_coord($now);
?>
<line x1="<?php echo $x ?>" y1="<?php echo $header_height ?>" x2="<?php echo $x ?>" y2="<?php echo $header_height + (count($branches) * $branch_height) ?>" />
Expand Down
6 changes: 3 additions & 3 deletions include/branches.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions include/shared-manual.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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"),
Expand Down