@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $response = $this->client->getResponse(); |
| 31 | 31 | $this->assertJsonResponse($response, 200); |
| 32 | 32 | |
| 33 | - $this->client->request('GET', '/basketdates/' . $id); |
|
| 33 | + $this->client->request('GET', '/basketdates/'.$id); |
|
| 34 | 34 | $response = $this->client->getResponse(); |
| 35 | 35 | $this->assertJsonResponse($response, 200); |
| 36 | 36 | |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function testPatch($id) |
| 46 | 46 | { |
| 47 | - $this->client->request('PATCH', '/basketdates/' . $id, [ |
|
| 47 | + $this->client->request('PATCH', '/basketdates/'.$id, [ |
|
| 48 | 48 | 'locked' => true, |
| 49 | 49 | ] |
| 50 | 50 | ); |
| 51 | 51 | $response = $this->client->getResponse(); |
| 52 | 52 | $this->assertJsonResponse($response, 204); |
| 53 | 53 | |
| 54 | - $this->client->request('PATCH', '/basketdates/' . $id, ['dateRetrieve' => '3 janvier']); |
|
| 54 | + $this->client->request('PATCH', '/basketdates/'.$id, ['dateRetrieve' => '3 janvier']); |
|
| 55 | 55 | $response = $this->client->getResponse(); |
| 56 | 56 | $this->assertJsonResponse($response, 400); |
| 57 | 57 | |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function testDelete($id) |
| 67 | 67 | { |
| 68 | - $this->client->request('DELETE', '/basketdates/' . $id); |
|
| 68 | + $this->client->request('DELETE', '/basketdates/'.$id); |
|
| 69 | 69 | $response = $this->client->getResponse(); |
| 70 | 70 | $this->assertJsonResponse($response, 204); |
| 71 | 71 | |
| 72 | - $this->client->request('DELETE', '/basketdates/' . $id); |
|
| 72 | + $this->client->request('DELETE', '/basketdates/'.$id); |
|
| 73 | 73 | $response = $this->client->getResponse(); |
| 74 | 74 | $this->assertJsonResponse($response, 404); |
| 75 | 75 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | ->setMaxResults(10) |
| 27 | 27 | ->getResult(); |
| 28 | 28 | |
| 29 | - foreach ($hallOfFame as &$data){ |
|
| 29 | + foreach ($hallOfFame as &$data) { |
|
| 30 | 30 | $data['liters'] = round($data['liters'], 2); |
| 31 | 31 | } |
| 32 | 32 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | ') |
| 47 | 47 | ->getArrayResult(); |
| 48 | 48 | |
| 49 | - foreach ($promoBalances as &$promoBalance){ |
|
| 49 | + foreach ($promoBalances as &$promoBalance) { |
|
| 50 | 50 | $promoBalance['promoBalance'] = round($promoBalance['promoBalance'], 2); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * Éjecte tous les utilisateurs ne respectant pas la condition |
| 39 | 39 | * @param boolean $bool |
| 40 | - * @return boolean |
|
| 40 | + * @return boolean|null |
|
| 41 | 41 | */ |
| 42 | 42 | protected function trust($bool) |
| 43 | 43 | { |
@@ -80,7 +80,6 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Génère la réponse relative au traitement d'un formulaire |
| 82 | 82 | * @param array $data Le formulaire traité |
| 83 | - * @param object $parent Éventuellement l'objet parent |
|
| 84 | 83 | * @return Response |
| 85 | 84 | */ |
| 86 | 85 | public function formJson($data) |
@@ -86,11 +86,11 @@ |
||
| 86 | 86 | public function formJson($data) |
| 87 | 87 | { |
| 88 | 88 | switch ($data['code']) { |
| 89 | - case 400: |
|
| 90 | - return $this->json($data['form'], $data['code']); |
|
| 91 | - case 204: |
|
| 92 | - default: |
|
| 93 | - return $this->json($data['item'], $data['code']); |
|
| 89 | + case 400: |
|
| 90 | + return $this->json($data['form'], $data['code']); |
|
| 91 | + case 204: |
|
| 92 | + default: |
|
| 93 | + return $this->json($data['item'], $data['code']); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
| 8 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
| 9 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
| 10 | -use Symfony\Component\Form\Exception\UnexpectedTypeException; |
|
| 11 | 10 | use Symfony\Component\DependencyInjection\ContainerInterface; |
| 11 | +use Symfony\Component\Form\Exception\UnexpectedTypeException; |
|
| 12 | 12 | use Symfony\Component\HttpFoundation\Request; |
| 13 | 13 | use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
| 14 | 14 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Doctrine\ORM\EntityManager; |
| 6 | 6 | use KI\PonthubBundle\Entity\Episode; |
| 7 | 7 | use KI\PonthubBundle\Entity\Game; |
| 8 | -use KI\PonthubBundle\Entity\Genre; |
|
| 9 | 8 | use KI\PonthubBundle\Entity\Movie; |
| 10 | 9 | use KI\PonthubBundle\Entity\Other; |
| 11 | 10 | use KI\PonthubBundle\Entity\Serie; |
@@ -23,6 +23,12 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Persiste des objets notification qui seront retrievables |
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @param string $reason |
|
| 29 | + * @param string $title |
|
| 30 | + * @param string $message |
|
| 31 | + */ |
|
| 26 | 32 | public function notify($reason, $title, $message, $mode = 'to', $recipient = [], $resource = '') |
| 27 | 33 | { |
| 28 | 34 | $notification = new Notification($reason, $title, $message, $mode, $resource); |
@@ -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 |