Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
28 | { |
||
29 | $env = $request->getServerParams(); |
||
30 | assert($this->whoops instanceof \Whoops\Run); |
||
31 | if ($env['APP_ENV'] === 'production') { |
||
32 | $this->whoops->prependHandler(new CallbackHandler($this->errorHandler)); |
||
33 | } else { |
||
34 | $this->whoops->prependHandler(new PrettyPageHandler()); |
||
35 | } |
||
36 | $this->whoops->register(); |
||
37 | return $handler->handle($request); |
||
38 | } |
||
40 |