@@ -107,7 +107,7 @@ |
||
| 107 | 107 | if (!(isset($match[1]) && isset($match[2]))) { |
| 108 | 108 | return []; |
| 109 | 109 | } |
| 110 | - $size = $match[2] * 1000; |
|
| 110 | + $size = $match[2]*1000; |
|
| 111 | 111 | $line = str_replace($match[1], '', $line); |
| 112 | 112 | |
| 113 | 113 | // On exclut tous les fichiers de type non valide |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | |
| 14 | 14 | public function __construct(EntityManager $manager, TokenStorage $tokenStorage) |
| 15 | 15 | { |
| 16 | - $this->manager = $manager; |
|
| 16 | + $this->manager = $manager; |
|
| 17 | 17 | $this->tokenStorage = $tokenStorage; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | array_multisort($ids, SORT_ASC, $locked); |
| 140 | 140 | |
| 141 | 141 | // On renvoie pas mal de données utiles |
| 142 | - $response = Achievement::getLevel($factor * $points); |
|
| 142 | + $response = Achievement::getLevel($factor*$points); |
|
| 143 | 143 | $return = [ |
| 144 | 144 | 'number' => $response['number'], |
| 145 | - 'points' => ceil($factor * $points), |
|
| 145 | + 'points' => ceil($factor*$points), |
|
| 146 | 146 | 'current_level' => $response['current'], |
| 147 | 147 | 'next_level' => isset($response['next']) ? $response['next'] : null, |
| 148 | 148 | 'unlocked' => $unlocked, |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | if (!$notification->getRead()->contains($user) && !$notification->getRecipient()->contains($user)) |
| 300 | 300 | $return[] = $notification; |
| 301 | 301 | } else |
| 302 | - throw new \Exception('Notification : mode d\'envoi inconnu (' . $mode . ')'); |
|
| 302 | + throw new \Exception('Notification : mode d\'envoi inconnu ('.$mode.')'); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | // On marque chaque notification récupérée comme lue |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | return [ |
| 28 | - 'version' => $out[1][count($out[0])-1], |
|
| 29 | - 'major' => $out[2][count($out[0])-1], |
|
| 30 | - 'minor' => $out[3][count($out[0])-1], |
|
| 28 | + 'version' => $out[1][count($out[0]) - 1], |
|
| 29 | + 'major' => $out[2][count($out[0]) - 1], |
|
| 30 | + 'minor' => $out[3][count($out[0]) - 1], |
|
| 31 | 31 | 'build' => shell_exec('git log --pretty=format:"%h" -n 1'), |
| 32 | 32 | 'date' => (int)shell_exec('git log -1 --pretty=format:%ct') |
| 33 | 33 | ]; |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) |
| 51 | 51 | { |
| 52 | - $this->fulfilled = (bool) $fulfilled; |
|
| 53 | - $this->testMessage = (string) $testMessage; |
|
| 54 | - $this->helpHtml = (string) $helpHtml; |
|
| 55 | - $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; |
|
| 56 | - $this->optional = (bool) $optional; |
|
| 52 | + $this->fulfilled = (bool)$fulfilled; |
|
| 53 | + $this->testMessage = (string)$testMessage; |
|
| 54 | + $this->helpHtml = (string)$helpHtml; |
|
| 55 | + $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string)$helpText; |
|
| 56 | + $this->optional = (bool)$optional; |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | ); |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | - $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; |
|
| 547 | + $pcreVersion = defined('PCRE_VERSION') ? (float)PCRE_VERSION : null; |
|
| 548 | 548 | |
| 549 | 549 | $this->addRequirement( |
| 550 | 550 | null !== $pcreVersion, |
@@ -739,7 +739,7 @@ discard block |
||
| 739 | 739 | |
| 740 | 740 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
| 741 | 741 | $this->addRecommendation( |
| 742 | - $this->getRealpathCacheSize() >= 5 * 1024 * 1024, |
|
| 742 | + $this->getRealpathCacheSize() >= 5*1024*1024, |
|
| 743 | 743 | 'realpath_cache_size should be at least 5M in php.ini', |
| 744 | 744 | 'Setting "<strong>realpath_cache_size</strong>" to e.g. "<strong>5242880</strong>" or "<strong>5M</strong>" in php.ini<a href="#phpini">*</a> may improve performance on Windows significantly in some cases.' |
| 745 | 745 | ); |
@@ -783,17 +783,17 @@ discard block |
||
| 783 | 783 | $unit = ''; |
| 784 | 784 | if (!ctype_digit($size)) { |
| 785 | 785 | $unit = strtolower(substr($size, -1, 1)); |
| 786 | - $size = (int) substr($size, 0, -1); |
|
| 786 | + $size = (int)substr($size, 0, -1); |
|
| 787 | 787 | } |
| 788 | 788 | switch ($unit) { |
| 789 | 789 | case 'g': |
| 790 | - return $size * 1024 * 1024 * 1024; |
|
| 790 | + return $size*1024*1024*1024; |
|
| 791 | 791 | case 'm': |
| 792 | - return $size * 1024 * 1024; |
|
| 792 | + return $size*1024*1024; |
|
| 793 | 793 | case 'k': |
| 794 | - return $size * 1024; |
|
| 794 | + return $size*1024; |
|
| 795 | 795 | default: |
| 796 | - return (int) $size; |
|
| 796 | + return (int)$size; |
|
| 797 | 797 | } |
| 798 | 798 | } |
| 799 | 799 | |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | continue; |
| 816 | 816 | } |
| 817 | 817 | |
| 818 | - return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
| 818 | + return (int)$package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | return false; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | // Si on est l'auteur du shotgun, on peut récupérer la liste d'attente |
| 376 | 376 | if ($event->getAuthorUser() == $user) { |
| 377 | 377 | // It's a trap |
| 378 | - if (time() >= $event->getShotgunDate()){ |
|
| 378 | + if (time() >= $event->getShotgunDate()) { |
|
| 379 | 379 | $result['success'] = $success; |
| 380 | 380 | $result['fail'] = $fail; |
| 381 | 381 | } else { |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | - if ($this->is('ADMIN')){ |
|
| 387 | + if ($this->is('ADMIN')) { |
|
| 388 | 388 | $result['success'] = $success; |
| 389 | 389 | $result['fail'] = $fail; |
| 390 | 390 | } |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $promoBalances = $this->manager->getRepository('KIFoyerBundle:Transaction')->getPromoBalances(); |
| 50 | 50 | |
| 51 | - foreach ($promoBalances as $promoBalance){ |
|
| 51 | + foreach ($promoBalances as $promoBalance) { |
|
| 52 | 52 | $statistics['promoBalances']['labels'][] = trim($promoBalance['promo']); |
| 53 | 53 | $statistics['promoBalances']['data'][] = round($promoBalance['promoBalance'], 2); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $soldBeers = $this->manager->getRepository('KIFoyerBundle:Transaction')->getSoldBeers(); |
| 57 | 57 | |
| 58 | - foreach ($soldBeers as $soldBeer){ |
|
| 58 | + foreach ($soldBeers as $soldBeer) { |
|
| 59 | 59 | $statistics['soldBeers']['labels'][] = trim($soldBeer['name']); |
| 60 | 60 | $statistics['soldBeers']['data'][] = $soldBeer['soldBeer']; |
| 61 | 61 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->trust($this->isFoyerMember()); |
| 137 | 137 | |
| 138 | - $response = new StreamedResponse(function () { |
|
| 138 | + $response = new StreamedResponse(function() { |
|
| 139 | 139 | $results = $this->repository->getDebtsIterator(); |
| 140 | 140 | $handle = fopen('php://output', 'r+'); |
| 141 | 141 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | $this->trust($this->isFoyerMember()); |
| 174 | 174 | |
| 175 | - $response = new StreamedResponse(function () { |
|
| 175 | + $response = new StreamedResponse(function() { |
|
| 176 | 176 | $results = $this->repository->getPromoBalance(); |
| 177 | 177 | $handle = fopen('php://output', 'r+'); |
| 178 | 178 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $username = $credentials['username']; |
| 71 | 71 | |
| 72 | 72 | $email = $credentials['mail']; |
| 73 | - if(!preg_match('/@eleves\.enpc\.fr$/', $email)) |
|
| 73 | + if (!preg_match('/@eleves\.enpc\.fr$/', $email)) |
|
| 74 | 74 | throw new AccessDeniedException(); |
| 75 | 75 | |
| 76 | 76 | $user = null; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - if(!$user) { |
|
| 84 | + if (!$user) { |
|
| 85 | 85 | $user = $this->userRepository->findOneBy(['email' => $credentials['mail']]); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | $this->initialize('Pontlyvalent', 'User'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - private function checkPontlyvalentOpen(){ |
|
| 25 | + private function checkPontlyvalentOpen() { |
|
| 26 | 26 | $lastPromo = $this->getConfig('promos.latest'); |
| 27 | 27 | |
| 28 | 28 | if ($this->user->getPromo() == $lastPromo) { |
| 29 | - throw new BadRequestHttpException('Ton tour n\'est pas encore arrivé, petit ' . $lastPromo . ' !'); |
|
| 29 | + throw new BadRequestHttpException('Ton tour n\'est pas encore arrivé, petit '.$lastPromo.' !'); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if($this->getConfig('pontlyvalent.open')) { |
|
| 32 | + if ($this->getConfig('pontlyvalent.open')) { |
|
| 33 | 33 | throw new BadRequestHttpException('Le pontlyvalent est fermé !'); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $pontlyvalent = $this->repository->getPontlyvalent($target, $this->user); |
| 90 | 90 | |
| 91 | - if(count($pontlyvalent) != 1) |
|
| 91 | + if (count($pontlyvalent) != 1) |
|
| 92 | 92 | throw new NotFoundHttpException(); |
| 93 | 93 | |
| 94 | 94 | return $this->json($pontlyvalent[0]); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $targetPromo = array_slice($this->getConfig('promos.all'), -2, 1)[0]; |
| 123 | 123 | if ($target->getPromo() != $targetPromo) { |
| 124 | - throw new BadRequestHttpException('Ce n\'est pas un ' . $targetPromo . ' !'); |
|
| 124 | + throw new BadRequestHttpException('Ce n\'est pas un '.$targetPromo.' !'); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | $pontlyvalent = $this->repository->getPontlyvalent($target, $this->user); |