| Conditions | 3 |
| Paths | 2 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 3 | public function process(ServerRequestInterface $req, RequestHandlerInterface $handler): ResponseInterface |
|
| 23 | {
|
||
| 24 | 3 | $level = ob_get_level(); |
|
| 25 | |||
| 26 | try |
||
| 27 | {
|
||
| 28 | 3 | $res = $handler->handle($req); |
|
| 29 | } |
||
| 30 | 2 | catch (Throwable $e) |
|
| 31 | {
|
||
| 32 | 2 | while (ob_get_level() > $level) |
|
| 33 | {
|
||
| 34 | 1 | ob_end_clean(); |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | $res = $this->errorHandler->handleError($e, $req); |
|
| 38 | } |
||
| 39 | |||
| 40 | 3 | return $res; |
|
| 41 | } |
||
| 42 | } |