| @@ -16,7 +16,7 @@ | ||
| 16 | 16 | } | 
| 17 | 17 | |
| 18 | 18 | $env = $_SERVER['APP_ENV'] ?? 'dev'; | 
| 19 | -$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)); | |
| 19 | +$debug = (bool)($_SERVER['APP_DEBUG'] ?? ('prod' !== $env)); | |
| 20 | 20 | |
| 21 | 21 |  if ($debug) { | 
| 22 | 22 | umask(0000); | 
| @@ -75,7 +75,7 @@ | ||
| 75 | 75 |      { | 
| 76 | 76 | $result = []; | 
| 77 | 77 | $teams = $this->getDoctrine()->getRepository(Team::class) | 
| 78 | - ->findAll(); | |
| 78 | + ->findAll(); | |
| 79 | 79 | |
| 80 | 80 |          foreach ($teams as $team) { | 
| 81 | 81 | $result[$team->getName()] = $team->getId(); | 
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | $forms[1] = $this->createForm(UserExtraBettingType::class, $bet, | 
| 33 | 33 | ['teams' => $teams, 'extrabet' => $bets[1] ?? null, 'label' => 'Tipp 1 (+10 Punkte)', 'type' => 1] | 
| 34 | 34 | )->createView(); | 
| 35 | - $forms[2] = $this->createForm(UserExtraBettingType::class, $bet, | |
| 35 | + $forms[2] = $this->createForm(UserExtraBettingType::class, $bet, | |
| 36 | 36 | ['teams' => $teams, 'extrabet' => $bets[2] ?? null, 'label' => 'Tipp 2 (+5 Punkte)', 'type' => 2] | 
| 37 | 37 | )->createView(); | 
| 38 | 38 | |
| @@ -24,7 +24,7 @@ | ||
| 24 | 24 |      { | 
| 25 | 25 |          $qb = $this->createQueryBuilder('game'); | 
| 26 | 26 |          $qb->where('game.date > :date') | 
| 27 | -           ->setParameter('date', new \DateTime()) | |
| 27 | +            ->setParameter('date', new \DateTime()) | |
| 28 | 28 |              ->orderBy('game.date', 'ASC'); | 
| 29 | 29 | |
| 30 | 30 | return $qb->getQuery()->getResult(); | 
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | public function findUserBettingByUserId(User $user, array $games) | 
| 24 | 24 |      { | 
| 25 | 25 | $gameIds = array_map( | 
| 26 | -            function ($game) { | |
| 26 | +            function($game) { | |
| 27 | 27 | return $game->getId(); | 
| 28 | 28 | }, | 
| 29 | 29 | $games | 
| @@ -113,7 +113,6 @@ discard block | ||
| 113 | 113 | |
| 114 | 114 | /** | 
| 115 | 115 | * Gets triggered only on insert | 
| 116 | - | |
| 117 | 116 | * @ORM\PrePersist | 
| 118 | 117 | */ | 
| 119 | 118 | public function onPrePersist() | 
| @@ -123,7 +122,6 @@ discard block | ||
| 123 | 122 | |
| 124 | 123 | /** | 
| 125 | 124 | * Gets triggered every time on update | 
| 126 | - | |
| 127 | 125 | * @ORM\PreUpdate | 
| 128 | 126 | */ | 
| 129 | 127 | public function onPreUpdate() | 
| @@ -75,12 +75,12 @@ | ||
| 75 | 75 | $entityManager = $this->getDoctrine()->getManager(); | 
| 76 | 76 | |
| 77 | 77 | $userBetting = $entityManager->getRepository(UserBettingEntity::class) | 
| 78 | - ->findByGameIdAndUserId($params['gameId'], $this->getUser()->getId()) | |
| 78 | + ->findByGameIdAndUserId($params['gameId'], $this->getUser()->getId()) | |
| 79 | 79 | ; | 
| 80 | 80 |          if (!$userBetting instanceof UserBettingEntity) { | 
| 81 | 81 | $userBetting = new UserBettingEntity(); | 
| 82 | 82 | $game = $entityManager->getRepository(Game::class) | 
| 83 | - ->find($params['gameId']); | |
| 83 | + ->find($params['gameId']); | |
| 84 | 84 | $userBetting->setGame($game); | 
| 85 | 85 | $userBetting->setUser($this->getUser()); | 
| 86 | 86 | } | 
| @@ -98,7 +98,7 @@ discard block | ||
| 98 | 98 | ->findOneBy(['id' => $userId]); | 
| 99 | 99 | $pastGamesForm = []; | 
| 100 | 100 | $username = ''; | 
| 101 | -        if($user instanceof User) { | |
| 101 | +        if ($user instanceof User) { | |
| 102 | 102 | $pastGamesForm = $this->userPastGames->get($user); | 
| 103 | 103 | $username = $user->getUsername(); | 
| 104 | 104 | } | 
| @@ -115,7 +115,7 @@ discard block | ||
| 115 | 115 | |
| 116 | 116 | public function getNextGames(int $numberOfGames) | 
| 117 | 117 |      { | 
| 118 | - $gameBetResult = \array_slice($this->userFutureGames->get($this->getUser()),0,$numberOfGames); | |
| 118 | + $gameBetResult = \array_slice($this->userFutureGames->get($this->getUser()), 0, $numberOfGames); | |
| 119 | 119 | |
| 120 | 120 | return $this->render( | 
| 121 | 121 | 'dashboard/next_games.html.twig', | 
| @@ -138,10 +138,10 @@ discard block | ||
| 138 | 138 |          if (!$form->isSubmitted() && !$form->isValid()) { | 
| 139 | 139 | return $this->json(['status' => false]); | 
| 140 | 140 | } | 
| 141 | -        if(!isset($params['firstTeamResult'])  || $params['firstTeamResult'] < 0) { | |
| 141 | +        if (!isset($params['firstTeamResult']) || $params['firstTeamResult'] < 0) { | |
| 142 | 142 | return $this->json(['status' => $params]); | 
| 143 | 143 | } | 
| 144 | -        if(!isset($params['secondTeamResult'])  || $params['secondTeamResult'] < 0) { | |
| 144 | +        if (!isset($params['secondTeamResult']) || $params['secondTeamResult'] < 0) { | |
| 145 | 145 | return $this->json(['status' => false]); | 
| 146 | 146 | } | 
| 147 | 147 | |
| @@ -162,7 +162,7 @@ discard block | ||
| 162 | 162 | $userBetting->setFirstTeamResult((int)$params['firstTeamResult']); | 
| 163 | 163 | $userBetting->setSecondTeamResult((int)$params['secondTeamResult']); | 
| 164 | 164 | |
| 165 | -        if($userBetting->getGame()->getDate()->getTimestamp() < time() ) { | |
| 165 | +        if ($userBetting->getGame()->getDate()->getTimestamp() < time()) { | |
| 166 | 166 | return $this->json(['status' => false]); | 
| 167 | 167 | } | 
| 168 | 168 | |
| @@ -16,7 +16,7 @@ | ||
| 16 | 16 | */ | 
| 17 | 17 | public function sortUserByScore(array $usersScores): array | 
| 18 | 18 |      { | 
| 19 | -        usort($usersScores, function ($a, $b) { | |
| 19 | +        usort($usersScores, function($a, $b) { | |
| 20 | 20 | return ($a->getScoreSumme() <=> $b->getScoreSumme()) * -1; | 
| 21 | 21 | }); | 
| 22 | 22 | |
| @@ -94,7 +94,7 @@ | ||
| 94 | 94 | Config::NO_WIN_TEAM => true, | 
| 95 | 95 | ]; | 
| 96 | 96 |          if (!isset($allowedPoints[$point])) { | 
| 97 | -            throw new \RuntimeException('Point: ' . $point . ' is not allowed'); | |
| 97 | +            throw new \RuntimeException('Point: '.$point.' is not allowed'); | |
| 98 | 98 | } | 
| 99 | 99 | } | 
| 100 | 100 | } | 
| 101 | 101 | \ No newline at end of file | 
| @@ -30,7 +30,7 @@ discard block | ||
| 30 | 30 |      { | 
| 31 | 31 | $this->checkCollection(); | 
| 32 | 32 | |
| 33 | -        usort($this->collections, function ($a, $b) { | |
| 33 | +        usort($this->collections, function($a, $b) { | |
| 34 | 34 | return $a->getScore() <=> $b->getScore(); | 
| 35 | 35 | }); | 
| 36 | 36 | $this->collections = array_reverse($this->collections); | 
| @@ -50,7 +50,7 @@ discard block | ||
| 50 | 50 |      { | 
| 51 | 51 |          foreach ($this->collections as $collection) { | 
| 52 | 52 |              if (!$collection instanceof ScoreInterface) { | 
| 53 | -                throw new \RuntimeException('Collection: ' . get_class($collection) . 'is not instanceof ' . ScoreInterface::class); | |
| 53 | +                throw new \RuntimeException('Collection: '.get_class($collection).'is not instanceof '.ScoreInterface::class); | |
| 54 | 54 | } | 
| 55 | 55 | } | 
| 56 | 56 | } |