Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
11 | 2 | public function __invoke(callable $handler): Closure |
|
12 | { |
||
13 | return static function (RequestInterface $request, array $options) use ($handler) { |
||
14 | 2 | $content = gzencode($request->getBody()->getContents()); |
|
15 | 2 | $request = modify_request($request, [ |
|
16 | 2 | 'body' => $content, |
|
17 | 'set_headers' => [ |
||
18 | 2 | 'Content-Encoding' => 'gzip', |
|
19 | 2 | 'Content-Length' => strlen($content), |
|
20 | ], |
||
21 | ]); |
||
22 | |||
23 | 2 | return $handler($request, $options); |
|
24 | 2 | }; |
|
25 | } |
||
26 | } |
||
27 |