Completed
Push — master ( 6d226f...cc9b98 )
by Louis
182:05 queued 126:54
created
back/src/KI/FoyerBundle/Controller/DefaultController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Controller/PontlyvalentsController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Service/MailerService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
             ->setReplyTo([$from->getEmail() => $from->getFirstName().' '.$from->getLastName()])
28 28
         ;
29 29
 
30
-        foreach($attachments as $attachment){
30
+        foreach ($attachments as $attachment) {
31 31
             $message->attach(Swift_Attachment::fromPath($attachment['path'])->setFilename($attachment['name']));
32 32
         }
33 33
 
Please login to merge, or discard this patch.
back/src/KI/UserBundle/Command/PhotoUpdateCommand.php 4 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -94,13 +94,13 @@
 block discarded – undo
94 94
             }
95 95
         }
96 96
         $output->writeln(
97
-          ['End of list',
98
-          '',
99
-          'Students in promo '.$input->getArgument('promo').': '.count($users),
100
-          'Missing photos in promo: '.($updateCount+$unfoundCount),
101
-          'Imported missing photos :'.$updateCount,
102
-          'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
103
-          ]);
97
+            ['End of list',
98
+            '',
99
+            'Students in promo '.$input->getArgument('promo').': '.count($users),
100
+            'Missing photos in promo: '.($updateCount+$unfoundCount),
101
+            'Imported missing photos :'.$updateCount,
102
+            'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
103
+            ]);
104 104
     }
105 105
 
106 106
     // Compare un User uPont et un utilisateur Facebook et essaye de deviner si
Please login to merge, or discard this patch.
Switch Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -35,26 +35,26 @@
 block discarded – undo
35 35
         switch ($input->getArgument('promo')) {
36 36
             // Attention, toujours préciser l'id facebook de la promo d'après
37 37
             // pour avoir les étrangers
38
-            case '015':
39
-                $id = '359646667495742';
40
-                break;  // Wei't spirit
41
-            case '016':
42
-                $id = '1451446761806184';
43
-                break; // Wei't the phoque
44
-            case '017':
45
-                $id = '737969042997359';
46
-                break;  // F'wei'ght Club
47
-            case '018':
48
-                $id = '1739424532975028';
49
-                break;  // WEI'STED
50
-            case '019':
51
-                $id = '313192685791329';
52
-                break;  // WEI'T FOR IT
53
-            case '020':
54
-                $id = '313192685791329';
55
-                break;  // WEI'T FOR IT
56
-            default:
57
-                return;
38
+        case '015':
39
+            $id = '359646667495742';
40
+            break;  // Wei't spirit
41
+        case '016':
42
+            $id = '1451446761806184';
43
+            break; // Wei't the phoque
44
+        case '017':
45
+            $id = '737969042997359';
46
+            break;  // F'wei'ght Club
47
+        case '018':
48
+            $id = '1739424532975028';
49
+            break;  // WEI'STED
50
+        case '019':
51
+            $id = '313192685791329';
52
+            break;  // WEI'T FOR IT
53
+        case '020':
54
+            $id = '313192685791329';
55
+            break;  // WEI'T FOR IT
56
+        default:
57
+            return;
58 58
         }
59 59
 
60 60
         // On récupère la liste des membres
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
         $users = $repo->findByPromo($input->getArgument('promo'));
31 31
 
32
-        $token = '?access_token=' . $fbToken;
32
+        $token = '?access_token='.$fbToken;
33 33
 
34 34
         // Ids des différents groupes facebook
35 35
         switch ($input->getArgument('promo')) {
@@ -37,29 +37,29 @@  discard block
 block discarded – undo
37 37
             // pour avoir les étrangers
38 38
             case '015':
39 39
                 $id = '359646667495742';
40
-                break;  // Wei't spirit
40
+                break; // Wei't spirit
41 41
             case '016':
42 42
                 $id = '1451446761806184';
43 43
                 break; // Wei't the phoque
44 44
             case '017':
45 45
                 $id = '737969042997359';
46
-                break;  // F'wei'ght Club
46
+                break; // F'wei'ght Club
47 47
             case '018':
48 48
                 $id = '1739424532975028';
49
-                break;  // WEI'STED
49
+                break; // WEI'STED
50 50
             case '019':
51 51
                 $id = '313192685791329';
52
-                break;  // WEI'T FOR IT
52
+                break; // WEI'T FOR IT
53 53
             case '020':
54 54
                 $id = '313192685791329';
55
-                break;  // WEI'T FOR IT
55
+                break; // WEI'T FOR IT
56 56
             default:
57 57
                 return;
58 58
         }
59 59
 
60 60
         // On récupère la liste des membres
61 61
         $baseUrl = 'https://graph.facebook.com/v2.10';
62
-        $data = json_decode($curlService->curl($baseUrl . '/' . $id . '/members' . $token . '&limit=10000'), true);
62
+        $data = json_decode($curlService->curl($baseUrl.'/'.$id.'/members'.$token.'&limit=10000'), true);
63 63
 
64 64
         $updateCount = 0;
65 65
         $unfoundCount = 0;
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
                 }
81 81
 
82 82
                 if ($bestPercent > 85) {
83
-                    $url = '/' . $bestMatch['id'] . '/picture' . $token . '&width=9999&redirect=false';
84
-                    $dataImage = json_decode($curlService->curl($baseUrl . $url), true);
83
+                    $url = '/'.$bestMatch['id'].'/picture'.$token.'&width=9999&redirect=false';
84
+                    $dataImage = json_decode($curlService->curl($baseUrl.$url), true);
85 85
                     $image = $imageService->upload($dataImage['data']['url'], true);
86 86
                     $user->setImage($image);
87 87
                     $updateCount++;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
           ['End of list',
99 99
           '',
100 100
           'Students in promo '.$input->getArgument('promo').': '.count($users),
101
-          'Missing photos in promo: '.($updateCount+$unfoundCount),
101
+          'Missing photos in promo: '.($updateCount + $unfoundCount),
102 102
           'Imported missing photos :'.$updateCount,
103 103
           'Remaining missing photos (unfound Facebook profiles): '.$unfoundCount
104 104
           ]);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     private function isSimilar(User $user, array $member)
110 110
     {
111 111
         $percent = 0;
112
-        similar_text($user->getFirstName() . ' ' . $user->getLastName(), $member['name'], $percent);
112
+        similar_text($user->getFirstName().' '.$user->getLastName(), $member['name'], $percent);
113 113
         return $percent;
114 114
     }
115 115
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,8 +86,7 @@
 block discarded – undo
86 86
                     $user->setImage($image);
87 87
                     $updateCount++;
88 88
                     $output->writeln($user->getFirstName().' '.$user->getLastName().' <- '.$bestMatch['name'].' ('.$bestPercent.'% similar)');
89
-                }
90
-                else {
89
+                } else {
91 90
                     $unfoundCount++;
92 91
                 }
93 92
 
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.