Skip to content

Commit

Permalink
Use <=> operator
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Mar 25, 2024
1 parent c31f11b commit dc42cb9
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/php/util/Authority.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit dc42cb9

Please sign in to comment.