diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-11-08 17:43:21 +0100 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-11-08 17:47:21 +0100 |
commit | 32b8f4ae4243bc915fe38e28dd991a28c09b4331 (patch) | |
tree | 91e670ed3609ba381dc2e8e26e66947d21f4f02f /ratatoeskr/backend.php | |
parent | 7b0ed66d6b972bfc88d7b9a1a0e1369f01084189 (diff) | |
download | ratatoeskr-cms-32b8f4ae4243bc915fe38e28dd991a28c09b4331.tar.gz ratatoeskr-cms-32b8f4ae4243bc915fe38e28dd991a28c09b4331.tar.bz2 ratatoeskr-cms-32b8f4ae4243bc915fe38e28dd991a28c09b4331.zip |
Remove intcmp()
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r-- | ratatoeskr/backend.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php index 23568a1..36e2fb3 100644 --- a/ratatoeskr/backend.php +++ b/ratatoeskr/backend.php @@ -602,7 +602,7 @@ function build_backend_subactions() $ste->vars["sort_asc_date"] = true; $ste->vars["sorting"] = ["dir" => "asc", "by" => "date"]; usort($articles, function ($a, $b) { - return intcmp($a->timestamp, $b->timestamp); + return $a->timestamp <=> $b->timestamp; }); break; case "section": @@ -631,7 +631,7 @@ function build_backend_subactions() $ste->vars["sort_desc_date"] = true; $ste->vars["sorting"] = ["dir" => "desc", "by" => "date"]; usort($articles, function ($a, $b) { - return intcmp($b->timestamp, $a->timestamp); + return $b->timestamp <=> $a->timestamp; }); break; case "section": @@ -914,13 +914,13 @@ function build_backend_subactions() break; case "date": usort($comments, function ($a, $b) use ($sort_dir) { - return intcmp($a->get_timestamp(), $b->get_timestamp()) * $sort_dir; + return ($a->get_timestamp() <=> $b->get_timestamp()) * $sort_dir; }); break; case "was_read": default: usort($comments, function ($a, $b) use ($sort_dir) { - return intcmp((int) $a->read_by_admin, (int) $b->read_by_admin) * $sort_dir; + return ((int)$a->read_by_admin <=> (int)$b->read_by_admin) * $sort_dir; }); $sort_by = "was_read"; break; |