@@ -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 | }); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // Set Twig engine for templating |
| 109 | -$container->set('view', static function () { |
|
| 109 | +$container->set('view', static function() { |
|
| 110 | 110 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
| 111 | 111 | $tpls = [ |
| 112 | 112 | __DIR__ . '/../resources/views/', |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | }); |
| 132 | 132 | |
| 133 | 133 | //Set Session engine |
| 134 | -$container->set('session', static function () { |
|
| 134 | +$container->set('session', static function() { |
|
| 135 | 135 | return new Helper(); |
| 136 | 136 | }); |
| 137 | 137 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $app->post('/login', HomeController::class . ':loginPost')->setName('login-post'); |
| 189 | 189 | |
| 190 | 190 | // Admin routes |
| 191 | -$app->group('/admin', static function (RouteCollectorProxy $group): void { |
|
| 191 | +$app->group('/admin', static function(RouteCollectorProxy $group): void { |
|
| 192 | 192 | $group->get('', AdminController::class . ':adminIndex')->setName('admin'); |
| 193 | 193 | |
| 194 | 194 | $group->get('/settings', AdminController::class . ':adminSettings')->setName('admin-settings'); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | if ($charPos !== false) { |
| 218 | 218 | $route = substr($page, 0, $charPos); |
| 219 | 219 | |
| 220 | - $app->get('/pages/{route}', function (string $route, Response $response, Container $container): Response { |
|
| 220 | + $app->get('/pages/{route}', function(string $route, Response $response, Container $container): Response { |
|
| 221 | 221 | $settings = $container->get('settings'); |
| 222 | 222 | return $container->get('view')->render($response, $route . '.html', [ |
| 223 | 223 | 'settings' => $settings, |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | $file = $this->app->get('blogfile'); |
| 143 | 143 | $data = json_decode(file_get_contents($file), true); |
| 144 | 144 | |
| 145 | - uasort($data, function ($a, $b) { |
|
| 145 | + uasort($data, function($a, $b) { |
|
| 146 | 146 | if (strpos($a['body'], 'cross post') === false) { |
| 147 | 147 | $a = count($a['active_votes']); |
| 148 | 148 | $b = count($b['active_votes']); |