Tournament Generator

TeamSorter implements BaseSorter

TournamentGenerator sorter for teams

Tags
author

Tomáš Vojík vojik@wboy.cz

since
0.3

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

$ids

protected static array<string|int, mixed> $ids

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
throws
InvalidArgumentException
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
$a : Team

First team

$b : Team

Second team

Return values
int

sortTeamsByScore()

Sorter function for usort by score

protected static sortTeamsByScore(Team $a, Team $b) : int
Parameters
$a : Team

First team

$b : Team

Second team

Return values
int

Search results