TeamSorter
in package
implements
BaseSorter
TournamentGenerator sorter for teams
Tags
Interfaces, Classes and Traits
- BaseSorter
- Class BaseSorter
Table of Contents
- $container : BaseContainer
- $ids : array<string|int, mixed>
- $ordering : string
- __construct() : mixed
- TeamSorter constructor.
- sort() : array<string|int, mixed>
- Sort function to call
- sortTeamsByPoints() : int
- Sorter function for usort by points
- sortTeamsByScore() : int
- Sorter function for usort by score
Properties
$container
protected
BaseContainer
$container
$ids
protected
static array<string|int, mixed>
$ids
$ordering
protected
string
$ordering
Methods
__construct()
TeamSorter constructor.
public
__construct(BaseContainer $container[, string $ordering = Constants::POINTS ]) : mixed
Parameters
- $container : BaseContainer
- $ordering : string = Constants::POINTS
-
What to order by (\TournamentGenerator\Constants::POINTS / \TournamentGenerator\Constants::SCORE)
Tags
Return values
mixed —sort()
Sort function to call
public
sort(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —sortTeamsByPoints()
Sorter function for usort by points
protected
static sortTeamsByPoints(Team $a, Team $b) : int
Parameters
Return values
int —sortTeamsByScore()
Sorter function for usort by score
protected
static sortTeamsByScore(Team $a, Team $b) : int