From 9e4e2073c87ca64811d351e1c4ef538902d61427 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sat, 1 Jun 2019 14:27:50 +0200 Subject: [PATCH] fixed buchholz cut --- src/Readers/Pairtwo6.php | 2 +- src/Tiebreaks.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Readers/Pairtwo6.php b/src/Readers/Pairtwo6.php index 1a7ea16..dbe6da8 100644 --- a/src/Readers/Pairtwo6.php +++ b/src/Readers/Pairtwo6.php @@ -231,7 +231,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface $tiebreak = Tiebreak::BuchholzMed; break; case 3: - $tiebreak = Tiebreak::BuchholzMed; + $tiebreak = Tiebreak::BuchholzCut; break; case 4: $tiebreak = Tiebreak::Sonneborn; diff --git a/src/Tiebreaks.php b/src/Tiebreaks.php index 15e8a7c..cf76e78 100644 --- a/src/Tiebreaks.php +++ b/src/Tiebreaks.php @@ -205,14 +205,14 @@ abstract class Tiebreaks extends Tournament return 1; } - if ($b->getOpponent()->getElo('Nation') == $a->getOpponent()->getElo('Nation')) { + if ($b->getOpponent()->getPoints() == $a->getOpponent()->getPoints()) { return 0; } - return ($b->getOpponent()->getElo('Nation') > $a->getOpponent()->getElo('Nation')) ? 1 : -1; + return ($a->getOpponent()->getPoints() > $b->getOpponent()->getPoints()) ? 1 : -1; }); - array_slice($intpairings, $cutlowest); - array_slice($intpairings, 0 - $cuthighest); + $intpairings = array_slice($intpairings, $cutlowest); + $intpairings = array_slice($intpairings, 0 - $cuthighest); foreach ($intpairings as $intkey => $intpairing) { if (!is_null($intpairing->getOpponent())) {