Moved UnitTests to tests/ and Skills to src/

This commit is contained in:
Alexander Liljengård
2016-05-24 13:53:56 +02:00
parent 11b5033c8a
commit 4ab0c5d719
64 changed files with 0 additions and 0 deletions

23
src/RankSorter.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace Moserware\Skills;
/**
* Helper class to sort ranks in non-decreasing order.
*/
class RankSorter
{
/**
* Performs an in-place sort of the items in according to the ranks in non-decreasing order.
*
* @param $items The items to sort according to the order specified by ranks.
* @param $ranks The ranks for each item where 1 is first place.
*/
public static function sort(array &$teams, array &$teamRanks)
{
array_multisort($teamRanks, $teams);
return $teams;
}
}
?>