Passed
Push — master ( bf6742...9af6e7 )
by Xavier
03:12
created
src/Security/Resources/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@
 block discarded – undo
4 4
 use Security\Resources\Middleware\AuthMiddleware;
5 5
 
6 6
 
7
-$app->group('', function ()  {
7
+$app->group('', function() {
8 8
     $this->get('/login', 'AuthController:login')->setName('login');
9 9
 })->add(new GuestMiddleware($container));
10 10
 
11
-$app->group('', function () {
11
+$app->group('', function() {
12 12
         $this->get('/logout', 'AuthController:logout')->setName('logout');
13 13
 })->add(new AuthMiddleware($container));
14 14
 
Please login to merge, or discard this patch.
src/Security/Resources/Middleware/AdminMiddleware.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
      */
21 21
     public function __invoke(Request $request, Response $response, callable $next)
22 22
     {
23
-       if (isset($_SESSION['phpCAS']['user']))  {
23
+       if (isset($_SESSION['phpCAS']['user'])) {
24 24
             if (in_array($_SESSION['phpCAS']['user'], $this->container['parameters']['administrators']))
25 25
                 return $next($request, $response);
26 26
        }
Please login to merge, or discard this patch.
src/Admin/Resources/routes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 use App\Resources\Middleware\CountryMiddleware;
4 4
 use \Security\Resources\Middleware\AdminMiddleware;
5 5
 
6
-$app->group('/{country:[a-z]{2}}', function () use ($container) {
6
+$app->group('/{country:[a-z]{2}}', function() use ($container) {
7 7
 
8
-    $this->group('/tools', function () use ($container) {
8
+    $this->group('/tools', function() use ($container) {
9 9
         $this->map(['GET', 'POST'], '/find-student', 'AdminController:findStudent')->setName('find-student');
10 10
     })->add(new AdminMiddleware($container));
11 11
 
Please login to merge, or discard this patch.
src/App/Controller/Controller.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,15 +69,15 @@
 block discarded – undo
69 69
      */
70 70
     public function createJWT()
71 71
     {
72
-        return json_decode( $this->http->request('POST', 'auth/login', [
73
-            'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' ],
72
+        return json_decode($this->http->request('POST', 'auth/login', [
73
+            'headers' => ['X-Requested-With' => 'XMLHttpRequest'],
74 74
             'json' => [
75 75
                 'username' => $this->parameters['api']['username'],
76 76
                 'password' => $this->parameters['api']['password']
77 77
             ]
78 78
         ])
79 79
             ->getBody()
80
-            ->getContents() );
80
+            ->getContents());
81 81
     }
82 82
 
83 83
 
Please login to merge, or discard this patch.
src/App/Resources/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 $app->get('/', 'AppController:redirectHome')->setName('wrong-entry');
6 6
 
7
-$app->group('/{country:[a-z]{2}}', function () {
7
+$app->group('/{country:[a-z]{2}}', function() {
8 8
     $this->get('', 'AppController:home')->setName('home');
9 9
     $this->get('/users/{id}', 'UserController:user')->setName('user-profile');
10 10
 })->add(new CountryMiddleware($container));
Please login to merge, or discard this patch.
src/Admin/Controller/AdminController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@
 block discarded – undo
27 27
             $students = $this->ldap($filter, ['displayname', 'uid']);
28 28
             $res = [];
29 29
 
30
-            foreach($students as $student) {
30
+            foreach ($students as $student) {
31 31
                 if ($student['uid'][0] != null)
32
-                    $res += [ $student['uid'][0] => $student['displayname'][0] ];
32
+                    $res += [$student['uid'][0] => $student['displayname'][0]];
33 33
             }
34 34
 
35 35
             return $this->json($response, $res);
Please login to merge, or discard this patch.
src/App/Controller/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
                 array_push($classes, $enrollment->class);
32 32
         }
33 33
 
34
-        return $this->view->render($response, 'App/user.twig',[
34
+        return $this->view->render($response, 'App/user.twig', [
35 35
             'classes' => $classes,
36 36
             'student_name' => $this->ldapFirst("uid=$id")['displayname'][0]
37
-        ] );
37
+        ]);
38 38
 
39 39
     }
40 40
 
Please login to merge, or discard this patch.
src/App/Controller/AppController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 
31 31
         if (isset($_COOKIE['country']) && $this->checkCountry($_COOKIE['country'])) { // First if the client has a preference
32 32
             $country_id = $_COOKIE['country'];
33
-        }else if ($this->checkCountry($clientLanguage)) { // Not a preference? Let's check its browser!
33
+        } else if ($this->checkCountry($clientLanguage)) { // Not a preference? Let's check its browser!
34 34
             $country_id = $clientLanguage;
35 35
         } else {  // Nevermind let's move to the french language
36 36
             $country_id = 'fr';
Please login to merge, or discard this patch.
src/Security/Controller/AuthController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function login(Request $request, Response $response)
22 22
     {
23
-        phpCAS::client(CAS_VERSION_2_0,'auth.univ-lorraine.fr',443,'');
23
+        phpCAS::client(CAS_VERSION_2_0, 'auth.univ-lorraine.fr', 443, '');
24 24
         phpCAS::setNoCasServerValidation();
25 25
         phpCAS::forceAuthentication();
26 26
         phpCAS::getUser();
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function logout(Request $request, Response $response)
33 33
     {
34
-        phpCAS::client(CAS_VERSION_2_0,'auth.univ-lorraine.fr',443,'');
34
+        phpCAS::client(CAS_VERSION_2_0, 'auth.univ-lorraine.fr', 443, '');
35 35
         phpCAS::logout();
36 36
     }
37 37
 }
Please login to merge, or discard this patch.