Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | public function build($uri = null, array $queries = null, array $headers = null, array $postBody = null, $body = null, array $options = []) |
||
8 | { |
||
9 | parent::build($uri, $queries, $headers, $postBody, $body, $options); |
||
10 | |||
11 | if (is_array($body)) { |
||
12 | // format the body request to a corect x-www-form-urlencoded |
||
13 | $body = $this->formatQueryString($body); |
||
14 | // Set a defaut form content type |
||
15 | $headers = $headers ?: []; |
||
16 | $headers['Content-Type'] = 'application/x-www-form-urlencoded'; |
||
17 | } |
||
18 | |||
19 | $resource = $queries ? sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : $uri; |
||
20 | |||
21 | return $this->getClient()->patch($resource, $headers, $body, $options); |
||
22 | } |
||
24 |