From dc42cb94801e5a3554772af3ffafa4f7ff460464 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Mon, 25 Mar 2024 10:30:57 +0100 Subject: [PATCH] Use `<=>` operator --- src/main/php/util/Authority.class.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/php/util/Authority.class.php b/src/main/php/util/Authority.class.php index 74ca356..6ee6427 100755 --- a/src/main/php/util/Authority.class.php +++ b/src/main/php/util/Authority.class.php @@ -116,12 +116,6 @@ public function hashCode() { * @return int */ public function compareTo($value) { - if ($value instanceof self) { - $a= $this->asString(true); - $b= $value->asString(true); - return $a === $b ? 0 : ($a < $b ? -1 : 1); - } else { - return 1; - } + return $value instanceof self ? $this->asString(true) <=> $value->asString(true) : 1; } } \ No newline at end of file