Teams
in package
TournamentGenerator sorter for teams
Tags
Table of Contents
- $ids : array<string|int, mixed>
- sortGroup() : array<string|int, Team>
- Sort teams in group by defined ordering type
- sortRound() : array<string|int, Team>
- Sort teams in round by defined ordering type
- sortTeamsByPoints() : int
- Sorter function for usort by points
- sortTeamsByScore() : int
- Sorter function for usort by score
Properties
$ids
protected
static array<string|int, mixed>
$ids
= []
Methods
sortGroup()
Sort teams in group by defined ordering type
public
static sortGroup(array<string|int, Team> &$teams, Group $group[, string $ordering = Constants::POINTS ]) : array<string|int, Team>
Parameters
- $teams : array<string|int, Team>
-
Array of teams to be sorted
- $group : Group
-
Group to get the results from
- $ordering : string = Constants::POINTS
-
What to order by (\TournamentGenerator\Constants::POINTS / \TournamentGenerator\Constants::SCORE)
Tags
Return values
array<string|int, Team> —Sorted array of teams
sortRound()
Sort teams in round by defined ordering type
public
static sortRound(array<string|int, Team> &$teams, Round $round[, string $ordering = Constants::POINTS ]) : array<string|int, Team>
Parameters
- $teams : array<string|int, Team>
-
Array of teams to be sorted
- $round : Round
-
Round to get the results from
- $ordering : string = Constants::POINTS
-
What to order by (\TournamentGenerator\Constants::POINTS / \TournamentGenerator\Constants::SCORE)
Tags
Return values
array<string|int, Team> —Sorted array of teams
sortTeamsByPoints()
Sorter function for usort by points
private
static sortTeamsByPoints(Team $a, Team $b) : int
Parameters
Return values
int —sortTeamsByScore()
Sorter function for usort by score
private
static sortTeamsByScore(Team $a, Team $b) : int