Merge branch 'develop'

This commit is contained in:
Jeroen De Meerleer 2023-01-09 12:51:29 +01:00
commit 2ca18a3271
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 4 additions and 3 deletions

View File

@ -301,9 +301,9 @@ class Player
* *
* @return int * @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;
} }
/** /**

View File

@ -14,6 +14,7 @@ namespace JeroenED\Libpairtwo;
use Closure; use Closure;
use DateTime; use DateTime;
use JeroenED\Libpairtwo\Enums\Color; use JeroenED\Libpairtwo\Enums\Color;
use JeroenED\Libpairtwo\Enums\Result;
use JeroenED\Libpairtwo\Enums\Tiebreak; use JeroenED\Libpairtwo\Enums\Tiebreak;
use JeroenED\Libpairtwo\Enums\TournamentSystem; use JeroenED\Libpairtwo\Enums\TournamentSystem;
@ -728,7 +729,7 @@ class Tournament
$tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2; $tiebreak += $pairing->Opponent->calculatePointsForTiebreaks() / 2;
} }
} }
if (array_search($pairing->Result, Constants::NOTPLAYED) !== false) { if ($pairing->Result == Result::WON_BYE) {
$tiebreak += $player->calculatePointsForVirtualPlayer($key); $tiebreak += $player->calculatePointsForVirtualPlayer($key);
} }
} }