Updated some more phpdoc

This commit is contained in:
Jeroen De Meerleer 2019-02-11 17:54:50 +01:00
parent 8c6e3b81fa
commit 99ccb56aeb
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 20 additions and 16 deletions

View File

@ -8,13 +8,15 @@
namespace JeroenED\Libpairtwo\Models; namespace JeroenED\Libpairtwo\Models;
use DateTime;
class Round class Round
{ {
private $date; private $date;
private $games; private $games;
/** /**
* @return \DateTime * @return DateTime
* *
*/ */
public function getDate() public function getDate()
@ -23,7 +25,7 @@ class Round
} }
/** /**
* @param \DateTime $date * @param DateTime $date
*/ */
public function setDate($date): void public function setDate($date): void
{ {

View File

@ -27,6 +27,7 @@
namespace JeroenED\Libpairtwo\Models; namespace JeroenED\Libpairtwo\Models;
use JeroenED\Libpairtwo\Enums\TournamentSystem; use JeroenED\Libpairtwo\Enums\TournamentSystem;
use JeroenED\LibPairtwo\Player;
use DateTime; use DateTime;
/** /**

View File

@ -9,15 +9,15 @@
namespace JeroenED\Libpairtwo; namespace JeroenED\Libpairtwo;
use JeroenED\Libpairtwo\Models\Tournament as TournamentModel; use JeroenED\Libpairtwo\Models\Tournament as TournamentModel;
use phpDocumentor\Reflection\Types\Boolean; use JeroenED\LibPairtwo\Player;
class Tournament extends TournamentModel class Tournament extends TournamentModel
{ {
/** /**
* @param Integer $id * @param integer $id
* @return Player * @return Player
*/ */
public function getPlayerById($id) public function getPlayerById(int $id)
{ {
return $this->GetPlayers()[$id]; return $this->GetPlayers()[$id];
} }
@ -33,10 +33,10 @@ class Tournament extends TournamentModel
} }
/** /**
* @param $id * @param int $id
* @param Player $player * @param Player $player
*/ */
public function updatePlayer($id, Player $player) public function updatePlayer(int $id, Player $player)
{ {
$newArray = $this->GetPlayers(); $newArray = $this->GetPlayers();
$newArray[$id] = $player; $newArray[$id] = $player;
@ -64,7 +64,8 @@ class Tournament extends TournamentModel
} }
/** /**
* @return array * @param bool $americansort
* @return Player[]
*/ */
public function getRanking(bool $americansort = false) public function getRanking(bool $americansort = false)
{ {
@ -76,21 +77,21 @@ class Tournament extends TournamentModel
} }
/** /**
* @param $a * @param Player $a
* @param $b * @param Player $b
* @return mixed * @return int
*/ */
private function sortNormal($a, $b) private function sortNormal(Player $a, Player $b)
{ {
return $b->getPoints() - $a->getPoints(); return $b->getPoints() - $a->getPoints();
} }
/** /**
* @param $a * @param Player $a
* @param $b * @param Player $b
* @return mixed * @return int
*/ */
private function sortAmerican($a, $b) private function sortAmerican(Player $a, Player $b)
{ {
return $b->getScoreAmerican() - $a->getScoreAmerican(); return $b->getScoreAmerican() - $a->getScoreAmerican();
} }