From 9bf4cdaec34b5470e275f29ba4338264eb5c0db4 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Sun, 22 Dec 2019 18:15:25 +0100 Subject: [PATCH] Several fixes --- dist/template.php | 2 +- src/Player.php | 4 ++-- src/Round.php | 9 +++------ src/Tournament.php | 9 +++------ 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dist/template.php b/dist/template.php index 4ae1cb2..9cd3e19 100644 --- a/dist/template.php +++ b/dist/template.php @@ -2,7 +2,7 @@ // EDIT ME! $pairingfile = 'your pairing-file.swar'; -$fileformat = 'Swar-4'; // Possible getValue()s: Pairtwo-5, Pairtwo-6, Swar-4 +$fileformat = 'Swar-4'; // Possible values: Pairtwo-5, Pairtwo-6, Swar-4 ?> diff --git a/src/Player.php b/src/Player.php index 2f5a514..bab5452 100644 --- a/src/Player.php +++ b/src/Player.php @@ -224,7 +224,7 @@ class Player { $points = 0; foreach ($this->Pairings as $key=>$pairing) { - if($key < $round || $round == -1) { + if ($key < $round || $round == -1) { if (array_search($pairing->Result, Constants::Won) !== false) { $points = $points + 1; } elseif (array_search($pairing->Result, Constants::Draw) !== false) { @@ -330,7 +330,7 @@ class Player */ public function __get(string $key) { - if($key == 'PlayedGames') { + if ($key == 'PlayedGames') { return $this->playedGames(); } elseif ($key == 'NoOfWins') { return $this->noOfWins(); diff --git a/src/Round.php b/src/Round.php index 949872d..910218e 100644 --- a/src/Round.php +++ b/src/Round.php @@ -150,14 +150,11 @@ class Round { if ($key == 'Bye') { return $this->bye(); - } - elseif ($key == 'Absent') { + } elseif ($key == 'Absent') { return $this->absent(); - } - elseif ($key == 'GamesByBoard') { + } elseif ($key == 'GamesByBoard') { return $this->gamesByBoard(); - } - elseif (isset($this->BinaryData[$key])) { + } elseif (isset($this->BinaryData[$key])) { return $this->BinaryData[$key]; } return null; diff --git a/src/Tournament.php b/src/Tournament.php index c5c8a92..ebacb50 100644 --- a/src/Tournament.php +++ b/src/Tournament.php @@ -928,14 +928,11 @@ class Tournament { if ($key == 'Participants') { return $this->participants(); - } - elseif ($key == 'AverageElo') { + } elseif ($key == 'AverageElo') { return $this->averageElo(); - } - elseif ($key == 'Ranking') { + } elseif ($key == 'Ranking') { return $this->ranking(); - } - elseif (isset($this->BinaryData[$key])) { + } elseif (isset($this->BinaryData[$key])) { return $this->BinaryData[$key]; } return null;