Conditions | 4 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 4 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 24 | protected function send(string $method, string $uri, array $options = []) |
|
26 | { |
||
27 | 24 | $headers = []; |
|
28 | 24 | if (isset($options['headers'])) { |
|
29 | 1 | $headers = $options['headers']; |
|
30 | 1 | unset($options['headers']); |
|
31 | } |
||
32 | 24 | $body = ''; |
|
33 | 24 | if (isset($options['body'])) { |
|
34 | 4 | $body = $options['body']; |
|
35 | 4 | unset($options['body']); |
|
36 | } |
||
37 | 24 | if (isset($options['query'])) { |
|
38 | 5 | $uri .= '?' . http_build_query($options['query']); |
|
39 | 5 | unset($options['body']); |
|
40 | } |
||
41 | 24 | $this->lastRequest = new Request($method, $uri, $headers, $body); |
|
42 | 24 | $this->lastResponse = $this->getClient()->send($this->lastRequest, $options); |
|
43 | 23 | } |
|
45 |