Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.864 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 15 | public function __construct(Config $nstackConfig, Client $client = null) |
|
28 | { |
||
29 | 15 | if ($client) { |
|
30 | 15 | $this->client = $client; |
|
31 | } else { |
||
32 | $this->client = new Client(([ |
||
33 | 'base_uri' => $nstackConfig->getBaseUrl(), |
||
34 | 'timeout' => 5, |
||
35 | 'headers' => [ |
||
36 | 'X-Application-Id' => $nstackConfig->getAppId(), |
||
37 | 'X-Rest-Api-Key' => $nstackConfig->getRestAppKey(), |
||
38 | 'Content-Type' => 'application/json', |
||
39 | ], |
||
40 | ])); |
||
41 | } |
||
42 | |||
43 | 15 | $this->nstackConfig = $nstackConfig; |
|
44 | 15 | } |
|
57 | } |