| @@ -21,7 +21,7 @@ discard block | ||
| 21 | 21 | $container = $app->getContainer(); | 
| 22 | 22 | |
| 23 | 23 | // TWIG view renderer | 
| 24 | -$container['view'] = function ($c) { | |
| 24 | +$container['view'] = function($c) { | |
| 25 | 25 |      $settings = $c->get('settings')['renderer']; | 
| 26 | 26 | $view = new Twig($settings['template_path'], [ | 
| 27 | 27 | 'cache' => false, // or 'path/to/cache' | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | $env = $view->getEnvironment(); | 
| 47 | 47 |      $env->addGlobal('site', new Site()); | 
| 48 | 48 |      $env->addGlobal('currenturl', $c->get('request')->getUri()); | 
| 49 | -    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath().'/'.$c->get('request')->getUri()->getPath()); | |
| 49 | +    $env->addGlobal('currentpath', $c->get('request')->getUri()->getBasePath() . '/' . $c->get('request')->getUri()->getPath()); | |
| 50 | 50 | |
| 51 | 51 |      if (isset($_SESSION['userId'])) { | 
| 52 | 52 | $u = UserQuery::create()->findPk($_SESSION['userId']); | 
| @@ -59,7 +59,7 @@ discard block | ||
| 59 | 59 | }; | 
| 60 | 60 | |
| 61 | 61 | // monolog | 
| 62 | -$container['logger'] = function ($c) { | |
| 62 | +$container['logger'] = function($c) { | |
| 63 | 63 |      $settings = $c->get('settings')['logger']; | 
| 64 | 64 | $logger = new Monolog\Logger($settings['name']); | 
| 65 | 65 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); | 
| @@ -68,7 +68,7 @@ discard block | ||
| 68 | 68 | return $logger; | 
| 69 | 69 | }; | 
| 70 | 70 | |
| 71 | -$container['auth'] = function ($c) { | |
| 71 | +$container['auth'] = function($c) { | |
| 72 | 72 | $authConfig = getConfig()['auth']; | 
| 73 | 73 | |
| 74 | 74 | // full domain e.g. https://example.com | 
| @@ -86,7 +86,7 @@ discard block | ||
| 86 | 86 | break; | 
| 87 | 87 | |
| 88 | 88 | case 'onebody': | 
| 89 | - $url = $authConfig['onebody']['url'].'/'; | |
| 89 | + $url = $authConfig['onebody']['url'] . '/'; | |
| 90 | 90 | $email = new EmailAddress($authConfig['onebody']['email']); | 
| 91 | 91 | $apiKey = $authConfig['onebody']['apiKey']; | 
| 92 | 92 | |
| @@ -116,6 +116,6 @@ discard block | ||
| 116 | 116 | return new Authentication($c, $authProvider, $allowedRoutes); | 
| 117 | 117 | }; | 
| 118 | 118 | |
| 119 | -$container['csrf'] = function ($c) { | |
| 119 | +$container['csrf'] = function($c) { | |
| 120 | 120 | return new Guard(); | 
| 121 | 121 | }; | 
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | // Application middleware | 
| 9 | 9 | |
| 10 | 10 | // 4) add route information to twig | 
| 11 | -$app->add(function (Request $request, Response $response, callable $next) { | |
| 11 | +$app->add(function(Request $request, Response $response, callable $next) { | |
| 12 | 12 |      $route = $request->getAttribute('route'); | 
| 13 | 13 | |
| 14 | 14 | // return NotFound for non existent route |