@@ -208,10 +208,10 @@ |
||
| 208 | 208 | |
| 209 | 209 | foreach ($data as $key => $value) { |
| 210 | 210 | if ($value === "true") { |
| 211 | - $value = (bool) true; |
|
| 211 | + $value = (bool)true; |
|
| 212 | 212 | } |
| 213 | 213 | if ($value === "false") { |
| 214 | - $value = (bool) false; |
|
| 214 | + $value = (bool)false; |
|
| 215 | 215 | } |
| 216 | 216 | if (mb_strpos($key, "-") !== false) { |
| 217 | 217 | $pieces = explode("-", $key); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Set settings array in container for use in all routes |
| 53 | -$container->set('settings', static function () { |
|
| 53 | +$container->set('settings', static function() { |
|
| 54 | 54 | $config = file_get_contents(__DIR__ . '/../config/config.json'); |
| 55 | 55 | return json_decode($config, true); |
| 56 | 56 | }); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | //AppFactory::setContainer($container); |
| 109 | 109 | |
| 110 | 110 | // Set Twig engine for templating |
| 111 | -$container->set('view', static function () { |
|
| 111 | +$container->set('view', static function() { |
|
| 112 | 112 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
| 113 | 113 | $tpls = [ |
| 114 | 114 | __DIR__ . '/../resources/views/', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | }); |
| 134 | 134 | |
| 135 | 135 | //Set Session engine |
| 136 | -$container->set('session', static function () { |
|
| 136 | +$container->set('session', static function() { |
|
| 137 | 137 | return new Helper(); |
| 138 | 138 | }); |
| 139 | 139 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $app->post('/login', HomeController::class . ':loginPost')->setName('login-post'); |
| 191 | 191 | |
| 192 | 192 | // Admin routes |
| 193 | -$app->group('/admin', static function (RouteCollectorProxy $group): void { |
|
| 193 | +$app->group('/admin', static function(RouteCollectorProxy $group): void { |
|
| 194 | 194 | $group->get('', AdminController::class . ':adminIndex')->setName('admin'); |
| 195 | 195 | |
| 196 | 196 | $group->get('/settings', AdminController::class . ':adminSettings')->setName('admin-settings'); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | foreach ($pages as $page) { |
| 218 | 218 | $route = substr($page, 0, strrpos($page, '.')); |
| 219 | 219 | |
| 220 | - $app->get('/pages/{route}', function (string $route, $response, Container $container) { |
|
| 220 | + $app->get('/pages/{route}', function(string $route, $response, Container $container) { |
|
| 221 | 221 | $settings = $container->get('settings'); |
| 222 | 222 | return $container->get('view')->render($response, $route . '.html', [ |
| 223 | 223 | 'settings' => $settings, |