| Conditions | 2 |
| Paths | 2 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 4 | public function handle() |
|
| 30 | { |
||
| 31 | 4 | $link = $this->baseUrl . str_replace( |
|
| 32 | 4 | ":m", $this->apiKeys['merchantId'], self::ALL_PLANS_RELATIVE_LINK |
|
| 33 | ); |
||
| 34 | |||
| 35 | 4 | $link = str_replace(":key", $this->apiKeys['apiKey'], $link); |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @var ResponseInterface $response |
||
| 39 | */ |
||
| 40 | 4 | $response = $this->adapter->getHttpClient() |
|
| 41 | 4 | ->get($link); |
|
| 42 | |||
| 43 | 4 | if ($response->getStatusCode() !== 200) { |
|
| 44 | 1 | throw InvalidHttpResponseException::createFromResponse($response); |
|
| 45 | } |
||
| 46 | |||
| 47 | 3 | return json_decode($response->getBody(), true); |
|
| 48 | } |
||
| 49 | } |
||
| 50 |