Passed
Push — develop ( 3d5bb0...fc5d7b )
by Benjamin
04:08
created
src/services/LoginAccounts.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             try {
209 209
                 $photoUrl = html_entity_decode(Craft::$app->getView()->renderString($userFieldMapping['photo'], ['profile' => $profile]));
210 210
             } catch (\Exception $e) {
211
-                Craft::warning('Could not map:' . print_r(['photo', $userFieldMapping['photo'], $profile, $e->getMessage()], true), __METHOD__);
211
+                Craft::warning('Could not map:'.print_r(['photo', $userFieldMapping['photo'], $profile, $e->getMessage()], true), __METHOD__);
212 212
             }
213 213
         }
214 214
 
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
     {
234 234
         $filename = 'photo';
235 235
 
236
-        $tempPath = Craft::$app->path->getTempPath() . '/social/userphotos/' . $user->email . '/';
236
+        $tempPath = Craft::$app->path->getTempPath().'/social/userphotos/'.$user->email.'/';
237 237
 
238 238
         FileHelper::createDirectory($tempPath);
239 239
 
240 240
         $client = new \GuzzleHttp\Client();
241 241
 
242 242
         $response = $client->request('GET', $photoUrl, [
243
-            'sink' => $tempPath . $filename
243
+            'sink' => $tempPath.$filename
244 244
         ]);
245 245
 
246 246
         if ($response->getStatusCode() !== 200) {
@@ -265,15 +265,15 @@  discard block
 block discarded – undo
265 265
                     break;
266 266
 
267 267
                 default:
268
-                    throw new ImageTypeException('Image type “' . $contentTypes[0] . '” not supported');
268
+                    throw new ImageTypeException('Image type “'.$contentTypes[0].'” not supported');
269 269
             }
270 270
         } else {
271 271
             throw new ImageTypeException('Image type not supported');
272 272
         }
273 273
 
274
-        rename($tempPath . $filename, $tempPath . $filename . '.' . $extension);
274
+        rename($tempPath.$filename, $tempPath.$filename.'.'.$extension);
275 275
 
276
-        $image = Craft::$app->images->loadImage($tempPath . $filename . '.' . $extension);
276
+        $image = Craft::$app->images->loadImage($tempPath.$filename.'.'.$extension);
277 277
         $imageWidth = $image->getWidth();
278 278
         $imageHeight = $image->getHeight();
279 279
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
         $verticalMargin = ($imageHeight - $dimension) / 2;
283 283
         $image->crop($horizontalMargin, $imageWidth - $horizontalMargin, $verticalMargin, $imageHeight - $verticalMargin);
284 284
 
285
-        Craft::$app->users->saveUserPhoto($tempPath . $filename . '.' . $extension, $user, $filename . '.' . $extension);
285
+        Craft::$app->users->saveUserPhoto($tempPath.$filename.'.'.$extension, $user, $filename.'.'.$extension);
286 286
 
287 287
         return true;
288 288
     }
Please login to merge, or discard this patch.
src/controllers/LoginAccountsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         // Connect
161 161
 
162
-        $providerHandle = (string)Craft::$app->getRequest()->getParam('provider');
162
+        $providerHandle = (string) Craft::$app->getRequest()->getParam('provider');
163 163
         $plugin = Craft::$app->getPlugins()->getPlugin('social');
164 164
         $pluginSettings = $plugin->getSettings();
165 165
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             return $loginProvider->oauthConnect();
183 183
         } catch (\Exception $e) {
184 184
             $errorMsg = $e->getMessage();
185
-            Craft::error('Couldn’t login. ' . $e->getTraceAsString(), __METHOD__);
185
+            Craft::error('Couldn’t login. '.$e->getTraceAsString(), __METHOD__);
186 186
             $this->setError($errorMsg);
187 187
 
188 188
             return $this->redirect($this->originUrl);
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $this->redirectUrl = $this->originUrl;
206 206
         }
207 207
 
208
-        $providerHandle = (string)Craft::$app->getSession()->get('social.loginProvider');
208
+        $providerHandle = (string) Craft::$app->getSession()->get('social.loginProvider');
209 209
         $loginProvider = Plugin::getInstance()->getLoginProviders()->getLoginProvider($providerHandle);
210 210
 
211 211
         try {
@@ -239,13 +239,13 @@  discard block
 block discarded – undo
239 239
                 $errorMsg = 'Couldn’t login.';
240 240
             }
241 241
 
242
-            Craft::error('Couldn’t login. ' . $e->getTraceAsString(), __METHOD__);
242
+            Craft::error('Couldn’t login. '.$e->getTraceAsString(), __METHOD__);
243 243
             $this->setError($errorMsg);
244 244
 
245 245
             return $this->redirect($this->originUrl);
246 246
         } catch (\Exception $e) {
247 247
             $errorMsg = $e->getMessage();
248
-            Craft::error('Couldn’t login. ' . $e->getTraceAsString(), __METHOD__);
248
+            Craft::error('Couldn’t login. '.$e->getTraceAsString(), __METHOD__);
249 249
             $this->setError($errorMsg);
250 250
 
251 251
             return $this->redirect($this->originUrl);
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
 
464 464
         if ($user) {
465 465
             if (Plugin::getInstance()->getSettings()->allowEmailMatch !== true) {
466
-                throw new RegistrationException('An account already exists with this email: ' . $email);
466
+                throw new RegistrationException('An account already exists with this email: '.$email);
467 467
             }
468 468
 
469 469
             return $user;
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 
496 496
         // Save user
497 497
         if (!Craft::$app->elements->saveElement($newUser)) {
498
-            Craft::error('There was a problem creating the user:' . print_r($newUser->getErrors(), true), __METHOD__);
498
+            Craft::error('There was a problem creating the user:'.print_r($newUser->getErrors(), true), __METHOD__);
499 499
             throw new RegistrationException('Craft user couldn’t be created.');
500 500
         }
501 501
 
Please login to merge, or discard this patch.