From 8f0644141af3d61051e192a1236f6e37af1d8572 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 8 Nov 2024 12:49:35 +0100 Subject: [PATCH] Add php doc to `SetAvatar` --- .../lib/system/user/command/SetAvatar.class.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php b/wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php index 2a2e854d57..823d4234db 100644 --- a/wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php +++ b/wcfsetup/install/files/lib/system/user/command/SetAvatar.class.php @@ -4,7 +4,6 @@ namespace wcf\system\user\command; use wcf\data\file\File; use wcf\data\file\FileAction; -use wcf\data\user\avatar\UserAvatarAction; use wcf\data\user\User; use wcf\data\user\UserEditor; use wcf\system\user\group\assignment\UserGroupAssignmentHandler; @@ -12,6 +11,14 @@ use wcf\system\user\storage\UserStorageHandler; use wcf\system\user\UserProfileHandler; use wcf\system\WCF; +/** + * Sets the avatar of a user. + * + * @author Olaf Braun + * @copyright 2001-2024 WoltLab GmbH + * @license GNU Lesser General Public License + * @since 6.2 + */ final class SetAvatar { public function __construct( @@ -26,11 +33,6 @@ final class SetAvatar (new FileAction([$this->user->avatarFileID], 'delete'))->executeAction(); } - // Delete old `UserAvatar` object if provided - if ($this->user->avatarID) { - (new UserAvatarAction([$this->user->avatarID], 'delete'))->executeAction(); - } - (new UserEditor($this->user))->update([ 'avatarFileID' => $this->file?->fileID, 'avatarID' => null, -- 2.20.1