| Conditions | 2 |
| Paths | 2 |
| Total Lines | 25 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 9 | public function getClient(array $options = []) |
|
| 33 | { |
||
| 34 | 9 | if (!is_null($this->client)) { |
|
| 35 | 7 | return $this->client; |
|
| 36 | } |
||
| 37 | |||
| 38 | 9 | $options = array_merge( |
|
| 39 | 9 | ['handler' => $this->createClientHandler()], |
|
| 40 | 9 | $options, |
|
| 41 | [ |
||
| 42 | 9 | 'base_uri' => $this->apiEndPoint, |
|
| 43 | 'auth' => [ |
||
| 44 | 9 | $this->apiToken, |
|
| 45 | 9 | '', |
|
| 46 | ], |
||
| 47 | 'headers' => [ |
||
| 48 | 9 | 'Accept' => 'application/vnd.api+json', |
|
| 49 | 9 | 'Content-Type' => 'application/vnd.api+json', |
|
| 50 | 9 | 'User-Agent' => $this->userAgent, |
|
| 51 | ], |
||
| 52 | ] |
||
| 53 | ); |
||
| 54 | 9 | $this->client = new Client($options); |
|
| 55 | |||
| 56 | 9 | return $this->client; |
|
| 57 | } |
||
| 87 |