Passed
Branch master (b6469e)
by Xavier
07:21 queued 05:06
created
public/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
 use Symfony\Component\Dotenv\Dotenv;
6 6
 use Symfony\Component\HttpFoundation\Request;
7 7
 
8
-require __DIR__.'/../vendor/autoload.php';
8
+require __DIR__ . '/../vendor/autoload.php';
9 9
 
10 10
 session_start();
11 11
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     if (!class_exists(Dotenv::class)) {
15 15
         throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
16 16
     }
17
-    (new Dotenv())->load(__DIR__.'/../.env');
17
+    (new Dotenv())->load(__DIR__ . '/../.env');
18 18
 }
19 19
 
20 20
 if ($_SERVER['APP_DEBUG'] ?? ('prod' !== ($_SERVER['APP_ENV'] ?? 'dev'))) {
Please login to merge, or discard this patch.
src/Kernel.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@  discard block
 block discarded – undo
16 16
 
17 17
     public function getCacheDir()
18 18
     {
19
-        return $this->getProjectDir().'/var/cache/'.$this->environment;
19
+        return $this->getProjectDir() . '/var/cache/' . $this->environment;
20 20
     }
21 21
 
22 22
     public function getLogDir()
23 23
     {
24
-        return $this->getProjectDir().'/var/log';
24
+        return $this->getProjectDir() . '/var/log';
25 25
     }
26 26
 
27 27
     public function registerBundles()
28 28
     {
29
-        $contents = require $this->getProjectDir().'/config/bundles.php';
29
+        $contents = require $this->getProjectDir() . '/config/bundles.php';
30 30
         foreach ($contents as $class => $envs) {
31 31
             if (isset($envs['all']) || isset($envs[$this->environment])) {
32 32
                 yield new $class();
@@ -38,24 +38,24 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $container->setParameter('container.autowiring.strict_mode', true);
40 40
         $container->setParameter('container.dumper.inline_class_loader', true);
41
-        $confDir = $this->getProjectDir().'/config';
42
-        $loader->load($confDir.'/packages/*'.self::CONFIG_EXTS, 'glob');
43
-        if (is_dir($confDir.'/packages/'.$this->environment)) {
44
-            $loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
41
+        $confDir = $this->getProjectDir() . '/config';
42
+        $loader->load($confDir . '/packages/*' . self::CONFIG_EXTS, 'glob');
43
+        if (is_dir($confDir . '/packages/' . $this->environment)) {
44
+            $loader->load($confDir . '/packages/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob');
45 45
         }
46
-        $loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');
47
-        $loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');
46
+        $loader->load($confDir . '/services' . self::CONFIG_EXTS, 'glob');
47
+        $loader->load($confDir . '/services_' . $this->environment . self::CONFIG_EXTS, 'glob');
48 48
     }
49 49
 
50 50
     protected function configureRoutes(RouteCollectionBuilder $routes)
51 51
     {
52
-        $confDir = $this->getProjectDir().'/config';
53
-        if (is_dir($confDir.'/routes/')) {
54
-            $routes->import($confDir.'/routes/*'.self::CONFIG_EXTS, '/', 'glob');
52
+        $confDir = $this->getProjectDir() . '/config';
53
+        if (is_dir($confDir . '/routes/')) {
54
+            $routes->import($confDir . '/routes/*' . self::CONFIG_EXTS, '/', 'glob');
55 55
         }
56
-        if (is_dir($confDir.'/routes/'.$this->environment)) {
57
-            $routes->import($confDir.'/routes/'.$this->environment.'/**/*'.self::CONFIG_EXTS, '/', 'glob');
56
+        if (is_dir($confDir . '/routes/' . $this->environment)) {
57
+            $routes->import($confDir . '/routes/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob');
58 58
         }
59
-        $routes->import($confDir.'/routes'.self::CONFIG_EXTS, '/', 'glob');
59
+        $routes->import($confDir . '/routes' . self::CONFIG_EXTS, '/', 'glob');
60 60
     }
61 61
 }
Please login to merge, or discard this patch.
src/TwigExtension/TranslatorExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
     {
86 86
        $languages = [];
87 87
        foreach ($this->container->getParameter('dictionaries') as $languageId => $dictionary) {
88
-           $languages += [ $dictionary['self_name'] => $languageId ];
88
+           $languages += [$dictionary['self_name'] => $languageId];
89 89
        }
90 90
         return $languages;
91 91
     }
Please login to merge, or discard this patch.
src/Event/AdminSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
43 43
 
44 44
     public static function getSubscribedEvents()
45 45
     {
46
-        return [ KernelEvents::CONTROLLER => 'onKernelController' ];
46
+        return [KernelEvents::CONTROLLER => 'onKernelController'];
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
src/Event/LocaleListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,6 +58,6 @@
 block discarded – undo
58 58
 
59 59
     public static function getSubscribedEvents()
60 60
     {
61
-        return [ KernelEvents::REQUEST => [['onKernelRequest', 200]] ];
61
+        return [KernelEvents::REQUEST => [['onKernelRequest', 200]]];
62 62
     }
63 63
 }
64 64
\ No newline at end of file
Please login to merge, or discard this patch.
src/Controller/AbstractController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,8 @@
 block discarded – undo
41 41
       */
42 42
     public static function generateJwt()
43 43
     {
44
-        $_SESSION['JWT'] = json_decode( self::$http->request('POST', 'api/auth/login', [
45
-            'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' ],
44
+        $_SESSION['JWT'] = json_decode(self::$http->request('POST', 'api/auth/login', [
45
+            'headers' => ['X-Requested-With' => 'XMLHttpRequest'],
46 46
             'json' => [
47 47
                 'username' => env('API_USERNAME'),
48 48
                 'password' => env('API_PASSWORD')
Please login to merge, or discard this patch.
src/Model/API/ApiModel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
      */
61 61
     public function post(String $route, array $args) // ToDo : add JWT
62 62
     {
63
-       return json_decode( self::$http->request('POST', $route, [
64
-           'headers' => [ 'X-Requested-With' => 'XMLHttpRequest' ],
63
+       return json_decode(self::$http->request('POST', $route, [
64
+           'headers' => ['X-Requested-With' => 'XMLHttpRequest'],
65 65
            'json' => $args
66 66
        ])->getBody()->getContents());
67 67
     }
Please login to merge, or discard this patch.
src/Event/StudentSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
43 43
 
44 44
     public static function getSubscribedEvents()
45 45
     {
46
-        return [ KernelEvents::CONTROLLER => 'onKernelController' ];
46
+        return [KernelEvents::CONTROLLER => 'onKernelController'];
47 47
     }
48 48
 }
49 49
\ No newline at end of file
Please login to merge, or discard this patch.
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.