| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 2 | public function handleRequest(RequestInterface $request, callable $next, callable $first) |
|
| 37 | { |
||
| 38 | 2 | $journal = $this->journal; |
|
| 39 | |||
| 40 | return $next($request)->then(function (ResponseInterface $response) use ($request, $journal) { |
||
| 41 | 1 | $journal->addSuccess($request, $response); |
|
| 42 | |||
| 43 | 1 | return $response; |
|
| 44 | 2 | }, function (Exception $exception) use ($request, $journal) { |
|
| 45 | 1 | $journal->addFailure($request, $exception); |
|
| 46 | |||
| 47 | 1 | throw $exception; |
|
| 48 | 2 | }); |
|
| 49 | } |
||
| 50 | } |
||
| 51 |
If you suppress an error, we recommend checking for the error condition explicitly: