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