$teams The items to sort according to the order specified by ranks. * @param array $teamRanks The ranks for each item where 1 is first place. * @return array */ public static function sort(array &$teams, array &$teamRanks): array { array_multisort($teamRanks, $teams); return $teams; } }