Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 4 | public function handle() |
|
41 | { |
||
42 | |||
43 | 4 | $link = $this->baseUrl. str_replace(":m",$this->apiKeys['merchantId'],self::ALL_PLANS_RELATIVE_LINK); |
|
44 | |||
45 | 4 | $link = str_replace(":key", $this->apiKeys['apiKey'], $link); |
|
46 | |||
47 | /** |
||
48 | * @var ResponseInterface $response |
||
49 | */ |
||
50 | 4 | $response = $this->adapter->getHttpClient() |
|
51 | 4 | ->get($link); |
|
52 | |||
53 | 4 | if (200 !== $response->getStatusCode()) { |
|
54 | 1 | throw new InvalidHttpResponseException( |
|
55 | 1 | "Expected 200. Got{$response->getStatusCode()} instead" |
|
56 | ); |
||
57 | } |
||
58 | |||
59 | 3 | return json_decode($response->getBody(), true); |
|
60 | } |
||
61 | } |
||
62 |