@@ -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 | } |