@@ -48,7 +48,7 @@ |
||
| 48 | 48 | 'suffixe' => $input['suffixe'], |
| 49 | 49 | ] |
| 50 | 50 | ] |
| 51 | - );//---- missing ID |
|
| 51 | + ); //---- missing ID |
|
| 52 | 52 | $i++; |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $newValue = Score::formToBdd($lib->getType()->getMask(), $values); |
| 85 | - if ($oldValue === null || ((int)$oldValue !== (int)$newValue) && ($newValue !== '')) { |
|
| 85 | + if ($oldValue === null || ((int) $oldValue !== (int) $newValue) && ($newValue !== '')) { |
|
| 86 | 86 | $isModify = true; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -38,8 +38,8 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function listAction(Request $request, $letter) |
| 40 | 40 | { |
| 41 | - $page = (int)$request->get('offset', 1); |
|
| 42 | - $limit = (int)$request->get('limit', 10); |
|
| 41 | + $page = (int) $request->get('offset', 1); |
|
| 42 | + $limit = (int) $request->get('limit', 10); |
|
| 43 | 43 | |
| 44 | 44 | $gameQuery = $this->getDoctrine()->getRepository('VideoGamesRecordsCoreBundle:Game') |
| 45 | 45 | ->findWithLetter($letter, $request->getLocale()); |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | $query->setParameter('rank', $i); |
| 120 | 120 | $result = $query->getResult(); |
| 121 | 121 | foreach ($result as $row) { |
| 122 | - $data["chartRank$i"][$row['idPlayer']] = $row['nb']; |
|
| 122 | + $data["chartrank$i"][$row['idPlayer']] = $row['nb']; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
@@ -169,7 +169,7 @@ |
||
| 169 | 169 | $query->setParameter('rank', $i); |
| 170 | 170 | $result = $query->getResult(); |
| 171 | 171 | foreach ($result as $row) { |
| 172 | - $data["gameRank$i"][$row['idPlayer']] = (int) $row['nb']; |
|
| 172 | + $data["gamerank$i"][$row['idPlayer']] = (int) $row['nb']; |
|
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | if ($previousLibValue === $libValue) { |
| 73 | 73 | ++$nbEqual; |
| 74 | 74 | } else { |
| 75 | - $rank += $nbEqual; |
|
| 75 | + $rank += $nbEqual; |
|
| 76 | 76 | $nbEqual = 1; |
| 77 | 77 | $playerChartEqual = []; |
| 78 | 78 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $playerChart |
| 83 | 83 | ->setNbEqual($nbEqual) |
| 84 | 84 | ->setRank($rank) |
| 85 | - ->setPointChart((int)( |
|
| 85 | + ->setPointChart((int) ( |
|
| 86 | 86 | array_sum( |
| 87 | 87 | array_slice(array_values($pointsChart), $playerChart->getRank() - 1, $playerChart->getNbEqual()) |
| 88 | 88 | ) / $playerChart->getNbEqual() |
@@ -137,20 +137,20 @@ discard block |
||
| 137 | 137 | { |
| 138 | 138 | $liste = []; |
| 139 | 139 | $pointRecord = 100 * $iNbPartcipant; |
| 140 | - $nb = 80;// % différence entre deux positions |
|
| 141 | - $compteur = 0;// compteur de position |
|
| 140 | + $nb = 80; // % différence entre deux positions |
|
| 141 | + $compteur = 0; // compteur de position |
|
| 142 | 142 | |
| 143 | 143 | // 1er |
| 144 | 144 | $liste[1] = $pointRecord; |
| 145 | 145 | |
| 146 | 146 | for ($i = 2; $i <= $iNbPartcipant; $i++) { |
| 147 | - $pointRecord = (int)($pointRecord * $nb / 100); |
|
| 147 | + $pointRecord = (int) ($pointRecord * $nb / 100); |
|
| 148 | 148 | $liste[$i] = $pointRecord; |
| 149 | 149 | $compteur++; |
| 150 | 150 | |
| 151 | 151 | if ($nb < 85) { |
| 152 | 152 | if ($compteur === 2) { |
| 153 | - $nb++;// le % augmente donc la différence diminue |
|
| 153 | + $nb++; // le % augmente donc la différence diminue |
|
| 154 | 154 | $compteur = 0; |
| 155 | 155 | } |
| 156 | 156 | } elseif ($nb < 99) { |
@@ -212,12 +212,12 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | //If firsts |
| 214 | 214 | if ($aArray[$i][$nameRankCol] == 1) { |
| 215 | - $aArray[$i][$sNameNewCol] = (int)round($f, 0); |
|
| 215 | + $aArray[$i][$sNameNewCol] = (int) round($f, 0); |
|
| 216 | 216 | continue; |
| 217 | 217 | } |
| 218 | 218 | //If non equals |
| 219 | 219 | if ($aArray[$i][$nameEqualCol] == 1) { |
| 220 | - $aArray[$i][$sNameNewCol] = (int)round($aF[$aArray[$i][$nameRankCol]], 0); |
|
| 220 | + $aArray[$i][$sNameNewCol] = (int) round($aF[$aArray[$i][$nameRankCol]], 0); |
|
| 221 | 221 | continue; |
| 222 | 222 | } |
| 223 | 223 | //If equals (do average of players gives if they weren't tied) |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | $value = round(array_sum($aTiedValues) / count($aTiedValues), 0); |
| 229 | 229 | for ($j = $i, $nb = $i + count($aTiedValues); $j < $nb; ++$j) { |
| 230 | - $aArray[$i][$sNameNewCol] = (int)$value; |
|
| 230 | + $aArray[$i][$sNameNewCol] = (int) $value; |
|
| 231 | 231 | $i++; |
| 232 | 232 | } |
| 233 | 233 | $i--; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $arrayParts = explode('|', $mask); |
| 18 | 18 | foreach ($arrayParts as $partOfMask) { |
| 19 | 19 | $arrayLib = explode('~', $partOfMask); |
| 20 | - $result[] = ['size' => (int)$arrayLib[0], 'suffixe' => $arrayLib[1]]; |
|
| 20 | + $result[] = ['size' => (int) $arrayLib[0], 'suffixe' => $arrayLib[1]]; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | return $result; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | { |
| 36 | 36 | $parse = self::parseChartMask($mask); |
| 37 | 37 | $negative = 0 === strpos($value, '-'); |
| 38 | - $value = $negative ? (int)substr($value, 1) : $value; |
|
| 38 | + $value = $negative ? (int) substr($value, 1) : $value; |
|
| 39 | 39 | $data = []; |
| 40 | 40 | $laValue = $value; |
| 41 | 41 | for ($k = count($parse) - 1; $k >= 0; $k--) { |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | |
| 27 | 27 | /** @var \VideoGamesRecords\CoreBundle\Model\Api\PlayerChart $object */ |
| 28 | - $object = $this->get('serializer')->deserialize($request->getContent(), 'VideoGamesRecords\CoreBundle\Model\Api\PlayerChart', 'json'); |
|
| 28 | + $object = $this->get('serializer')->deserialize($request->getContent(), 'VideoGamesRecords\CoreBundle\Model\Api\PlayerChart', 'json'); |
|
| 29 | 29 | |
| 30 | 30 | //@todo get idPlayer From Authentification |
| 31 | 31 | $idPlayer = $object->getIdPlayer(); |