Conditions | 4 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.128 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | 1 | public function send($method, $uri, $body = null, array $query = [], array $headers = [], array $options = []) |
|
33 | { |
||
34 | 1 | $options = array_merge($options, [ |
|
35 | 1 | RequestOptions::QUERY => $query, |
|
36 | 1 | RequestOptions::HEADERS => $headers, |
|
37 | 1 | ]); |
|
38 | |||
39 | 1 | if (!empty($body) && (is_array($body) || $body instanceof \JsonSerializable)) { |
|
40 | $options[RequestOptions::JSON] = $body; |
||
41 | } else { |
||
42 | 1 | $options[RequestOptions::BODY] = $body; |
|
43 | } |
||
44 | |||
45 | 1 | return $this->guzzleClient->request($method, $uri, $options); |
|
46 | } |
||
47 | } |
||
48 |