Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
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 | |||
53 | return $callable($request)->then(function (ResponseInterface $response) use ($profile) { |
||
54 | $profile->setResponse($response); |
||
55 | |||
56 | return $response; |
||
57 | }, function (Exception $exception) use ($profile) { |
||
58 | $profile->setException($exception); |
||
59 | throw $exception; |
||
60 | }); |
||
61 | }; |
||
62 | } |
||
63 | } |
||
64 |