| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | private function wrap(callable $callable, $first) |
||
| 48 | { |
||
| 49 | return function (RequestInterface $request) use ($callable, $first) { |
||
| 50 | $profile = $this->collector->getProfile($this->plugin, $request); |
||
| 51 | $profile->setFirst($first); |
||
| 52 | return $callable($request)->then(function (ResponseInterface $response) use ($profile) { |
||
| 53 | $profile->setResponse($response); |
||
| 54 | return $response; |
||
| 55 | }, function (Exception $exception) use ($profile) { |
||
| 56 | $profile->setException($exception); |
||
| 57 | throw $exception; |
||
| 58 | }); |
||
| 59 | }; |
||
| 60 | } |
||
| 61 | } |