Since php7.0 you can replace this boilerplate
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
with the spaceship operator:
https://www.php.net/manual/en/migration70.new-features.php#migration70.new-features.spaceship-op
return $a <=> $b;