From 381191f4f1e26cdfff406e4ac6240c063d816068 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 25 Jan 2021 16:05:43 +0100 Subject: [PATCH] Stop using `TLegacyUserPropertyAccess` (and associated legacy `__get()`) Close #146 --- .../ViewableConversation.class.php | 46 ------------------- .../ViewableConversationMessage.class.php | 3 -- ...wableConversationModificationLog.class.php | 3 -- 3 files changed, 52 deletions(-) diff --git a/files/lib/data/conversation/ViewableConversation.class.php b/files/lib/data/conversation/ViewableConversation.class.php index 3d1877e..165c2ba 100644 --- a/files/lib/data/conversation/ViewableConversation.class.php +++ b/files/lib/data/conversation/ViewableConversation.class.php @@ -5,7 +5,6 @@ namespace wcf\data\conversation; use wcf\data\conversation\label\ConversationLabel; use wcf\data\conversation\label\ConversationLabelList; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\User; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; @@ -27,8 +26,6 @@ use wcf\system\WCF; */ class ViewableConversation extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * participant summary * @var string @@ -64,49 +61,6 @@ class ViewableConversation extends DatabaseObjectDecorator */ protected static $baseClass = Conversation::class; - /** - * maps legacy direct access to last poster's user profile data to the real - * user profile property names - * @var string[] - * @deprecated - */ - protected static $__lastUserAvatarPropertyMapping = [ - 'lastPosterAvatarID' => 'avatarID', - 'lastPosterAvatarName' => 'avatarName', - 'lastPosterAvatarExtension' => 'avatarExtension', - 'lastPosterAvatarWidth' => 'width', - 'lastPosterAvatarHeight' => 'height', - 'lastPosterEmail' => 'email', - 'lastPosterDisableAvatar' => 'disableAvatar', - 'lastPosterEnableGravatar' => 'enableGravatar', - 'lastPosterGravatarFileExtension' => 'gravatarFileExtension', - 'lastPosterAvatarFileHash' => 'fileHash', - ]; - - /** - * @inheritDoc - * @deprecated - */ - public function __get($name) - { - $value = parent::__get($name); - if ($value !== null) { - return $value; - } elseif (\array_key_exists($name, $this->object->data)) { - return; - } - - /** @noinspection PhpVariableVariableInspection */ - $value = $this->getUserProfile()->{$name}; - if ($value !== null) { - return $value; - } - - if (isset(static::$__lastUserAvatarPropertyMapping[$name])) { - return $this->getLastPosterProfile()->getAvatar()->{static::$__lastUserAvatarPropertyMapping[$name]}; - } - } - /** * Returns the user profile object. * diff --git a/files/lib/data/conversation/message/ViewableConversationMessage.class.php b/files/lib/data/conversation/message/ViewableConversationMessage.class.php index e5023ed..2315d46 100644 --- a/files/lib/data/conversation/message/ViewableConversationMessage.class.php +++ b/files/lib/data/conversation/message/ViewableConversationMessage.class.php @@ -3,7 +3,6 @@ namespace wcf\data\conversation\message; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; @@ -20,8 +19,6 @@ use wcf\system\cache\runtime\UserProfileRuntimeCache; */ class ViewableConversationMessage extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * @inheritDoc */ diff --git a/files/lib/data/modification/log/ViewableConversationModificationLog.class.php b/files/lib/data/modification/log/ViewableConversationModificationLog.class.php index e745412..210e1e5 100644 --- a/files/lib/data/modification/log/ViewableConversationModificationLog.class.php +++ b/files/lib/data/modification/log/ViewableConversationModificationLog.class.php @@ -3,7 +3,6 @@ namespace wcf\data\modification\log; use wcf\data\DatabaseObjectDecorator; -use wcf\data\TLegacyUserPropertyAccess; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\WCF; @@ -21,8 +20,6 @@ use wcf\system\WCF; */ class ViewableConversationModificationLog extends DatabaseObjectDecorator { - use TLegacyUserPropertyAccess; - /** * @inheritDoc */ -- 2.20.1