| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | class StopTimer |
||
| 24 | { |
||
| 25 | use HandlerStaticConstructorTrait; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param RequestInterface $request The Request to stop timing |
||
| 29 | * @param array $options An ignorable list of options |
||
| 30 | * @param PromiseInterface $promise A Promise to fulfill |
||
| 31 | */ |
||
| 32 | public function __invoke( |
||
| 33 | RequestInterface $request, |
||
| 34 | array $options, |
||
| 35 | PromiseInterface $promise |
||
| 36 | ) { |
||
| 37 | $closure = $this->closure($request); |
||
| 38 | $promise->then( |
||
| 39 | $closure, |
||
| 40 | $closure |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param RequestInterface $request The Request being timed |
||
| 46 | * |
||
| 47 | * @return callable|\Closure |
||
| 48 | */ |
||
| 49 | private function closure(RequestInterface $request) |
||
| 58 | } |
||
| 59 | }; |
||
| 62 |