@@ -16,30 +16,30 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | return [ |
| 18 | 18 | 'shared' => [ |
| 19 | - 'request' => function () { |
|
| 19 | + 'request' => function() { |
|
| 20 | 20 | return ServerRequestFactory::fromGlobals(); |
| 21 | 21 | }, |
| 22 | - 'request.original' => function () { |
|
| 22 | + 'request.original' => function() { |
|
| 23 | 23 | return ServerRequestFactory::fromGlobals(); |
| 24 | 24 | }, |
| 25 | - 'base_url' => function () { |
|
| 25 | + 'base_url' => function() { |
|
| 26 | 26 | return rtrim($this->config( |
| 27 | 27 | 'base_url', |
| 28 | 28 | $this->get('request')->getUri()->withPath('/')->__toString() |
| 29 | 29 | ), '/'); |
| 30 | 30 | }, |
| 31 | - 'router' => function () { |
|
| 31 | + 'router' => function() { |
|
| 32 | 32 | return new RouteCollector(); |
| 33 | 33 | }, |
| 34 | - 'templates' => function () { |
|
| 34 | + 'templates' => function() { |
|
| 35 | 35 | return new Plates(realpath(__DIR__ . '/../resources/views')); |
| 36 | 36 | }, |
| 37 | 37 | ], |
| 38 | 38 | 'not_shared' => [ |
| 39 | - 'response' => function ($code = 200) { |
|
| 39 | + 'response' => function($code = 200) { |
|
| 40 | 40 | return MiddlewaresFactory::createResponse($code); |
| 41 | 41 | }, |
| 42 | - 'response.emitter' => function (ResponseInterface $response = null) { |
|
| 42 | + 'response.emitter' => function(ResponseInterface $response = null) { |
|
| 43 | 43 | $emitter = new SapiEmitter; |
| 44 | 44 | if (is_null($response)) { |
| 45 | 45 | return $emitter; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | return $emitter->emit($response); |
| 49 | 49 | }, |
| 50 | - 'middleware.dispatcher' => function (ServerRequestInterface $request = null) { |
|
| 50 | + 'middleware.dispatcher' => function(ServerRequestInterface $request = null) { |
|
| 51 | 51 | $dispatcher = (new Dispatcher($this->getMiddlewares())); |
| 52 | 52 | if (is_null($request)) { |
| 53 | 53 | return $dispatcher; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | return $dispatcher->dispatch($request); |
| 57 | 57 | }, |
| 58 | - 'markdown.page' => function ($filename, array $data = [], $view = 'markdown') { |
|
| 58 | + 'markdown.page' => function($filename, array $data = [], $view = 'markdown') { |
|
| 59 | 59 | $parser = new MarkdownFileParser(); |
| 60 | 60 | $markdown = $parser->parse($filename, $this->config('markdown')); |
| 61 | 61 | $metadata = $markdown->metadata ?: []; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | return $this->get('templates')->render($view, $data); |
| 72 | 72 | }, |
| 73 | - 'markdown.files' => function ($path = null, $recursive = true) { |
|
| 73 | + 'markdown.files' => function($path = null, $recursive = true) { |
|
| 74 | 74 | return MarkdownFile::getList($path ?: $this->config('content_path'), $recursive); |
| 75 | 75 | }, |
| 76 | 76 | ], |