@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | $data = new Data\Collection($response); |
48 | 48 | |
49 | - if (!$data->exists('ID')) { |
|
49 | + if ( ! $data->exists('ID')) { |
|
50 | 50 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
51 | 51 | } |
52 | 52 |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | ]; |
55 | 55 | |
56 | 56 | $this->tokenExchangeHeaders = [ |
57 | - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) |
|
57 | + 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret) |
|
58 | 58 | ]; |
59 | 59 | |
60 | 60 | $this->tokenRefreshHeaders = [ |
61 | - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) |
|
61 | + 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret) |
|
62 | 62 | ]; |
63 | 63 | } |
64 | 64 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $data = new Data\Collection($response); |
73 | 73 | |
74 | - if (!$data->exists('sub')) { |
|
74 | + if ( ! $data->exists('sub')) { |
|
75 | 75 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
76 | 76 | } |
77 | 77 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | // $userProfile->middleName = $data->get('middle_name'); // not supported |
85 | 85 | $userProfile->lastName = $data->get('family_name'); |
86 | 86 | |
87 | - if (!empty($userProfile->displayName)) { |
|
87 | + if ( ! empty($userProfile->displayName)) { |
|
88 | 88 | $userProfile->displayName = join(' ', array($userProfile->firstName, |
89 | 89 | // $userProfile->middleName, |
90 | 90 | $userProfile->lastName)); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $data = new Data\Collection($response); |
53 | 53 | |
54 | - if (!$data->exists('result')) { |
|
54 | + if ( ! $data->exists('result')) { |
|
55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
56 | 56 | } |
57 | 57 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | $data = new Data\Collection($response); |
53 | 53 | |
54 | - if (!$data->exists('id')) { |
|
54 | + if ( ! $data->exists('id')) { |
|
55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
56 | 56 | } |
57 | 57 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | parent::initialize(); |
61 | 61 | |
62 | 62 | $this->tokenExchangeHeaders = [ |
63 | - 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) |
|
63 | + 'Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret) |
|
64 | 64 | ]; |
65 | 65 | |
66 | 66 | $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | $data = new Data\Collection($response); |
77 | 77 | |
78 | - if (!$data->exists('sub')) { |
|
78 | + if ( ! $data->exists('sub')) { |
|
79 | 79 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
80 | 80 | } |
81 | 81 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | $profileImages = $data->get('profile_images'); |
95 | 95 | if ($this->config->get('photo_size')) { |
96 | - $prop = 'image' . $this->config->get('photo_size'); |
|
96 | + $prop = 'image'.$this->config->get('photo_size'); |
|
97 | 97 | } else { |
98 | 98 | $prop = 'image192'; |
99 | 99 | } |
@@ -52,14 +52,14 @@ discard block |
||
52 | 52 | { |
53 | 53 | parent::authenticateFinish(); |
54 | 54 | |
55 | - $userProfile = $this->storage->get($this->providerId . '.user'); |
|
55 | + $userProfile = $this->storage->get($this->providerId.'.user'); |
|
56 | 56 | |
57 | 57 | $userProfile->identifier = str_ireplace([ |
58 | 58 | 'http://steamcommunity.com/openid/id/', |
59 | 59 | 'https://steamcommunity.com/openid/id/', |
60 | 60 | ], '', $userProfile->identifier); |
61 | 61 | |
62 | - if (!$userProfile->identifier) { |
|
62 | + if ( ! $userProfile->identifier) { |
|
63 | 63 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
64 | 64 | } |
65 | 65 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // store user profile |
85 | - $this->storage->set($this->providerId . '.user', $userProfile); |
|
85 | + $this->storage->set($this->providerId.'.user', $userProfile); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function getUserProfileWebAPI($apiKey, $steam64) |
97 | 97 | { |
98 | 98 | $q = http_build_query(['key' => $apiKey, 'steamids' => $steam64]); |
99 | - $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?' . $q; |
|
99 | + $apiUrl = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?'.$q; |
|
100 | 100 | |
101 | 101 | $response = $this->httpClient->request($apiUrl); |
102 | 102 | |
@@ -108,11 +108,11 @@ discard block |
||
108 | 108 | |
109 | 109 | $userProfile = []; |
110 | 110 | |
111 | - $userProfile['displayName'] = (string)$data->get('personaname'); |
|
112 | - $userProfile['firstName'] = (string)$data->get('realname'); |
|
113 | - $userProfile['photoURL'] = (string)$data->get('avatarfull'); |
|
114 | - $userProfile['profileURL'] = (string)$data->get('profileurl'); |
|
115 | - $userProfile['country'] = (string)$data->get('loccountrycode'); |
|
111 | + $userProfile['displayName'] = (string) $data->get('personaname'); |
|
112 | + $userProfile['firstName'] = (string) $data->get('realname'); |
|
113 | + $userProfile['photoURL'] = (string) $data->get('avatarfull'); |
|
114 | + $userProfile['profileURL'] = (string) $data->get('profileurl'); |
|
115 | + $userProfile['country'] = (string) $data->get('loccountrycode'); |
|
116 | 116 | |
117 | 117 | return $userProfile; |
118 | 118 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | libxml_use_internal_errors(false); |
128 | 128 | |
129 | - $apiUrl = 'http://steamcommunity.com/profiles/' . $steam64 . '/?xml=1'; |
|
129 | + $apiUrl = 'http://steamcommunity.com/profiles/'.$steam64.'/?xml=1'; |
|
130 | 130 | |
131 | 131 | $response = $this->httpClient->request($apiUrl); |
132 | 132 | |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | |
137 | 137 | $userProfile = []; |
138 | 138 | |
139 | - $userProfile['displayName'] = (string)$data->get('steamID'); |
|
140 | - $userProfile['firstName'] = (string)$data->get('realname'); |
|
141 | - $userProfile['photoURL'] = (string)$data->get('avatarFull'); |
|
142 | - $userProfile['description'] = (string)$data->get('summary'); |
|
143 | - $userProfile['region'] = (string)$data->get('location'); |
|
144 | - $userProfile['profileURL'] = (string)$data->get('customURL') |
|
145 | - ? 'http://steamcommunity.com/id/' . (string)$data->get('customURL') |
|
146 | - : 'http://steamcommunity.com/profiles/' . $steam64; |
|
139 | + $userProfile['displayName'] = (string) $data->get('steamID'); |
|
140 | + $userProfile['firstName'] = (string) $data->get('realname'); |
|
141 | + $userProfile['photoURL'] = (string) $data->get('avatarFull'); |
|
142 | + $userProfile['description'] = (string) $data->get('summary'); |
|
143 | + $userProfile['region'] = (string) $data->get('location'); |
|
144 | + $userProfile['profileURL'] = (string) $data->get('customURL') |
|
145 | + ? 'http://steamcommunity.com/id/'.(string) $data->get('customURL') |
|
146 | + : 'http://steamcommunity.com/profiles/'.$steam64; |
|
147 | 147 | |
148 | 148 | return $userProfile; |
149 | 149 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $data = new Data\Collection($response); |
53 | 53 | |
54 | - if (!$data->exists('id')) { |
|
54 | + if ( ! $data->exists('id')) { |
|
55 | 55 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
56 | 56 | } |
57 | 57 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | $data = new Data\Collection($response); |
84 | 84 | |
85 | - if (!$data->exists('data')) { |
|
85 | + if ( ! $data->exists('data')) { |
|
86 | 86 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
87 | 87 | } |
88 | 88 |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | $data = new Data\Collection($response); |
65 | 65 | |
66 | - if (!$data->filter('response')->exists('id')) { |
|
66 | + if ( ! $data->filter('response')->exists('id')) { |
|
67 | 67 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
68 | 68 | } |
69 | 69 |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | $data = new Data\Collection($response); |
105 | 105 | |
106 | - if (!$data->exists('sub')) { |
|
106 | + if ( ! $data->exists('sub')) { |
|
107 | 107 | throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); |
108 | 108 | } |
109 | 109 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; |
123 | 123 | |
124 | 124 | if ($this->config->get('photo_size')) { |
125 | - $userProfile->photoURL .= '?sz=' . $this->config->get('photo_size'); |
|
125 | + $userProfile->photoURL .= '?sz='.$this->config->get('photo_size'); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $userProfile; |
@@ -155,11 +155,11 @@ discard block |
||
155 | 155 | protected function getGmailContacts($parameters = []) |
156 | 156 | { |
157 | 157 | $url = 'https://www.google.com/m8/feeds/contacts/default/full?' |
158 | - . http_build_query(array_replace(['alt' => 'json', 'v' => '3.0'], (array)$parameters)); |
|
158 | + . http_build_query(array_replace(['alt' => 'json', 'v' => '3.0'], (array) $parameters)); |
|
159 | 159 | |
160 | 160 | $response = $this->apiRequest($url); |
161 | 161 | |
162 | - if (!$response) { |
|
162 | + if ( ! $response) { |
|
163 | 163 | return []; |
164 | 164 | } |
165 | 165 | |
@@ -170,10 +170,10 @@ discard block |
||
170 | 170 | $uc = new User\Contact(); |
171 | 171 | |
172 | 172 | $uc->email = isset($entry->{'gd$email'}[0]->address) |
173 | - ? (string)$entry->{'gd$email'}[0]->address |
|
173 | + ? (string) $entry->{'gd$email'}[0]->address |
|
174 | 174 | : ''; |
175 | 175 | |
176 | - $uc->displayName = isset($entry->title->{'$t'}) ? (string)$entry->title->{'$t'} : ''; |
|
176 | + $uc->displayName = isset($entry->title->{'$t'}) ? (string) $entry->title->{'$t'} : ''; |
|
177 | 177 | $uc->identifier = ($uc->email != '') ? $uc->email : ''; |
178 | 178 | $uc->description = ''; |
179 | 179 |