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