@@ -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); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Set settings array in container for use in all routes |
| 54 | -$container->set('settings', static function () : array { |
|
| 54 | +$container->set('settings', static function() : array { |
|
| 55 | 55 | $config = file_get_contents(__DIR__ . '/../config/config.json'); |
| 56 | 56 | return json_decode($config, true); |
| 57 | 57 | }); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | //AppFactory::setContainer($container); |
| 110 | 110 | |
| 111 | 111 | // Set Twig engine for templating |
| 112 | -$container->set('view', static function () { |
|
| 112 | +$container->set('view', static function() { |
|
| 113 | 113 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
| 114 | 114 | $tpls = [ |
| 115 | 115 | __DIR__ . '/../resources/views/', |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | }); |
| 135 | 135 | |
| 136 | 136 | //Set Session engine |
| 137 | -$container->set('session', static function () { |
|
| 137 | +$container->set('session', static function() { |
|
| 138 | 138 | return new Helper(); |
| 139 | 139 | }); |
| 140 | 140 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $app->post('/login', HomeController::class . ':loginPost')->setName('login-post'); |
| 192 | 192 | |
| 193 | 193 | // Admin routes |
| 194 | -$app->group('/admin', static function (RouteCollectorProxy $group): void { |
|
| 194 | +$app->group('/admin', static function(RouteCollectorProxy $group): void { |
|
| 195 | 195 | $group->get('', AdminController::class . ':adminIndex')->setName('admin'); |
| 196 | 196 | |
| 197 | 197 | $group->get('/settings', AdminController::class . ':adminSettings')->setName('admin-settings'); |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | if ($charPos !== false) { |
| 221 | 221 | $route = substr($page, 0, $charPos); |
| 222 | 222 | |
| 223 | - $app->get('/pages/{route}', function (string $route, Response $response, Container $container) : Response { |
|
| 223 | + $app->get('/pages/{route}', function(string $route, Response $response, Container $container) : Response { |
|
| 224 | 224 | $settings = $container->get('settings'); |
| 225 | 225 | return $container->get('view')->render($response, $route . '.html', [ |
| 226 | 226 | 'settings' => $settings, |