Passed
Branch master (b6469e)
by Xavier
07:21 queued 05:06
created
src/Controller/UserController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         $events['moodle'] = null;
44 44
 
45 45
         if ($events['all'] != null) {
46
-            usort($events['all'], function ($a, $b) {
46
+            usort($events['all'], function($a, $b) {
47 47
                 return $a->eventTime < $b->eventTime;
48 48
             });
49 49
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $events = Klass::eventsForUser($id, self::loggedUser());
131 131
 
132 132
         if ($events != null)
133
-            usort($events, function($a, $b) {return $a->eventTime < $b->eventTime;});
133
+            usort($events, function($a, $b) {return $a->eventTime < $b->eventTime; });
134 134
 
135 135
         return $this->render('User/class.twig', [
136 136
             'class' => $class,
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             }
164 164
 
165 165
             return $this->json($res);
166
-        }catch (Exception $e) {
166
+        } catch (Exception $e) {
167 167
             return new Response($e->getMessage(), 404);
168 168
         }
169 169
 
Please login to merge, or discard this patch.
src/Controller/AdminController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
             $students = $this->ldap($filter, ['displayname', 'uid']);
37 37
             $res = [];
38 38
 
39
-            foreach($students as $student) {
39
+            foreach ($students as $student) {
40 40
                 if ($student['uid'][0] != null)
41
-                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
41
+                    $res += [$student['uid'][0] => $student['displayname'][0]];
42 42
             }
43 43
 
44 44
             return $this->json($res);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function viewAs(Request $request, String $id)
58 58
     {
59
-        $_SESSION['username'] =  $_SESSION['phpCAS']['user'];
59
+        $_SESSION['username'] = $_SESSION['phpCAS']['user'];
60 60
         $_SESSION['phpCAS']['user'] = $id;
61 61
         return $this->redirectToRoute('home');
62 62
     }
Please login to merge, or discard this patch.
src/Controller/AbstractController.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
14 14
 use Symfony\Component\DependencyInjection\ContainerInterface;
15 15
 
16
- abstract class AbstractController extends Controller
16
+    abstract class AbstractController extends Controller
17 17
 {
18 18
 
19 19
     /**
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
         $container->set('http', self::$http);
34 34
     }
35 35
 
36
-     /**
37
-      * Creates and return a JSON Web Token through the OpenLRW API by using credentials filled in .env
38
-      *
39
-      * @return mixed|\Psr\Http\Message\ResponseInterface
40
-      * @throws \GuzzleHttp\Exception\GuzzleException
41
-      */
36
+        /**
37
+         * Creates and return a JSON Web Token through the OpenLRW API by using credentials filled in .env
38
+         *
39
+         * @return mixed|\Psr\Http\Message\ResponseInterface
40
+         * @throws \GuzzleHttp\Exception\GuzzleException
41
+         */
42 42
     public static function generateJwt()
43 43
     {
44 44
         $_SESSION['JWT'] = json_decode( self::$http->request('POST', 'api/auth/login', [
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 'password' => env('API_PASSWORD')
49 49
             ]
50 50
         ])->getBody()
51
-          ->getContents())->token;
51
+            ->getContents())->token;
52 52
 
53 53
         return $_SESSION['JWT'];
54 54
 
@@ -124,26 +124,26 @@  discard block
 block discarded – undo
124 124
         return ldap_get_entries($this->__get('ldap'), $this->searchLDAP($filter, $arg))[0];
125 125
     }
126 126
 
127
-     /**
128
-      * Function to check if OpenLRW is up
129
-      *
130
-      * @return boolean
131
-      * @throws \GuzzleHttp\Exception\GuzzleException
132
-      */
133
-     public static function isUp()
134
-     {
135
-         return self::$http->request('GET', '/info.json')->getStatusCode() == 200;
136
-     }
137
-
138
-     /**
139
-      * Get the logged username
140
-      *
141
-      * @return mixed
142
-      */
143
-     public static function loggedUser()
144
-     {
145
-         return $_SESSION['phpCAS']['user'];
146
-     }
127
+        /**
128
+         * Function to check if OpenLRW is up
129
+         *
130
+         * @return boolean
131
+         * @throws \GuzzleHttp\Exception\GuzzleException
132
+         */
133
+        public static function isUp()
134
+        {
135
+            return self::$http->request('GET', '/info.json')->getStatusCode() == 200;
136
+        }
137
+
138
+        /**
139
+         * Get the logged username
140
+         *
141
+         * @return mixed
142
+         */
143
+        public static function loggedUser()
144
+        {
145
+            return $_SESSION['phpCAS']['user'];
146
+        }
147 147
 
148 148
 
149 149
 }
150 150
\ No newline at end of file
Please login to merge, or discard this patch.
src/Model/API/ApiModel.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@
 block discarded – undo
68 68
      */
69 69
     public function post(String $route, array $args) // ToDo : add JWT
70 70
     {
71
-       return json_decode( self::$http->request('POST', $route, [
72
-           'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' ],
73
-           'json' => $args
74
-       ])->getBody()->getContents());
71
+        return json_decode( self::$http->request('POST', $route, [
72
+            'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' ],
73
+            'json' => $args
74
+        ])->getBody()->getContents());
75 75
     }
76 76
 
77 77
 
Please login to merge, or discard this patch.