Merge branch 'bugfix/getParticipants' into develop

This commit is contained in:
Jeroen De Meerleer 2019-06-18 16:02:09 +02:00
commit 3fcdb97c63
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 28CCCB8F62BFADD6
4 changed files with 11 additions and 22 deletions

View File

@ -5,6 +5,7 @@
* NEW FEATURE: Soccer Kashdan (aka: kashdan using 3-1-0 scoring) * NEW FEATURE: Soccer Kashdan (aka: kashdan using 3-1-0 scoring)
* CHANGE: Deprecated `sws::class` was removed * CHANGE: Deprecated `sws::class` was removed
* CHANGE: Added a logo to the project * CHANGE: Added a logo to the project
* BUGFIX: `Tournament::getParticipants()` did not return a correct value
## v1.0.2 (Released: 05-jun-2019) ## v1.0.2 (Released: 05-jun-2019)
* NEW FEATURE: `Player::getPlayedGames()` to return the number of played games * NEW FEATURE: `Player::getPlayedGames()` to return the number of played games

View File

@ -74,9 +74,6 @@ abstract class Tournament
/** @var Round[] */ /** @var Round[] */
private $Rounds = []; private $Rounds = [];
/** @var int */
private $Participants;
/** @var string */ /** @var string */
private $Tempo; private $Tempo;
@ -329,24 +326,6 @@ abstract class Tournament
return $this; return $this;
} }
/**
* @return int
*/
public function getParticipants(): int
{
return $this->Participants;
}
/**
* @param int $Participants
* @return Tournament
*/
public function setParticipants(int $Participants): Tournament
{
$this->Participants = $Participants;
return $this;
}
/** /**
* @return string * @return string
*/ */

View File

@ -507,7 +507,7 @@ class Pairtwo6 extends Pairtwo6Model implements ReaderInterface
// Participants // Participants
$length = 4; $length = 4;
$this->getTournament()->setParticipants($this->readData('Int', substr($swscontents, $offset, $length))); $this->getTournament()->setBinaryData('Participants', $this->readData('Int', substr($swscontents, $offset, $length)));
$offset += $length; $offset += $length;
// Fidehomol // Fidehomol

View File

@ -351,4 +351,13 @@ class Tournament extends Tiebreaks
} }
return intdiv($totalrating, $players); return intdiv($totalrating, $players);
} }
/**
* Returns the number of participants
*
* @return int
*/
public function getParticipants(): int {
return count($this->getPlayers());
}
} }