Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
19 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
20 | { |
||
21 | $server = $request->getServerParams(); |
||
22 | if (!isset($server['REQUEST_TIME_FLOAT'])) { |
||
23 | $server['REQUEST_TIME_FLOAT'] = microtime(true); |
||
24 | } |
||
25 | $response = $handler->handle($request); |
||
26 | $time = (microtime(true) - $server['REQUEST_TIME_FLOAT']) * 1000; |
||
27 | return $response->withHeader(self::HEADER, sprintf('%2.3fms', $time)); |
||
28 | } |
||
30 |