Passed
Branch master (c0a5de)
by Xavier
03:15 queued 01:29
created
src/Security/Resources/Middleware/AdminMiddleware.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@
 block discarded – undo
21 21
     public function __invoke(Request $request, Response $response, callable $next)
22 22
     {
23 23
        if (isset($_SESSION['phpCAS']['user']))  {
24
-            if (in_array($_SESSION['phpCAS']['user'], $this->container['parameters']['administrators']))
25
-                return $next($request, $response);
24
+            if (in_array($_SESSION['phpCAS']['user'], $this->container['parameters']['administrators'])) {
25
+                            return $next($request, $response);
26
+            }
26 27
        }
27 28
 
28 29
        $this->flash->addMessage('error', '<i class="minus circle icon"></i> You are not allowed to access to this content.');
Please login to merge, or discard this patch.
src/Admin/Controller/AdminController.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
             $res = [];
35 35
             foreach($students as $student) {
36
-                if ($student['uid'][0] != null)
37
-                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
36
+                if ($student['uid'][0] != null) {
37
+                                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
38
+                }
38 39
             }
39 40
 
40 41
             return $this->json($response, $res);
Please login to merge, or discard this patch.
src/App/Controller/UserController.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@
 block discarded – undo
27 27
         ]);
28 28
 
29 29
         foreach (json_decode($enrollments->getBody()->getContents()) as $enrollment) {
30
-            if ($enrollment->class->title != null)
31
-                array_push($classes, $enrollment->class);
30
+            if ($enrollment->class->title != null) {
31
+                            array_push($classes, $enrollment->class);
32
+            }
32 33
         }
33 34
 
34 35
         return $this->view->render($response, 'App/user.twig',[
Please login to merge, or discard this patch.
src/App/Resources/Middleware/CountryMiddleware.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,9 @@
 block discarded – undo
17 17
         $country_id = $request->getAttribute('routeInfo')[2]['country'];
18 18
 
19 19
         // Useful when a client edits the URL and types a language that does not exist.
20
-        if (!$this->checkCountry($country_id))
21
-            return $response->withRedirect($this->router->pathFor('wrong-entry'));
20
+        if (!$this->checkCountry($country_id)) {
21
+                    return $response->withRedirect($this->router->pathFor('wrong-entry'));
22
+        }
22 23
 
23 24
         setcookie('country', $country_id, time() + (30 * 24 * 60 * 60)); // 30 days
24 25
 
Please login to merge, or discard this patch.