| Conditions | 4 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.5923 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 1 | public function __construct(array $token) |
|
| 34 | { |
||
| 35 | 1 | if (!isset($token['access_token'])) { |
|
| 36 | throw new InvalidAccessToken( |
||
| 37 | 'API returned data without access_token field' |
||
| 38 | ); |
||
| 39 | } |
||
| 40 | |||
| 41 | 1 | $this->token = $token['access_token']; |
|
| 42 | |||
| 43 | 1 | if (isset($token['expires'])) { |
|
| 44 | $this->expires = $token['expires']; |
||
| 45 | } |
||
| 46 | |||
| 47 | 1 | if (isset($token['user_id'])) { |
|
| 48 | 1 | $this->uid = $token['user_id']; |
|
| 49 | 1 | } |
|
| 50 | 1 | } |
|
| 51 | |||
| 76 |