Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
37 | private function post($url, $body) |
||
38 | { |
||
39 | $headers = $this->auth->authorization($url, $body, 'application/json'); |
||
40 | $headers['Content-Type'] = 'application/json'; |
||
41 | $ret = Client::post($url, $body, $headers); |
||
42 | if (!$ret->ok()) { |
||
43 | return array(null, new Error($url, $ret)); |
||
44 | } |
||
45 | $r = ($ret->body === null) ? array() : $ret->json(); |
||
46 | return array($r, null); |
||
47 | } |
||
48 | } |
||
49 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.