Completed
Pull Request — master (#250)
by Louis
92:53 queued 37:37
created
back/src/KI/UserBundle/Security/FormLoginAuthenticator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Controller/UsersController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             throw new BadRequestHttpException('Cet utilisateur existe déjà.');
222 222
 
223 223
         // Si le login existe déjà, on ajoute une lettre du prénom
224
-        $login = strtolower(str_replace(' ', '-', substr($this->stripAccents($lastName), 0, 7) . $this->stripAccents($firstName)[0]));
224
+        $login = strtolower(str_replace(' ', '-', substr($this->stripAccents($lastName), 0, 7).$this->stripAccents($firstName)[0]));
225 225
         $i = 1;
226 226
         while (count($repo->findByUsername($login)) > 0) {
227 227
             if (isset($firstName[$i]))
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
         }
279 279
 
280 280
         // On récupère le contenu du fichier
281
-        $path = __DIR__ . '/../../../../web/uploads/tmp/';
281
+        $path = __DIR__.'/../../../../web/uploads/tmp/';
282 282
         $file->move($path, 'users.list');
283
-        $list = fopen($path . 'users.list', 'r+');
283
+        $list = fopen($path.'users.list', 'r+');
284 284
         if ($list === false)
285 285
             throw new BadRequestHttpException('Erreur lors de l\'upload du fichier');
286 286
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         while (!feof($list)) {
291 291
             // On enlève le caractère de fin de ligne
292 292
             $line = str_replace(["\r", "\n"], ['', ''], fgets($list));
293
-            if(empty($line))
293
+            if (empty($line))
294 294
                 continue;
295 295
 
296 296
             $gender = $login = $firstName = $lastName = $email = $promo = $department = $origin = null;
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                 $e[] = 'Adresse mail non utilisable';
307 307
 
308 308
             if (count($e) > 0) {
309
-                $fails[] = $line . ' : ' . implode(', ', $e);
309
+                $fails[] = $line.' : '.implode(', ', $e);
310 310
             } else {
311 311
 
312 312
                 /**
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 }
334 334
                 $user->setGender($gender);
335 335
 
336
-                $success[] = $firstName . ' ' . $lastName;
336
+                $success[] = $firstName.' '.$lastName;
337 337
             }
338 338
         }
339 339
 
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Repository/UserRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
         ')
34 34
             ->setParameter('userId', $userId);
35 35
 
36
-        if($limit !== null && $limit > 0) {
36
+        if ($limit !== null && $limit > 0) {
37 37
             $query->setMaxResults($limit);
38 38
 
39 39
             if ($page !== null && $page > 0)
40
-                $query->setFirstResult(($page - 1) * $limit);
40
+                $query->setFirstResult(($page - 1)*$limit);
41 41
         }
42 42
 
43 43
         return $query->getResult();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function getOnlineUsers($delay = 30) {
102 102
         return $this->createQueryBuilder('u')
103 103
             ->where('u.lastConnect > :date')
104
-            ->setParameter('date', time() - $delay * 60)
104
+            ->setParameter('date', time() - $delay*60)
105 105
             ->getQuery()
106 106
             ->getResult();
107 107
     }
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Listener/AchievementCheckListener.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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()
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Listener/SendMailUserRegistrationListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $this->swiftMailer->send($message);
37 37
 
38 38
         $message = Swift_Message::newInstance()
39
-            ->setSubject('[uPont] Nouvelle inscription (' . $username . ')')
39
+            ->setSubject('[uPont] Nouvelle inscription ('.$username.')')
40 40
             ->setFrom('[email protected]')
41 41
             ->setTo('[email protected]')
42 42
             ->setBody($this->twigEngine->render('KIUserBundle::registration-ki.txt.twig', $attributes));
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Listener/OnlineListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Listener/FacebookImportUserRegistrationListener.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
back/web/config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
back/tests/KI/DvpBundle/Controller/BasketDatesControllerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.