Conditions | 5 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 6.6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 7 | public function __construct(array $token) |
|
26 | { |
||
27 | 7 | if (!isset($token['oauth_token'])) { |
|
28 | throw new InvalidAccessToken( |
||
29 | 'API returned data without oauth_token field' |
||
30 | ); |
||
31 | } |
||
32 | |||
33 | 7 | if (!isset($token['oauth_token_secret'])) { |
|
34 | throw new InvalidAccessToken( |
||
35 | 'API returned data without oauth_token_secret field' |
||
36 | ); |
||
37 | } |
||
38 | |||
39 | 7 | parent::__construct($token['oauth_token'], $token['oauth_token_secret']); |
|
40 | |||
41 | 7 | if (isset($token['user_id'])) { |
|
42 | $this->userId = (string) $token['user_id']; |
||
43 | } |
||
44 | |||
45 | 7 | if (isset($token['screen_name'])) { |
|
46 | $this->screenName = $token['screen_name']; |
||
47 | } |
||
100 |