diff --git a/public/static/js/game.js b/public/static/js/game.js index d5e8f09..c548434 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -340,7 +340,7 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 }); Game.guess(); }); } - + }, displayRestrictions: function () { @@ -399,7 +399,7 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 }); Game.timeoutEnd = null; }, - hideRestrictions: function() { + hideRestrictions: function () { var restrictions = document.getElementById('restrictions'); if (restrictions) { var header = restrictions.parentNode; @@ -957,7 +957,7 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 }); }, - showHighscores: function() { + showHighscores: function () { if (Game.type == GameType.CHALLENGE) { var highscores = this.calculateHighScores(); diff --git a/src/Controller/GameController.php b/src/Controller/GameController.php index 5248137..56aa673 100644 --- a/src/Controller/GameController.php +++ b/src/Controller/GameController.php @@ -208,7 +208,7 @@ class GameController implements ISecured $room = $this->multiRoomRepository->getByRoomId($roomId); - if(!isset($room)) { + if (!isset($room)) { return new JsonContent(['error' => 'game_not_found']); } @@ -265,7 +265,7 @@ class GameController implements ISecured return new JsonContent(['error' => 'game_not_found']); } - if(!$this->userInChallengeRepository->isUserParticipatingInChallenge($userId, $challenge)) { + if (!$this->userInChallengeRepository->isUserParticipatingInChallenge($userId, $challenge)) { // new player is joining $userInChallenge = new UserInChallenge(); $userInChallenge->setUserId($userId); diff --git a/src/Controller/GameFlowController.php b/src/Controller/GameFlowController.php index 220c704..fdbf379 100644 --- a/src/Controller/GameFlowController.php +++ b/src/Controller/GameFlowController.php @@ -309,9 +309,9 @@ class GameFlowController implements ISecured $session = $this->request->session(); $userId = $session->get('userId'); - if(isset($userId)) { + if (isset($userId)) { $userPlayedPlace = $this->userPlayedPlaceRepository->getByUserIdAndPlaceId($userId, $placeId); - if(!$userPlayedPlace) { + if (!$userPlayedPlace) { $userPlayedPlace = new UserPlayedPlace(); $userPlayedPlace->setUserId($userId); $userPlayedPlace->setPlaceId($placeId); @@ -415,7 +415,7 @@ class GameFlowController implements ISecured $response['restrictions']['timeLimit'] = $timeLimit * 1000; } - if(isset($response['history'][$currentRound]['allResults'])) { + if (isset($response['history'][$currentRound]['allResults'])) { $response['allResults'] = $response['history'][$currentRound]['allResults']; } diff --git a/src/Database/Query/Select.php b/src/Database/Query/Select.php index d62bd84..f9c2879 100644 --- a/src/Database/Query/Select.php +++ b/src/Database/Query/Select.php @@ -261,7 +261,7 @@ class Select $queryString .= ' LIMIT ' . $this->limit[1] . ', ' . $this->limit[0]; } - if($this->isDerivedTable()) { + if ($this->isDerivedTable()) { $queryString = '(' . $queryString . ') AS ' . $this->tableAliases[Select::DERIVED_TABLE_KEY]; } @@ -276,7 +276,7 @@ class Select return [(string) $table, $params]; } - if($table instanceof Select) + if ($table instanceof Select) { return $table->generateQuery(); } @@ -332,7 +332,7 @@ class Select $joinQueries = []; $params = []; - foreach($this->joins as $join) { + foreach ($this->joins as $join) { list($joinQueryFragment, $paramsFragment) = $this->generateTable($join[1], true); $joinQueries[] = $join[0] . ' JOIN ' . $joinQueryFragment . ' ON ' . $this->generateColumn($join[2]) . ' ' . $join[3] . ' ' . $this->generateColumn($join[4]); $params = array_merge($params, $paramsFragment); diff --git a/src/PersistentData/Model/Challenge.php b/src/PersistentData/Model/Challenge.php index 6b159f0..4e61cc9 100644 --- a/src/PersistentData/Model/Challenge.php +++ b/src/PersistentData/Model/Challenge.php @@ -33,7 +33,7 @@ class Challenge extends Model public function setTimeLimit(?int $timeLimit): void { - if(isset($timeLimit)) { + if (isset($timeLimit)) { $this->timeLimit = $timeLimit; } } diff --git a/src/PersistentData/Model/UserInChallenge.php b/src/PersistentData/Model/UserInChallenge.php index 1b636e9..0b74c9c 100644 --- a/src/PersistentData/Model/UserInChallenge.php +++ b/src/PersistentData/Model/UserInChallenge.php @@ -49,7 +49,7 @@ class UserInChallenge extends Model public function setTimeLeft(?int $timeLeft): void { - if(isset($timeLeft)) { + if (isset($timeLeft)) { $this->timeLeft = max(0, $timeLeft); } }