Completed
Push — master ( cc9b98...5f169a )
by Louis
14s
created
back/src/KI/UserBundle/Controller/OwnController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -139,10 +139,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
299 299
                 if (!$notification->getReads()->contains($user) && !$notification->getRecipients()->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
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Command/PhotoUpdateCommand.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,13 +100,13 @@
 block discarded – undo
100 100
             }
101 101
         }
102 102
         $output->writeln(
103
-          ['End of list',
104
-          '',
105
-          'Students in promo '.$input->getArgument('promo').': '.count($users),
106
-          'Missing photos in promo: '.($updateCount+$unfoundCount),
107
-          ($input->getOption('preview') ? 'To be i' : 'I').'mported missing photos :'.$updateCount,
108
-          'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
109
-          ]);
103
+            ['End of list',
104
+            '',
105
+            'Students in promo '.$input->getArgument('promo').': '.count($users),
106
+            'Missing photos in promo: '.($updateCount+$unfoundCount),
107
+            ($input->getOption('preview') ? 'To be i' : 'I').'mported missing photos :'.$updateCount,
108
+            'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
109
+            ]);
110 110
     }
111 111
 
112 112
     // Compare un User uPont et un utilisateur Facebook et essaye de deviner si
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
         $users = $repo->findByPromo($input->getArgument('promo'));
34 34
 
35
-        $token = '?access_token=' . $fbToken;
35
+        $token = '?access_token='.$fbToken;
36 36
 
37 37
         // Ids des différents groupes facebook
38 38
         switch ($input->getArgument('promo')) {
@@ -40,29 +40,29 @@  discard block
 block discarded – undo
40 40
             // pour avoir les étrangers
41 41
             case '015':
42 42
                 $id = '359646667495742';
43
-                break;  // Wei't spirit
43
+                break; // Wei't spirit
44 44
             case '016':
45 45
                 $id = '1451446761806184';
46 46
                 break; // Wei't the phoque
47 47
             case '017':
48 48
                 $id = '737969042997359';
49
-                break;  // F'wei'ght Club
49
+                break; // F'wei'ght Club
50 50
             case '018':
51 51
                 $id = '1739424532975028';
52
-                break;  // WEI'STED
52
+                break; // WEI'STED
53 53
             case '019':
54 54
                 $id = '313192685791329';
55
-                break;  // WEI'T FOR IT
55
+                break; // WEI'T FOR IT
56 56
             case '020':
57 57
                 $id = '313192685791329';
58
-                break;  // WEI'T FOR IT
58
+                break; // WEI'T FOR IT
59 59
             default:
60 60
                 return;
61 61
         }
62 62
 
63 63
         // On récupère la liste des membres
64 64
         $baseUrl = 'https://graph.facebook.com/v2.10';
65
-        $data = json_decode($curlService->curl($baseUrl . '/' . $id . '/members' . $token . '&limit=10000'), true);
65
+        $data = json_decode($curlService->curl($baseUrl.'/'.$id.'/members'.$token.'&limit=10000'), true);
66 66
 
67 67
         $updateCount = 0;
68 68
         $unfoundCount = 0;
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 
85 85
                 if ($bestPercent > $input->getOption('similarity-threshold')) {
86 86
                     if (!$input->getOption('preview')) {
87
-                        $url = '/' . $bestMatch['id'] . '/picture' . $token . '&width=9999&redirect=false';
88
-                        $dataImage = json_decode($curlService->curl($baseUrl . $url), true);
87
+                        $url = '/'.$bestMatch['id'].'/picture'.$token.'&width=9999&redirect=false';
88
+                        $dataImage = json_decode($curlService->curl($baseUrl.$url), true);
89 89
                         $image = $imageService->upload($dataImage['data']['url'], true);
90 90
                         $user->setImage($image);
91 91
                     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
           ['End of list',
104 104
           '',
105 105
           'Students in promo '.$input->getArgument('promo').': '.count($users),
106
-          'Missing photos in promo: '.($updateCount+$unfoundCount),
106
+          'Missing photos in promo: '.($updateCount + $unfoundCount),
107 107
           ($input->getOption('preview') ? 'To be i' : 'I').'mported missing photos :'.$updateCount,
108 108
           'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
109 109
           ]);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     private function isSimilar(User $user, array $member)
115 115
     {
116 116
         $percent = 0;
117
-        similar_text($user->getFirstName() . ' ' . $user->getLastName(), $member['name'], $percent);
117
+        similar_text($user->getFirstName().' '.$user->getLastName(), $member['name'], $percent);
118 118
         return $percent;
119 119
     }
120 120
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@
 block discarded – undo
91 91
                     }
92 92
                     $output->writeln($user->getFirstName().' '.$user->getLastName().' <- '.$bestMatch['name'].' ('.$bestPercent.'% similar)');
93 93
                     $updateCount++;
94
-                }
95
-                else {
94
+                } else {
96 95
                     $unfoundCount++;
97 96
                 }
98 97
 
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/Command/DepartmentUpdateCommand.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
             $list = fopen($input->getArgument('usernames'), 'r+');
33 33
             $usernames = str_replace(["\r", "\n"], ['', ''], fgets($list));
34 34
             $usernameArray = explode(',', $usernames);
35
-        }
36
-        else {
35
+        } else {
37 36
             $usernameArray = explode(',', $input->getArgument('usernames'));
38 37
         }
39 38
 
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
             if ($user) {
43 42
                 $user->setDepartment($input->getArgument('department'));
44 43
                 $successCount++;
45
-            }
46
-            else {
44
+            } else {
47 45
                 $output->writeln('<error>Username '.$username.' n\'existe pas</error>');
48 46
             }
49 47
         }
Please login to merge, or discard this patch.
back/tests/KI/UserBundle/Command/DepartmentUpdateCommandTest.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 
13 13
 class DepartmentUpdateCommandTest extends KernelTestCase
14 14
 {
15
-     /**
16
-     * @var \Doctrine\ORM\EntityManager
17
-     */
15
+        /**
16
+         * @var \Doctrine\ORM\EntityManager
17
+         */
18 18
     private $em;
19 19
 
20
-     /**
21
-      * {@inheritDoc}
22
-      */
20
+        /**
21
+         * {@inheritDoc}
22
+         */
23 23
     protected function setUp()
24 24
     {
25 25
         self::bootKernel();
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
         $this->assertEquals('IMI', $dreveton->getDepartment());
50 50
     }
51 51
 
52
-     /**
53
-      * {@inheritDoc}
54
-      */
52
+        /**
53
+         * {@inheritDoc}
54
+         */
55 55
     protected function tearDown()
56 56
     {
57 57
         parent::tearDown();
Please login to merge, or discard this patch.