@@ -62,12 +62,10 @@ |
||
62 | 62 | if(in_array(self::SCOPE_V2_IDENTITY, $scopes)){ |
63 | 63 | $endpoint = '/v2/identity'; |
64 | 64 | $params = ['fields[user]' => 'about,created,email,first_name,full_name,image_url,last_name,social_connections,thumb_url,url,vanity']; |
65 | - } |
|
66 | - elseif(in_array(self::SCOPE_V1_USERS, $scopes)){ |
|
65 | + } elseif(in_array(self::SCOPE_V1_USERS, $scopes)){ |
|
67 | 66 | $endpoint = '/api/current_user'; |
68 | 67 | $params = []; |
69 | - } |
|
70 | - else{ |
|
68 | + } else{ |
|
71 | 69 | throw new ProviderException('invalid scopes for the identity endpoint'); |
72 | 70 | } |
73 | 71 |
@@ -166,15 +166,13 @@ |
||
166 | 166 | if(!$data || !is_array($data)){ |
167 | 167 | trigger_error(''); |
168 | 168 | } |
169 | - } |
|
170 | - catch(Throwable $e){ |
|
169 | + } catch(Throwable $e){ |
|
171 | 170 | throw new ProviderException('unable to parse token response'); |
172 | 171 | } |
173 | 172 | |
174 | 173 | if(isset($data['error'])){ |
175 | 174 | throw new ProviderException('error retrieving access token: '.$data['message']); |
176 | - } |
|
177 | - elseif(!isset($data['session']['key'])){ |
|
175 | + } elseif(!isset($data['session']['key'])){ |
|
178 | 176 | throw new ProviderException('token missing'); |
179 | 177 | } |
180 | 178 |