Passed
Push — master ( 419bf8...59abe2 )
by Xavier
02:35
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 AdminAuthenticatedController) {
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/LocaleListener.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@
 block discarded – undo
33 33
      */
34 34
     public function onKernelRequest(GetResponseEvent $event)
35 35
     {
36
-        if (HttpKernel::MASTER_REQUEST != $event->getRequestType())
37
-            return;
36
+        if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
37
+                    return;
38
+        }
38 39
 
39 40
         $this->registerLDAP();
40 41
         $this->registerCapsule();
Please login to merge, or discard this patch.
src/Controller/AdminController.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
             $res = [];
39 39
 
40 40
             foreach($students as $student) {
41
-                if ($student['uid'][0] != null)
42
-                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
41
+                if ($student['uid'][0] != null) {
42
+                                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
43
+                }
43 44
             }
44 45
 
45 46
             return $this->json($res);
@@ -73,8 +74,9 @@  discard block
 block discarded – undo
73 74
         ]);
74 75
 
75 76
         foreach (json_decode($enrollments->getBody()->getContents()) as $enrollment) {
76
-            if ($enrollment->class->title != null)
77
-                array_push($classes, $enrollment->class);
77
+            if ($enrollment->class->title != null) {
78
+                            array_push($classes, $enrollment->class);
79
+            }
78 80
         }
79 81
 
80 82
         return $this->render('admin/user.twig',[
Please login to merge, or discard this patch.