Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
15 | public static function createHttpClient(Params $params): HttpClient |
||
16 | { |
||
17 | $baseUri = "{$params->getHost()}:{$params->getPort()}/"; |
||
18 | |||
19 | // Communications through JSON |
||
20 | $headers = [ |
||
21 | 'Accept' => 'application/json', |
||
22 | 'Content-Type' => 'application/json', |
||
23 | ]; |
||
24 | |||
25 | return new \GuzzleHttp\Client([ |
||
26 | 'base_uri' => $baseUri, |
||
27 | 'defaults' => [ |
||
28 | 'headers' => $headers, |
||
29 | ], |
||
30 | 'http_errors' => false, |
||
31 | ]); |
||
34 |