Conditions | 4 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
36 | public function call(string $method, string $url, array $data) |
||
37 | { |
||
38 | \call_user_func([$this->instance, $method], $url, $data); |
||
39 | |||
40 | if ($this->instance->error) { |
||
41 | $message = $this->instance->errorMessage; |
||
42 | if ($this->instance->response && property_exists($this->instance->response, 'errors')) { |
||
43 | $message .= '. ' . reset($this->instance->response->errors)->message; |
||
44 | } |
||
45 | |||
46 | throw new HttpClientException($message, $this->instance->errorCode); |
||
47 | } |
||
48 | |||
49 | return $this->instance->response; |
||
50 | } |
||
51 | |||
69 |