@@ -180,11 +180,11 @@ |
||
| 180 | 180 | public function getContent(FlattenException $exception, $showAll = true) |
| 181 | 181 | { |
| 182 | 182 | switch ($exception->getStatusCode()) { |
| 183 | - case 404: |
|
| 184 | - $title = "The page you are looking for could not be found"; |
|
| 185 | - break; |
|
| 186 | - default: |
|
| 187 | - $title = "Oh noes, something's broken"; |
|
| 183 | + case 404: |
|
| 184 | + $title = "The page you are looking for could not be found"; |
|
| 185 | + break; |
|
| 186 | + default: |
|
| 187 | + $title = "Oh noes, something's broken"; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $content = ''; |
@@ -254,34 +254,34 @@ |
||
| 254 | 254 | { |
| 255 | 255 | switch ($key = strtolower($key)) { |
| 256 | 256 | |
| 257 | - case 'ajax': |
|
| 258 | - if (!isset($this->isCache['ajax'])) { |
|
| 259 | - return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | - } |
|
| 261 | - |
|
| 262 | - return $this->isCache['ajax']; |
|
| 263 | - |
|
| 264 | - case 'put': |
|
| 265 | - case 'delete': |
|
| 266 | - case 'post': |
|
| 267 | - case 'patch': |
|
| 268 | - if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | - $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | - } |
|
| 271 | - |
|
| 272 | - return $this->isCache['requestMethod'][$key]; |
|
| 273 | - |
|
| 274 | - case 'ssl': |
|
| 275 | - case 'https': |
|
| 276 | - case 'secure': |
|
| 277 | - if (!isset($this->isCache['secure'])) { |
|
| 278 | - $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - return $this->isCache['secure']; |
|
| 282 | - |
|
| 283 | - default: |
|
| 284 | - throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 257 | + case 'ajax': |
|
| 258 | + if (!isset($this->isCache['ajax'])) { |
|
| 259 | + return $this->isCache['ajax'] = $this->getService('Request')->isXmlHttpRequest(); |
|
| 260 | + } |
|
| 261 | + |
|
| 262 | + return $this->isCache['ajax']; |
|
| 263 | + |
|
| 264 | + case 'put': |
|
| 265 | + case 'delete': |
|
| 266 | + case 'post': |
|
| 267 | + case 'patch': |
|
| 268 | + if (!isset($this->isCache['requestMethod'][$key])) { |
|
| 269 | + $this->isCache['requestMethod'][$key] = $this->getService('Request')->getMethod() === strtoupper($key); |
|
| 270 | + } |
|
| 271 | + |
|
| 272 | + return $this->isCache['requestMethod'][$key]; |
|
| 273 | + |
|
| 274 | + case 'ssl': |
|
| 275 | + case 'https': |
|
| 276 | + case 'secure': |
|
| 277 | + if (!isset($this->isCache['secure'])) { |
|
| 278 | + $this->isCache['secure'] = $this->getService('Request')->isSecure(); |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + return $this->isCache['secure']; |
|
| 282 | + |
|
| 283 | + default: |
|
| 284 | + throw new \InvalidArgumentException("Invalid 'is' key supplied: {$key}"); |
|
| 285 | 285 | |
| 286 | 286 | } |
| 287 | 287 | } |
@@ -60,37 +60,37 @@ |
||
| 60 | 60 | |
| 61 | 61 | switch(true) { |
| 62 | 62 | // @todo - move this to a separate method() |
| 63 | - case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
| 64 | - $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
| 65 | - $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
| 66 | - $chainRouter->add($sfRouterWrapper); |
|
| 67 | - break; |
|
| 68 | - |
|
| 69 | - // @todo - move this to a separate method() |
|
| 70 | - case $moduleRoutingResponse instanceof AuraRouter: |
|
| 71 | - $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
| 72 | - $chainRouter->add($auraRouterWrapper); |
|
| 73 | - break; |
|
| 74 | - |
|
| 75 | - // @todo - move this to a separate method() |
|
| 76 | - case $moduleRoutingResponse instanceof LaravelRouter: |
|
| 77 | - $laravelRequest = new LaravelRequest(); |
|
| 78 | - $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
| 79 | - $laravelRouterWrapper = new LaravelRouterWrapper( |
|
| 80 | - $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
| 81 | - ); |
|
| 82 | - // @todo - solve this problem |
|
| 63 | + case $moduleRoutingResponse instanceof SymfonyRouteCollection: |
|
| 64 | + $sfRouter = new SymfonyRouter($requestContext, $moduleRoutingResponse, $routerOptions, $logger); |
|
| 65 | + $sfRouterWrapper = new SymfonyRouterWrapper($sfRouter); |
|
| 66 | + $chainRouter->add($sfRouterWrapper); |
|
| 67 | + break; |
|
| 68 | + |
|
| 69 | + // @todo - move this to a separate method() |
|
| 70 | + case $moduleRoutingResponse instanceof AuraRouter: |
|
| 71 | + $auraRouterWrapper = new AuraRouterWrapper($moduleRoutingResponse); |
|
| 72 | + $chainRouter->add($auraRouterWrapper); |
|
| 73 | + break; |
|
| 74 | + |
|
| 75 | + // @todo - move this to a separate method() |
|
| 76 | + case $moduleRoutingResponse instanceof LaravelRouter: |
|
| 77 | + $laravelRequest = new LaravelRequest(); |
|
| 78 | + $laravelUrlGenerator = new LaravelUrlGenerator($moduleRoutingResponse->getRoutes(), $laravelRequest); |
|
| 79 | + $laravelRouterWrapper = new LaravelRouterWrapper( |
|
| 80 | + $moduleRoutingResponse, $laravelRequest, $laravelUrlGenerator |
|
| 81 | + ); |
|
| 82 | + // @todo - solve this problem |
|
| 83 | 83 | // $laravelRouterWrapper->setModuleName($this->getName()); |
| 84 | - $chainRouter->add($laravelRouterWrapper); |
|
| 85 | - break; |
|
| 84 | + $chainRouter->add($laravelRouterWrapper); |
|
| 85 | + break; |
|
| 86 | 86 | |
| 87 | - case $moduleRoutingResponse instanceof FastRouteWrapper: |
|
| 88 | - $chainRouter->add($moduleRoutingResponse); |
|
| 89 | - break; |
|
| 87 | + case $moduleRoutingResponse instanceof FastRouteWrapper: |
|
| 88 | + $chainRouter->add($moduleRoutingResponse); |
|
| 89 | + break; |
|
| 90 | 90 | |
| 91 | - default: |
|
| 92 | - throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
| 93 | - '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
| 91 | + default: |
|
| 92 | + throw new \Exception('Unexpected routes value return from module: ' . $moduleName . |
|
| 93 | + '. found value of type: ' . gettype($moduleRoutingResponse)); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |