Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
35 | public function me():ResponseInterface{ |
||
36 | $response = $this->request('/users/user', ['fields' => 'uuid|username|profile_url|internal_id|date_registered|caches_found|caches_notfound|caches_hidden|rcmds_given|rcmds_left|rcmd_founds_needed|home_location']); |
||
37 | $status = $response->getStatusCode(); |
||
38 | |||
39 | if($status === 200){ |
||
40 | return $response; |
||
41 | } |
||
42 | |||
43 | $json = MessageUtil::decodeJSON($response); |
||
44 | |||
45 | if(isset($json->error, $json->error_description)){ |
||
46 | throw new ProviderException($json->error_description); |
||
47 | } |
||
48 | |||
49 | throw new ProviderException(sprintf('user info error error HTTP/%s', $status)); |
||
50 | } |
||
53 |