@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | { |
30 | 30 | $chart = $this->em->getRepository('VideoGamesRecords\CoreBundle\Entity\Chart')->find($mixed); |
31 | 31 | if (null === $chart) { |
32 | - return ; |
|
32 | + return; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $this->groups[$chart->getGroup()->getId()] = $chart->getGroup(); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if ($previousLibValue === $libValue) { |
86 | 86 | ++$nbEqual; |
87 | 87 | } else { |
88 | - $rank += $nbEqual; |
|
88 | + $rank += $nbEqual; |
|
89 | 89 | $nbEqual = 1; |
90 | 90 | $playerChartEqual = []; |
91 | 91 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $playerChart |
110 | 110 | ->setNbEqual($nbEqual) |
111 | 111 | ->setRank($rank) |
112 | - ->setPointChart((int)( |
|
112 | + ->setPointChart((int) ( |
|
113 | 113 | array_sum( |
114 | 114 | array_slice(array_values($pointsChart), $playerChart->getRank() - 1, $playerChart->getNbEqual()) |
115 | 115 | ) / $playerChart->getNbEqual() |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | if ($playerChart->getPlatform() != null) { |
128 | 128 | $idPlatForm = $playerChart->getPlatform()->getId(); |
129 | - $playerChart->setPointPlatform((int)( |
|
129 | + $playerChart->setPointPlatform((int) ( |
|
130 | 130 | array_sum( |
131 | 131 | array_slice(array_values($platforms[$idPlatForm]['points']), $platforms[$idPlatForm]['rank'] - 1, $platforms[$idPlatForm]['nbEqual']) |
132 | 132 | ) / $platforms[$idPlatForm]['nbEqual'] |
@@ -111,7 +111,7 @@ |
||
111 | 111 | $query->setParameter('rank', $i); |
112 | 112 | $row = $query->getOneOrNullResult(); |
113 | 113 | if ($row) { |
114 | - $data["gameRank$i"] = $row['nb']; |
|
114 | + $data["gamerank$i"] = $row['nb']; |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | private function getChartsToUpdate() |
77 | 77 | { |
78 | - $query = $this->em->createQueryBuilder() |
|
78 | + $query = $this->em->createQueryBuilder() |
|
79 | 79 | ->select('ch') |
80 | 80 | ->from('VideoGamesRecords\CoreBundle\Entity\Chart', 'ch') |
81 | 81 | ->join('ch.group', 'gr') |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $chart = $this->em->getRepository('VideoGamesRecords\CoreBundle\Entity\Chart')->find($mixed); |
26 | 26 | if (null === $chart) { |
27 | - return ; |
|
27 | + return; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $this->groups[$chart->getGroup()->getId()] = $chart->getGroup(); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | $query->setParameter('rank', $i); |
72 | 72 | $result = $query->getResult(); |
73 | 73 | foreach ($result as $row) { |
74 | - $data["chartRank$i"][$row['id']] = $row['nb']; |
|
74 | + $data["chartrank$i"][$row['id']] = $row['nb']; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 |
@@ -9,7 +9,7 @@ |
||
9 | 9 | * @param array $options |
10 | 10 | * @return array |
11 | 11 | */ |
12 | - public function getRanking(int $id = null, array $options = []): array |
|
12 | + public function getRanking(int $id = null, array $options = []): array |
|
13 | 13 | { |
14 | 14 | $country = $this->em->getRepository('VideoGamesRecords\CoreBundle\Entity\Country')->find($id); |
15 | 15 | if (null === $country) { |
@@ -76,7 +76,7 @@ |
||
76 | 76 | { |
77 | 77 | $maxRank = $options['maxRank'] ?? null; |
78 | 78 | $player = $this->getPlayer(); |
79 | - $team = !empty($options['idTeam'])? $this->em->getReference('VideoGamesRecords\CoreBundle\Entity\Team', $options['idTeam']) : null; |
|
79 | + $team = !empty($options['idTeam']) ? $this->em->getReference('VideoGamesRecords\CoreBundle\Entity\Team', $options['idTeam']) : null; |
|
80 | 80 | |
81 | 81 | $query = $this->em->createQueryBuilder() |
82 | 82 | ->select('p') |
@@ -40,9 +40,9 @@ |
||
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | - /** |
|
44 | - * @throws ORMException |
|
45 | - */ |
|
43 | + /** |
|
44 | + * @throws ORMException |
|
45 | + */ |
|
46 | 46 | protected function getTeam(): ?Team |
47 | 47 | { |
48 | 48 | return $this->tokenStorageToTeamTransformer->transform($this->tokenStorage->getToken()); |
@@ -23,8 +23,7 @@ |
||
23 | 23 | TokenStorageToPlayerTransformer $tokenStorageToPlayerTransformer, |
24 | 24 | TokenStorageToTeamTransformer $tokenStorageToTeamTransformer, |
25 | 25 | TokenStorageInterface $tokenStorage |
26 | - ) |
|
27 | - { |
|
26 | + ) { |
|
28 | 27 | $this->em = $em; |
29 | 28 | $this->tokenStorageToPlayerTransformer = $tokenStorageToPlayerTransformer; |
30 | 29 | $this->tokenStorageToTeamTransformer = $tokenStorageToTeamTransformer; |
@@ -179,7 +179,7 @@ |
||
179 | 179 | |
180 | 180 | try { |
181 | 181 | return $query->getQuery()->getSingleScalarResult(); |
182 | - } catch (NoResultException|NonUniqueResultException $e) { |
|
182 | + } catch (NoResultException | NonUniqueResultException $e) { |
|
183 | 183 | return null; |
184 | 184 | } |
185 | 185 | } |