Passed
Push — master ( b690c3...d5460a )
by Florent
12:12
created
src/start.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $container->set('themesdir', __DIR__ . '/../public/themes/');
43 43
 
44 44
 // Set settings array in container for use in all routes
45
-$container->set('settings', function () {
45
+$container->set('settings', function() {
46 46
     $config = file_get_contents(__DIR__ . '/../config/config.json');
47 47
     $settings = json_decode($config, true);
48 48
     return $settings;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     mkdir($container->get('cachedir'), 0755, true);
84 84
 } else {
85 85
     // Flush Cache folder if disabled
86
-    if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true )) {
86
+    if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true)) {
87 87
         $path = $container->get('cachedir');
88 88
         
89 89
         $files = new RecursiveIteratorIterator(
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 AppFactory::setContainer($container);
108 108
 
109 109
 // Set Twig engine for templating
110
-$container->set('view', function () {
110
+$container->set('view', function() {
111 111
     $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true);
112 112
     $tpls = [
113 113
         __DIR__ . "/../resources/views/",
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 });
136 136
 
137 137
 //Set Session engine
138
-$container->set('session', function () {
138
+$container->set('session', function() {
139 139
     return new \SlimSession\Helper();
140 140
 });
141 141
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 // Admin routes
190 190
 $app->get('/login', HomeController::class . ":login")->setName('login');
191 191
 $app->post('/login', HomeController::class . ":loginPost")->setName('login-post');
192
-$app->group('/admin', function (RouteCollectorProxy $group) {
192
+$app->group('/admin', function(RouteCollectorProxy $group) {
193 193
     $group->get('', AdminController::class . ":adminIndex")->setName('admin');
194 194
     $group->get('/social', AdminController::class . ":adminSocial")->setName('admin-social');
195 195
     $group->get('/settings', AdminController::class . ":adminSettings")->setName('admin-settings');
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
 });
208 208
 
209 209
 // generate routes from static pages
210
-$app->group('/pages/', function (RouteCollectorProxy $group) {
210
+$app->group('/pages/', function(RouteCollectorProxy $group) {
211 211
     $pagesDir = $this->get('pagesdir');
212 212
     $pages = preg_grep('~\.(html)$~', scandir($pagesDir));
213 213
     foreach ($pages as $page) {
214 214
         $route = substr($page, 0, strrpos($page, "."));
215
-        $group->get('' . $route, function ($request, $response) {
215
+        $group->get('' . $route, function($request, $response) {
216 216
             $settings = $this->get('settings');
217 217
             $uri = $request->getUri();
218 218
             $route = substr(strrchr($uri, "/"), 1);
Please login to merge, or discard this patch.