Skip to content

Commit 4a6b290

Browse files
committed
Remove unnecessary code
Add some comments
1 parent 0f6732c commit 4a6b290

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

wcfsetup/install/files/lib/data/attachment/AttachmentList.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private function loadFiles(): void
5353
FileRuntimeCache::getInstance()->cacheObjectIDs($fileIDs);
5454

5555
foreach ($this->objects as $attachment) {
56-
$file = FileRuntimeCache::getInstance()->getObject($attachment->fileID) ?? null;
56+
$file = FileRuntimeCache::getInstance()->getObject($attachment->fileID);
5757
if ($file !== null) {
5858
$attachment->setFile($file);
5959
}

wcfsetup/install/files/lib/data/user/UserProfile.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ public function getAvatar()
391391
return $this->avatar;
392392
}
393393

394+
/**
395+
* Sets the user's avatar.
396+
*
397+
* @since 6.2
398+
*/
394399
public function setFileAvatar(File $file): void
395400
{
396401
$this->avatar = new AvatarDecorator($file);

wcfsetup/install/files/lib/system/file/processor/UserAvatarFileProcessor.class.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function adopt(File $file, array $context): void
6565
return;
6666
}
6767

68-
// Save the `fileID` in the session variable so that the current user can delete it the old avatar
68+
// Save the `fileID` in the session variable so that the current user can delete the old avatar
6969
if ($user->avatarFileID !== null) {
7070
WCF::getSession()->register(\sprintf(self::SESSION_VARIABLE, $user->avatarFileID), TIME_NOW);
7171
WCF::getSession()->update();
@@ -146,11 +146,6 @@ public function canDownload(File $file): bool
146146
public function getThumbnailFormats(): array
147147
{
148148
return [
149-
// TODO did we need thumbnails for sizes less then 128x128?
150-
// 96x96
151-
// 64x64
152-
// 48x48
153-
// 32x32
154149
new ThumbnailFormat(
155150
'128',
156151
UserAvatarFileProcessor::AVATAR_SIZE,

0 commit comments

Comments
 (0)