Passed
Push — master ( a14240...3e537e )
by Xavier
07:17
created
src/Event/AdminSubscriber.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,17 +36,21 @@
 block discarded – undo
36 36
         if ($controller[0] instanceof AdminAuthenticatedInterface) {
37 37
             $isAdmin = false;
38 38
             if (isset($_SESSION['phpCAS']['user'])) {
39
-                if (in_array($_SESSION['phpCAS']['user'], $this->administrators))
40
-                    $isAdmin = true;
39
+                if (in_array($_SESSION['phpCAS']['user'], $this->administrators)) {
40
+                                    $isAdmin = true;
41
+                }
42
+            }
43
+            if (!$isAdmin) {
44
+                throw new AccessDeniedHttpException('Access forbidden.');
41 45
             }
42
-            if (!$isAdmin) throw new AccessDeniedHttpException('Access forbidden.');
43 46
         }
44 47
     }
45 48
 
46 49
     public function onKernelRequest(GetResponseEvent $event)
47 50
     {
48
-        if (HttpKernel::MASTER_REQUEST != $event->getRequestType())
49
-            return;
51
+        if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
52
+                    return;
53
+        }
50 54
     }
51 55
 
52 56
 
Please login to merge, or discard this patch.
src/Event/StudentSubscriber.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,9 @@
 block discarded – undo
42 42
 
43 43
     public function onKernelRequest(GetResponseEvent $event)
44 44
     {
45
-        if (HttpKernel::MASTER_REQUEST != $event->getRequestType())
46
-            return;
45
+        if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
46
+                    return;
47
+        }
47 48
     }
48 49
 
49 50
 
Please login to merge, or discard this patch.
src/Controller/AdminController.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,10 +86,10 @@
 block discarded – undo
86 86
             $activities = array_count_values($activities);
87 87
         }
88 88
 
89
-       //foreach (json_decode($enrollments->getBody()->getContents()) as $enrollment) {
90
-       //    if ($enrollment->class->title != null)
91
-       //        array_push($classes, $enrollment->class);
92
-       //}
89
+        //foreach (json_decode($enrollments->getBody()->getContents()) as $enrollment) {
90
+        //    if ($enrollment->class->title != null)
91
+        //        array_push($classes, $enrollment->class);
92
+        //}
93 93
 
94 94
         return $this->render('Admin/user.twig', [
95 95
             'givenName' => $user->givenName,
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@  discard block
 block discarded – undo
36 36
             $res = [];
37 37
 
38 38
             foreach($students as $student) {
39
-                if ($student['uid'][0] != null)
40
-                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
39
+                if ($student['uid'][0] != null) {
40
+                                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
41
+                }
41 42
             }
42 43
 
43 44
             return $this->json($res);
@@ -80,8 +81,9 @@  discard block
 block discarded – undo
80 81
 
81 82
         if ($events != null)
82 83
         {
83
-            foreach ($events as $event)
84
-                array_push($activities, $event->object->name);
84
+            foreach ($events as $event) {
85
+                            array_push($activities, $event->object->name);
86
+            }
85 87
 
86 88
             $activities = array_count_values($activities);
87 89
         }
Please login to merge, or discard this patch.