/// Helper class to sort ranks in non-decreasing order.
/// 
class RankSorter
{
    /// 
    /// Performs an in-place sort of the  in according to the  in non-decreasing order.
    /// 
    /// The types of items to sort.
    /// The items to sort according to the order specified by .
    /// The ranks for each item where 1 is first place.
    public static function sort(array &$teams, array &$teamRanks)
    {        
        array_multisort($teamRanks, $teams);
        return $teams;
    }
}
?>