Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function me():ResponseInterface{ |
||
33 | $response = $this->request('/user'); |
||
34 | $status = $response->getStatusCode(); |
||
35 | |||
36 | if($status === 200){ |
||
37 | return $response; |
||
38 | } |
||
39 | |||
40 | $json = MessageUtil::decodeJSON($response); |
||
41 | |||
42 | if(isset($json->error, $json->error->message)){ |
||
43 | throw new ProviderException($json->error->message); |
||
44 | } |
||
45 | |||
46 | throw new ProviderException(sprintf('user info error error HTTP/%s', $status)); |
||
47 | } |
||
50 |