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