@@ -44,7 +44,8 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | private function staticPageViewAction(StaticPageView $pageView, Compiler $compiler) |
| 46 | 46 | { |
| 47 | - return function () use ($pageView, $compiler) { |
|
| 47 | + return function () use ($pageView, $compiler) |
|
| 48 | + { |
|
| 48 | 49 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
| 49 | 50 | |
| 50 | 51 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -74,7 +75,8 @@ discard block |
||
| 74 | 75 | */ |
| 75 | 76 | private function dynamicPageViewAction(DynamicPageView $pageView, Compiler $compiler) |
| 76 | 77 | { |
| 77 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
| 78 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
| 79 | + { |
|
| 78 | 80 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
| 79 | 81 | |
| 80 | 82 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -110,7 +112,8 @@ discard block |
||
| 110 | 112 | */ |
| 111 | 113 | private function repeaterPageViewAction(RepeaterPageView $pageView, Compiler $compiler) |
| 112 | 114 | { |
| 113 | - return function (ServerRequestInterface $request) use ($pageView, $compiler) { |
|
| 115 | + return function (ServerRequestInterface $request) use ($pageView, $compiler) |
|
| 116 | + { |
|
| 114 | 117 | Service::setOption('currentTemplate', $pageView->getAbsoluteFilePath()); |
| 115 | 118 | |
| 116 | 119 | $compiler->getTemplateBridge()->clearTemplateCache(); |
@@ -153,7 +156,8 @@ discard block |
||
| 153 | 156 | return $this->repeaterPageViewAction($pageView, $compiler); |
| 154 | 157 | |
| 155 | 158 | default: |
| 156 | - return function () { |
|
| 159 | + return function () |
|
| 160 | + { |
|
| 157 | 161 | $errMsg = 'This URL type has not yet been implemented.'; |
| 158 | 162 | |
| 159 | 163 | return new Response(501, ['Content-Type' => 'text/plain'], $errMsg); |
@@ -170,7 +174,8 @@ discard block |
||
| 170 | 174 | */ |
| 171 | 175 | private function createRedirectAction($to) |
| 172 | 176 | { |
| 173 | - return function () use ($to) { |
|
| 177 | + return function () use ($to) |
|
| 178 | + { |
|
| 174 | 179 | return new Response(302, [ |
| 175 | 180 | 'Location' => $to, |
| 176 | 181 | ]); |
@@ -210,7 +215,8 @@ discard block |
||
| 210 | 215 | { |
| 211 | 216 | self::$baseUrl = $router->getBaseUrl(); |
| 212 | 217 | |
| 213 | - return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) { |
|
| 218 | + return \FastRoute\simpleDispatcher(function (RouteCollector $r) use ($router, $compiler) |
|
| 219 | + { |
|
| 214 | 220 | $dispatcher = new Controller(); |
| 215 | 221 | |
| 216 | 222 | foreach ($router->getRedirectMapping() as $from => $to) |