chg: pkg: upgrade the doctrine related back-end pkgs to the latest available version #7
This commit is contained in:
@@ -80,8 +80,8 @@ class RpcManager implements RpcManagerInterface
|
||||
$revealedCells = $this->aggregateRevealedCells($playedGame);
|
||||
|
||||
try {
|
||||
$redPoints = $playedGame->getRedPoints() ?? 0;
|
||||
$bluePoints = $playedGame->getBluePoints() ?? 0;
|
||||
$redPoints = $playedGame->redPoints ?? 0;
|
||||
$bluePoints = $playedGame->bluePoints ?? 0;
|
||||
$gameFinished = $redPoints > 25 || $bluePoints > 25;
|
||||
|
||||
return base64_encode(json_encode([
|
||||
@@ -91,10 +91,10 @@ class RpcManager implements RpcManagerInterface
|
||||
'mostRecentStep' => $this->getMostRecentStep($playedGame),
|
||||
'redPoints' => $redPoints,
|
||||
'bluePoints' => $bluePoints,
|
||||
'redBonusPoints' => $playedGame->getRedBonusPoints() ?? 0,
|
||||
'blueBonusPoints' => $playedGame->getBlueBonusPoints() ?? 0,
|
||||
'redBonusStats' => $playedGame->getRedBonusStats() ?? [],
|
||||
'blueBonusStats' => $playedGame->getBlueBonusStats() ?? [],
|
||||
'redBonusPoints' => $playedGame->redBonusPoints ?? 0,
|
||||
'blueBonusPoints' => $playedGame->blueBonusPoints ?? 0,
|
||||
'redBonusStats' => $playedGame->redBonusStats ?? [],
|
||||
'blueBonusStats' => $playedGame->blueBonusStats ?? [],
|
||||
'gameFinished' => $gameFinished,
|
||||
], JSON_THROW_ON_ERROR));
|
||||
} catch (JsonException $e) {
|
||||
@@ -131,19 +131,19 @@ class RpcManager implements RpcManagerInterface
|
||||
try {
|
||||
foreach ($grid2d as $row) {
|
||||
$gridRow = new GridRow();
|
||||
$gridRow->setGridCol($row);
|
||||
$gridRow->setGrid($grid);
|
||||
$gridRow->gridCol = $row;
|
||||
$gridRow->grid = $grid;
|
||||
$this->em->persist($gridRow);
|
||||
}
|
||||
|
||||
$grid->setPlayedGame($playedGame);
|
||||
$grid->playedGame = $playedGame;
|
||||
$this->em->persist($grid);
|
||||
|
||||
$playedGame->setGameAssoc($gameAssoc);
|
||||
$playedGame->setUuid(Uuid::fromString($gameAssoc));
|
||||
$playedGame->setGrid($grid);
|
||||
$playedGame->setCreated(new DateTime());
|
||||
$playedGame->setUpdated(new DateTime());
|
||||
$playedGame->gameAssoc = $gameAssoc;
|
||||
$playedGame->uuid = Uuid::fromString($gameAssoc);
|
||||
$playedGame->grid = $grid;
|
||||
$playedGame->created = new DateTime();
|
||||
$playedGame->updated = new DateTime();
|
||||
$this->em->persist($playedGame);
|
||||
|
||||
$this->em->flush();
|
||||
@@ -212,12 +212,12 @@ class RpcManager implements RpcManagerInterface
|
||||
{
|
||||
$all = [];
|
||||
|
||||
foreach ($playedGame->getSteps() as $step) {
|
||||
if (null === $step->getRevealedCells()) {
|
||||
foreach ($playedGame->steps as $step) {
|
||||
if (null === $step->revealedCells) {
|
||||
continue;
|
||||
}
|
||||
$player = $step->getPlayer();
|
||||
foreach ($step->getRevealedCells() as $cell) {
|
||||
$player = $step->player;
|
||||
foreach ($step->revealedCells as $cell) {
|
||||
$all[] = array_merge($cell, ['player' => $player]);
|
||||
}
|
||||
}
|
||||
@@ -250,19 +250,19 @@ class RpcManager implements RpcManagerInterface
|
||||
}
|
||||
|
||||
return [
|
||||
'player' => $step->getPlayer(),
|
||||
'row' => (int)$step->getRow(),
|
||||
'col' => (int)$step->getCol(),
|
||||
'player' => $step->player,
|
||||
'row' => (int)$step->row,
|
||||
'col' => (int)$step->col,
|
||||
];
|
||||
}
|
||||
|
||||
private function getUserCollection(PlayedGame $playedGame): array
|
||||
{
|
||||
return [
|
||||
'red' => null !== $playedGame->getRed() ? $playedGame->getRed()->getUsername() : '',
|
||||
'blue' => null !== $playedGame->getBlue() ? $playedGame->getBlue()->getUsername() : '',
|
||||
'redAnon' => null !== $playedGame->getRedAnon() ? $playedGame->getRedAnon()->getUserName() : '',
|
||||
'blueAnon' => null !== $playedGame->getBlueAnon() ? $playedGame->getBlueAnon()->getUserName() : '',
|
||||
'red' => null !== $playedGame->red ? $playedGame->red->getUsername() : '',
|
||||
'blue' => null !== $playedGame->blue ? $playedGame->blue->getUsername() : '',
|
||||
'redAnon' => null !== $playedGame->redAnon ? $playedGame->redAnon->userName : '',
|
||||
'blueAnon' => null !== $playedGame->blueAnon ? $playedGame->blueAnon->userName : '',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user