Passed
Push — master ( fa5d84...f9465d )
by Florent
02:32
created
src/start.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 $container->set('themesdir', __DIR__ . '/../public/themes/');
41 41
 
42 42
 // Set settings array in container for use in all routes
43
-$container->set('settings', function () {
43
+$container->set('settings', function() {
44 44
     $config = file_get_contents(__DIR__ . '/../config/config.json');
45 45
     $settings = json_decode($config, true);
46 46
     return $settings;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     mkdir($container->get('cachedir'), 0755, true);
76 76
 } else {
77 77
     // Flush Cache folder if disabled
78
-    if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true )) {
78
+    if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true)) {
79 79
         $path = $container->get('cachedir');
80 80
         
81 81
         $files = new RecursiveIteratorIterator(
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 AppFactory::setContainer($container);
100 100
 
101 101
 // Set Twig engine for templating
102
-$container->set('view', function () {
102
+$container->set('view', function() {
103 103
     $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true);
104 104
     $tpls = [
105 105
         __DIR__ . "/../resources/views/",
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 });
128 128
 
129 129
 //Set Session engine
130
-$container->set('session', function () {
130
+$container->set('session', function() {
131 131
     return new \SlimSession\Helper();
132 132
 });
133 133
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 // Admin routes
180 180
 $app->get('/login', HomeController::class . ":login")->setName('login');
181 181
 $app->post('/login', HomeController::class . ":loginPost")->setName('login-post');
182
-$app->group('/admin', function (RouteCollectorProxy $group) {
182
+$app->group('/admin', function(RouteCollectorProxy $group) {
183 183
     $group->get('', AdminController::class . ":adminIndex")->setName('admin');
184 184
     $group->get('/social', AdminController::class . ":adminSocial")->setName('admin-social');
185 185
     $group->get('/wallet', WalletController::class . ":viewWallet")->setName('admin-wallet');
@@ -196,12 +196,12 @@  discard block
 block discarded – undo
196 196
 });
197 197
 
198 198
 // generate routes from static pages
199
-$app->group('/pages/', function (RouteCollectorProxy $group) {
199
+$app->group('/pages/', function(RouteCollectorProxy $group) {
200 200
     $pagesDir = $this->get('pagesdir');
201 201
     $pages = preg_grep('~\.(html)$~', scandir($pagesDir));
202 202
     foreach ($pages as $page) {
203 203
         $route = substr($page, 0, strrpos($page, "."));
204
-        $group->get('' . $route, function ($request, $response) {
204
+        $group->get('' . $route, function($request, $response) {
205 205
             $settings = $this->get('settings');
206 206
             $uri = $request->getUri();
207 207
             $route = substr(strrchr($uri, "/"), 1);
Please login to merge, or discard this patch.