@@ -49,7 +49,7 @@ |
||
49 | 49 | { |
50 | 50 | $plainPassword = $credentials['password']; |
51 | 51 | |
52 | - if($user->getLoginMethod() != 'form') |
|
52 | + if ($user->getLoginMethod() != 'form') |
|
53 | 53 | throw new CustomUserMessageAuthenticationException('No password available'); |
54 | 54 | |
55 | 55 | if (!$this->passwordEncoder->isPasswordValid($user, $plainPassword)) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | // Sinon, on lance le check associé |
66 | 66 | $check = false; |
67 | - $method = 'check' . $achievement->getIdA(); |
|
67 | + $method = 'check'.$achievement->getIdA(); |
|
68 | 68 | if (method_exists($this, $method)) |
69 | 69 | $check = $this->$method(); |
70 | 70 | |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | $total = count(Achievement::getConstants()); |
92 | - if (count($this->achievements) >= $total * 0.5) { |
|
92 | + if (count($this->achievements) >= $total*0.5) { |
|
93 | 93 | $achievementCheck = new AchievementCheckEvent(Achievement::CRAZY_UNLOCKER); |
94 | 94 | $this->check($achievementCheck); |
95 | 95 | } |
96 | - if (count($this->achievements) >= $total * 0.9) { |
|
96 | + if (count($this->achievements) >= $total*0.9) { |
|
97 | 97 | $achievementCheck = new AchievementCheckEvent(Achievement::TOTAL_UNLOCKER); |
98 | 98 | $this->check($achievementCheck); |
99 | 99 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $factor += 0.75; |
124 | 124 | } |
125 | 125 | } |
126 | - return ceil($factor * $points); |
|
126 | + return ceil($factor*$points); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // Fonctions de check correspondant aux divers achievements |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | // Télécharger plus de 100Go sur Ponthub |
192 | 192 | public function check60() |
193 | 193 | { |
194 | - return $this->totalPontHubSize() > (100 * 1024 * 1024 * 1024); |
|
194 | + return $this->totalPontHubSize() > (100*1024*1024*1024); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | // Ultimate Downloader |
198 | 198 | // Télécharger plus de 500Go sur Ponthub |
199 | 199 | public function check70() |
200 | 200 | { |
201 | - return $this->totalPontHubSize() > (500 * 1024 * 1024 * 1024); |
|
201 | + return $this->totalPontHubSize() > (500*1024*1024*1024); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | private function totalPontHubSize() |
@@ -33,23 +33,23 @@ |
||
33 | 33 | switch ($user->getPromo()) { |
34 | 34 | // Attention, toujours préciser l'id facebook de la promo d'après |
35 | 35 | // pour avoir les étrangers |
36 | - case '015': |
|
37 | - $id = '359646667495742'; |
|
38 | - break; // Wei't spirit |
|
39 | - case '016': |
|
40 | - $id = '1451446761806184'; |
|
41 | - break; // Wei't the phoque |
|
42 | - case '017': |
|
43 | - $id = '737969042997359'; |
|
44 | - break; // F'wei'ght Club |
|
45 | - case '018': |
|
46 | - $id = '1739424532975028'; |
|
47 | - break; // WEI'STED |
|
48 | - case '019': |
|
49 | - $id = '1739424532975028'; |
|
50 | - break; // WEI'STED |
|
51 | - default: |
|
52 | - return; |
|
36 | + case '015': |
|
37 | + $id = '359646667495742'; |
|
38 | + break; // Wei't spirit |
|
39 | + case '016': |
|
40 | + $id = '1451446761806184'; |
|
41 | + break; // Wei't the phoque |
|
42 | + case '017': |
|
43 | + $id = '737969042997359'; |
|
44 | + break; // F'wei'ght Club |
|
45 | + case '018': |
|
46 | + $id = '1739424532975028'; |
|
47 | + break; // WEI'STED |
|
48 | + case '019': |
|
49 | + $id = '1739424532975028'; |
|
50 | + break; // WEI'STED |
|
51 | + default: |
|
52 | + return; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | // On récupère la liste des membres |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | $this->fbToken = $facebookToken; |
25 | 25 | } |
26 | 26 | |
27 | - public function facebookImport(UserRegistrationEvent $event){ |
|
27 | + public function facebookImport(UserRegistrationEvent $event) { |
|
28 | 28 | $user = $event->getUser(); |
29 | 29 | |
30 | - $token = '?access_token=' . $this->fbToken; |
|
30 | + $token = '?access_token='.$this->fbToken; |
|
31 | 31 | |
32 | 32 | // Ids des différents groupes facebook |
33 | 33 | switch ($user->getPromo()) { |
@@ -35,26 +35,26 @@ discard block |
||
35 | 35 | // pour avoir les étrangers |
36 | 36 | case '015': |
37 | 37 | $id = '359646667495742'; |
38 | - break; // Wei't spirit |
|
38 | + break; // Wei't spirit |
|
39 | 39 | case '016': |
40 | 40 | $id = '1451446761806184'; |
41 | 41 | break; // Wei't the phoque |
42 | 42 | case '017': |
43 | 43 | $id = '737969042997359'; |
44 | - break; // F'wei'ght Club |
|
44 | + break; // F'wei'ght Club |
|
45 | 45 | case '018': |
46 | 46 | $id = '1739424532975028'; |
47 | - break; // WEI'STED |
|
47 | + break; // WEI'STED |
|
48 | 48 | case '019': |
49 | 49 | $id = '1739424532975028'; |
50 | - break; // WEI'STED |
|
50 | + break; // WEI'STED |
|
51 | 51 | default: |
52 | 52 | return; |
53 | 53 | } |
54 | 54 | |
55 | 55 | // On récupère la liste des membres |
56 | 56 | $baseUrl = 'https://graph.facebook.com/v2.7'; |
57 | - $data = json_decode($this->curlService->curl($baseUrl . '/' . $id . '/members' . $token . '&limit=10000'), true); |
|
57 | + $data = json_decode($this->curlService->curl($baseUrl.'/'.$id.'/members'.$token.'&limit=10000'), true); |
|
58 | 58 | |
59 | 59 | $bestMatch = null; |
60 | 60 | $bestPercent = -1; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | } |
68 | 68 | |
69 | 69 | if ($bestPercent > 85) { |
70 | - $url = '/' . $bestMatch['id'] . '/picture' . $token . '&width=9999&redirect=false'; |
|
71 | - $dataImage = json_decode($this->curlService->curl($baseUrl . $url), true); |
|
70 | + $url = '/'.$bestMatch['id'].'/picture'.$token.'&width=9999&redirect=false'; |
|
71 | + $dataImage = json_decode($this->curlService->curl($baseUrl.$url), true); |
|
72 | 72 | $image = $this->imageService->upload($dataImage['data']['url'], true); |
73 | 73 | $user->setImage($image); |
74 | 74 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | private function isSimilar(User $user, array $member) |
82 | 82 | { |
83 | 83 | $percent = 0; |
84 | - similar_text($user->getFirstName() . ' ' . $user->getLastName(), $member['name'], $percent); |
|
84 | + similar_text($user->getFirstName().' '.$user->getLastName(), $member['name'], $percent); |
|
85 | 85 | return $percent; |
86 | 86 | } |
87 | 87 | } |
@@ -11,7 +11,6 @@ |
||
11 | 11 | use Symfony\Component\Security\Core\Exception\CustomUserMessageAuthenticationException; |
12 | 12 | use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; |
13 | 13 | use Symfony\Component\Security\Core\User\UserInterface; |
14 | - |
|
15 | 14 | use Symfony\Component\Security\Core\User\UserProviderInterface; |
16 | 15 | |
17 | 16 |
@@ -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 |
@@ -28,8 +28,8 @@ |
||
28 | 28 | |
29 | 29 | $majorProblems = $symfonyRequirements->getFailedRequirements(); |
30 | 30 | $minorProblems = $symfonyRequirements->getFailedRecommendations(); |
31 | -$hasMajorProblems = (bool) count($majorProblems); |
|
32 | -$hasMinorProblems = (bool) count($minorProblems); |
|
31 | +$hasMajorProblems = (bool)count($majorProblems); |
|
32 | +$hasMinorProblems = (bool)count($minorProblems); |
|
33 | 33 | |
34 | 34 | ?> |
35 | 35 | <!DOCTYPE html> |
@@ -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 | } |
@@ -3,11 +3,10 @@ |
||
3 | 3 | namespace KI\DvpBundle\Controller; |
4 | 4 | |
5 | 5 | use KI\CoreBundle\Controller\ResourceController; |
6 | +use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
|
6 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
7 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
8 | -use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
|
9 | 9 | use Symfony\Component\DependencyInjection\ContainerInterface; |
10 | -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; |
|
11 | 10 | |
12 | 11 | class BasketsController extends ResourceController |
13 | 12 | { |
@@ -123,7 +123,7 @@ |
||
123 | 123 | */ |
124 | 124 | public function downloadOtherAction($slug) |
125 | 125 | { |
126 | - $item = $this->getOne($slug, !$this->is('EXTERIEUR')); |
|
126 | + $item = $this->getOne($slug, !$this->is('EXTERIEUR')); |
|
127 | 127 | return $this->download($item); |
128 | 128 | } |
129 | 129 | } |
@@ -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 |