@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $adapter = $provider->getAdapter(); |
45 | 45 | $token = Socializer::$app->tokens->getToken($provider->id, $user->id); |
46 | 46 | |
47 | - if (is_null($token)){ |
|
47 | + if (is_null($token)) { |
|
48 | 48 | $token = new Token(); |
49 | 49 | $token->providerId = $provider->id; |
50 | 50 | $token->userId = $user->id; |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | { |
69 | 69 | $user = Craft::$app->getUser()->getIdentity(); |
70 | 70 | |
71 | - if ($user){ |
|
71 | + if ($user) { |
|
72 | 72 | /** @var Token $token */ |
73 | 73 | $token = $this->getToken($providerId, $user->id); |
74 | - if ($token){ |
|
74 | + if ($token) { |
|
75 | 75 | return $token->accessToken; |
76 | 76 | } |
77 | 77 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function getFieldContext(): string |
95 | 95 | { |
96 | - return 'enupalSocializer:' . $this->id; |
|
96 | + return 'enupalSocializer:'.$this->id; |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public static function displayName(): string |
105 | 105 | { |
106 | - return Craft::t('enupal-socializer','Socializer'); |
|
106 | + return Craft::t('enupal-socializer', 'Socializer'); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | public function getCpEditUrl(): ?string |
164 | 164 | { |
165 | 165 | return UrlHelper::cpUrl( |
166 | - 'enupal-socializer/providers/edit/' . $this->id |
|
166 | + 'enupal-socializer/providers/edit/'.$this->id |
|
167 | 167 | ); |
168 | 168 | } |
169 | 169 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $sources = [ |
196 | 196 | [ |
197 | 197 | 'key' => '*', |
198 | - 'label' => Craft::t('enupal-socializer','All Providers'), |
|
198 | + 'label' => Craft::t('enupal-socializer', 'All Providers'), |
|
199 | 199 | ] |
200 | 200 | ]; |
201 | 201 | |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | protected static function defineSortOptions(): array |
239 | 239 | { |
240 | 240 | $attributes = [ |
241 | - 'elements.dateCreated' => Craft::t('enupal-socializer','Date Created'), |
|
242 | - 'name' => Craft::t('enupal-socializer','Name') |
|
241 | + 'elements.dateCreated' => Craft::t('enupal-socializer', 'Date Created'), |
|
242 | + 'name' => Craft::t('enupal-socializer', 'Name') |
|
243 | 243 | ]; |
244 | 244 | |
245 | 245 | return $attributes; |
@@ -251,9 +251,9 @@ discard block |
||
251 | 251 | protected static function defineTableAttributes(): array |
252 | 252 | { |
253 | 253 | $attributes = []; |
254 | - $attributes['name'] = ['label' => Craft::t('enupal-socializer','Name')]; |
|
255 | - $attributes['handle'] = ['label' => Craft::t('enupal-socializer','Handle')]; |
|
256 | - $attributes['dateCreated'] = ['label' => Craft::t('enupal-socializer','Date Created')]; |
|
254 | + $attributes['name'] = ['label' => Craft::t('enupal-socializer', 'Name')]; |
|
255 | + $attributes['handle'] = ['label' => Craft::t('enupal-socializer', 'Handle')]; |
|
256 | + $attributes['dateCreated'] = ['label' => Craft::t('enupal-socializer', 'Date Created')]; |
|
257 | 257 | |
258 | 258 | return $attributes; |
259 | 259 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | protected static function defineDefaultTableAttributes(string $source): array |
265 | 265 | { |
266 | - $attributes = ['name', 'handle' , 'dateCreated']; |
|
266 | + $attributes = ['name', 'handle', 'dateCreated']; |
|
267 | 267 | |
268 | 268 | return $attributes; |
269 | 269 | } |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | $record = ProviderRecord::findOne($this->id); |
309 | 309 | |
310 | 310 | if (!$record) { |
311 | - throw new \Exception('Invalid Provider ID: ' . $this->id); |
|
311 | + throw new \Exception('Invalid Provider ID: '.$this->id); |
|
312 | 312 | } |
313 | 313 | } else { |
314 | 314 | $record->id = $this->id; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | $record->clientSecret = $this->clientSecret; |
323 | 323 | $record->fieldMapping = $this->fieldMapping; |
324 | 324 | |
325 | - if (is_array($record->fieldMapping)){ |
|
325 | + if (is_array($record->fieldMapping)) { |
|
326 | 326 | $record->fieldMapping = json_encode($record->fieldMapping); |
327 | 327 | }; |
328 | 328 |