@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | |
162 | 162 | // Connect |
163 | 163 | |
164 | - $providerHandle = (string)Craft::$app->getRequest()->getParam('provider'); |
|
164 | + $providerHandle = (string) Craft::$app->getRequest()->getParam('provider'); |
|
165 | 165 | $plugin = Craft::$app->getPlugins()->getPlugin('social'); |
166 | 166 | $pluginSettings = $plugin->getSettings(); |
167 | 167 | |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | return $loginProvider->oauthConnect(); |
185 | 185 | } catch (\Exception $exception) { |
186 | 186 | $errorMsg = $exception->getMessage(); |
187 | - Craft::error('Couldn’t login. ' . $exception->getTraceAsString(), __METHOD__); |
|
187 | + Craft::error('Couldn’t login. '.$exception->getTraceAsString(), __METHOD__); |
|
188 | 188 | $this->setError($errorMsg); |
189 | 189 | |
190 | 190 | return $this->redirect($this->originUrl); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $this->redirectUrl = $this->originUrl; |
208 | 208 | } |
209 | 209 | |
210 | - $providerHandle = (string)Craft::$app->getSession()->get('social.loginProvider'); |
|
210 | + $providerHandle = (string) Craft::$app->getSession()->get('social.loginProvider'); |
|
211 | 211 | $loginProvider = Plugin::getInstance()->getLoginProviders()->getLoginProvider($providerHandle); |
212 | 212 | |
213 | 213 | try { |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | |
238 | 238 | $errorMsg = $json ? $json['error']['message'] : 'Couldn’t login.'; |
239 | 239 | |
240 | - Craft::error('Couldn’t login. ' . $badResponseException->getTraceAsString(), __METHOD__); |
|
240 | + Craft::error('Couldn’t login. '.$badResponseException->getTraceAsString(), __METHOD__); |
|
241 | 241 | $this->setError($errorMsg); |
242 | 242 | |
243 | 243 | return $this->redirect($this->originUrl); |
244 | 244 | } catch (\Exception $exception) { |
245 | 245 | $errorMsg = $exception->getMessage(); |
246 | - Craft::error('Couldn’t login. ' . $exception->getTraceAsString(), __METHOD__); |
|
246 | + Craft::error('Couldn’t login. '.$exception->getTraceAsString(), __METHOD__); |
|
247 | 247 | $this->setError($errorMsg); |
248 | 248 | |
249 | 249 | return $this->redirect($this->originUrl); |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | |
462 | 462 | if ($user) { |
463 | 463 | if (Plugin::getInstance()->getSettings()->allowEmailMatch !== true) { |
464 | - throw new RegistrationException('An account already exists with this email: ' . $email); |
|
464 | + throw new RegistrationException('An account already exists with this email: '.$email); |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | return $user; |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | |
494 | 494 | // Save user |
495 | 495 | if (!Craft::$app->elements->saveElement($newUser)) { |
496 | - Craft::error('There was a problem creating the user:' . print_r($newUser->getErrors(), true), __METHOD__); |
|
496 | + Craft::error('There was a problem creating the user:'.print_r($newUser->getErrors(), true), __METHOD__); |
|
497 | 497 | throw new RegistrationException('Craft user couldn’t be created.'); |
498 | 498 | } |
499 | 499 |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | try { |
204 | 204 | $photoUrl = html_entity_decode(Craft::$app->getView()->renderString($userFieldMapping['photo'], ['profile' => $profile])); |
205 | 205 | } catch (\Exception $exception) { |
206 | - Craft::warning('Could not map:' . print_r(['photo', $userFieldMapping['photo'], $profile, $exception->getMessage()], true), __METHOD__); |
|
206 | + Craft::warning('Could not map:'.print_r(['photo', $userFieldMapping['photo'], $profile, $exception->getMessage()], true), __METHOD__); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -228,14 +228,14 @@ discard block |
||
228 | 228 | { |
229 | 229 | $filename = 'photo'; |
230 | 230 | |
231 | - $tempPath = Craft::$app->path->getTempPath() . '/social/userphotos/' . $user->email . '/'; |
|
231 | + $tempPath = Craft::$app->path->getTempPath().'/social/userphotos/'.$user->email.'/'; |
|
232 | 232 | |
233 | 233 | FileHelper::createDirectory($tempPath); |
234 | 234 | |
235 | 235 | $client = new \GuzzleHttp\Client(); |
236 | 236 | |
237 | 237 | $response = $client->request('GET', $photoUrl, [ |
238 | - 'sink' => $tempPath . $filename |
|
238 | + 'sink' => $tempPath.$filename |
|
239 | 239 | ]); |
240 | 240 | |
241 | 241 | if ($response->getStatusCode() !== 200) { |
@@ -260,15 +260,15 @@ discard block |
||
260 | 260 | break; |
261 | 261 | |
262 | 262 | default: |
263 | - throw new ImageTypeException('Image type “' . $contentTypes[0] . '” not supported'); |
|
263 | + throw new ImageTypeException('Image type “'.$contentTypes[0].'” not supported'); |
|
264 | 264 | } |
265 | 265 | } else { |
266 | 266 | throw new ImageTypeException('Image type not supported'); |
267 | 267 | } |
268 | 268 | |
269 | - rename($tempPath . $filename, $tempPath . $filename . '.' . $extension); |
|
269 | + rename($tempPath.$filename, $tempPath.$filename.'.'.$extension); |
|
270 | 270 | |
271 | - $image = Craft::$app->images->loadImage($tempPath . $filename . '.' . $extension); |
|
271 | + $image = Craft::$app->images->loadImage($tempPath.$filename.'.'.$extension); |
|
272 | 272 | $imageWidth = $image->getWidth(); |
273 | 273 | $imageHeight = $image->getHeight(); |
274 | 274 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | $verticalMargin = ($imageHeight - $dimension) / 2; |
278 | 278 | $image->crop($horizontalMargin, $imageWidth - $horizontalMargin, $verticalMargin, $imageHeight - $verticalMargin); |
279 | 279 | |
280 | - Craft::$app->users->saveUserPhoto($tempPath . $filename . '.' . $extension, $user, $filename . '.' . $extension); |
|
280 | + Craft::$app->users->saveUserPhoto($tempPath.$filename.'.'.$extension, $user, $filename.'.'.$extension); |
|
281 | 281 | |
282 | 282 | return true; |
283 | 283 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | Craft::$app->getConfig()->getGeneral()->addTrailingSlashesToUrls = $addTrailingSlashesToUrls; |
45 | 45 | |
46 | 46 | // We don't want the CP trigger showing in the action URL. |
47 | - $redirectUri = str_replace(Craft::$app->getConfig()->getGeneral()->cpTrigger . '/', '', $redirectUri); |
|
47 | + $redirectUri = str_replace(Craft::$app->getConfig()->getGeneral()->cpTrigger.'/', '', $redirectUri); |
|
48 | 48 | |
49 | 49 | return $redirectUri; |
50 | 50 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | try { |
62 | 62 | $newUser->{$attribute} = Craft::$app->getView()->renderString($template, ['profile' => $profile]); |
63 | 63 | } catch (\Exception $exception) { |
64 | - Craft::warning('Could not map:' . print_r([$attribute, $template, $profile, $exception->getMessage()], true), __METHOD__); |
|
64 | + Craft::warning('Could not map:'.print_r([$attribute, $template, $profile, $exception->getMessage()], true), __METHOD__); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $value = Craft::$app->getView()->renderString($template, ['profile' => $profile]); |
81 | 81 | $newUser->setFieldValue($attribute, $value); |
82 | 82 | } catch (\Exception $exception) { |
83 | - Craft::warning('Could not map:' . print_r([$template, $profile, $exception->getMessage()], true), __METHOD__); |
|
83 | + Craft::warning('Could not map:'.print_r([$template, $profile, $exception->getMessage()], true), __METHOD__); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |