diff --git a/src/Player.php b/src/Player.php index 36efc25..8cf39ce 100644 --- a/src/Player.php +++ b/src/Player.php @@ -301,9 +301,9 @@ class Player * * @return int */ - public function getElo(string $type): int + public function getElo(string $type): ?int { - return $this->Elos[ $type ]; + return isset($this->Elos[ $type ]) ? $this->Elos[ $type ] : null; } /** diff --git a/src/Tournament.php b/src/Tournament.php index 9eec186..6a225da 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -14,6 +14,7 @@ namespace JeroenED\Libpairtwo; use Closure; use DateTime; use JeroenED\Libpairtwo\Enums\Color; +use JeroenED\Libpairtwo\Enums\Result; use JeroenED\Libpairtwo\Enums\Tiebreak; use JeroenED\Libpairtwo\Enums\TournamentSystem; @@ -728,7 +729,7 @@ class Tournament $tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2; } } - if (array_search($pairing->Result, Constants::NOTPLAYED) !== false) { + if ($pairing->Result == Result::WON_BYE) { $tiebreak += $player->calculatePointsForVirtualPlayer($key); } }