@@ -4,7 +4,7 @@ |
||
| 4 | 4 | <p><b>INDEX</b></p> |
| 5 | 5 | <?php |
| 6 | 6 | |
| 7 | -$print_list = function (array $files, $self) use ($base_url) { |
|
| 7 | +$print_list = function(array $files, $self) use ($base_url) { |
|
| 8 | 8 | echo '<ul>'; |
| 9 | 9 | foreach ($files as $k => $file) { |
| 10 | 10 | echo '<li>'; |
@@ -11,6 +11,9 @@ |
||
| 11 | 11 | echo $e->getMessage() . '<br>'; |
| 12 | 12 | $e = $e->getPrevious(); |
| 13 | 13 | endwhile; |
| 14 | - else: ?>Internal Server Error |
|
| 15 | - <?php endif; ?> |
|
| 14 | + else { |
|
| 15 | + : ?>Internal Server Error |
|
| 16 | + <?php endif; |
|
| 17 | + } |
|
| 18 | + ?> |
|
| 16 | 19 | </blockquote> |
| 17 | 20 | \ No newline at end of file |
@@ -16,26 +16,26 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | return [ |
| 18 | 18 | 'shared' => [ |
| 19 | - 'request' => function () { |
|
| 19 | + 'request' => function() { |
|
| 20 | 20 | return ServerRequestFactory::fromGlobals(); |
| 21 | 21 | }, |
| 22 | - 'base_url' => function () { |
|
| 22 | + 'base_url' => function() { |
|
| 23 | 23 | return rtrim($this->config('base_url', |
| 24 | 24 | $this->get('request')->getUri()->withPath('/')->__toString() |
| 25 | 25 | ), '/'); |
| 26 | 26 | }, |
| 27 | - 'router' => function () { |
|
| 27 | + 'router' => function() { |
|
| 28 | 28 | return new RouteCollector(); |
| 29 | 29 | }, |
| 30 | - 'templates' => function () { |
|
| 30 | + 'templates' => function() { |
|
| 31 | 31 | return new Plates(realpath(__DIR__ . '/../resources/views')); |
| 32 | 32 | }, |
| 33 | 33 | ], |
| 34 | 34 | 'not_shared' => [ |
| 35 | - 'response' => function ($code = 200) { |
|
| 35 | + 'response' => function($code = 200) { |
|
| 36 | 36 | return MiddlewaresFactory::createResponse($code); |
| 37 | 37 | }, |
| 38 | - 'response.emitter' => function (ResponseInterface $response = null) { |
|
| 38 | + 'response.emitter' => function(ResponseInterface $response = null) { |
|
| 39 | 39 | $emitter = new SapiEmitter; |
| 40 | 40 | if (is_null($response)) { |
| 41 | 41 | return $emitter; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | return $emitter->emit($response); |
| 45 | 45 | }, |
| 46 | - 'middleware.dispatcher' => function (ServerRequestInterface $request = null) { |
|
| 46 | + 'middleware.dispatcher' => function(ServerRequestInterface $request = null) { |
|
| 47 | 47 | $dispatcher = (new Dispatcher($this->getMiddlewares())); |
| 48 | 48 | if (is_null($request)) { |
| 49 | 49 | return $dispatcher; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | return $dispatcher->dispatch($request); |
| 53 | 53 | }, |
| 54 | - 'markdown.page' => function ($filename, array $data = [], $view = 'markdown') { |
|
| 54 | + 'markdown.page' => function($filename, array $data = [], $view = 'markdown') { |
|
| 55 | 55 | $parser = new MarkdownFileParser(); |
| 56 | 56 | $markdown = $parser->parse($filename, $this->config('markdown')); |
| 57 | 57 | $metadata = $markdown->metadata ?: []; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | return $this->get('templates')->render($view, $data); |
| 68 | 68 | }, |
| 69 | - 'markdown.files' => function ($path = null, $recursive = true) { |
|
| 69 | + 'markdown.files' => function($path = null, $recursive = true) { |
|
| 70 | 70 | return MarkdownFile::getList($path ?: $this->config('content_path'), $recursive); |
| 71 | 71 | }, |
| 72 | 72 | ], |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | // Create App |
| 16 | 16 | $app = new Application($config); |
| 17 | -$register = function () { |
|
| 17 | +$register = function() { |
|
| 18 | 18 | /** @var Application $this */ |
| 19 | 19 | $config = $this->config(); |
| 20 | 20 | |