From ecb2407c68f86de827bed9ff29853910669e1643 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Fri, 6 May 2022 23:47:11 +0200 Subject: [PATCH] Use generic trait in existing notifications for article comments --- ...esponseOwnerUserNotificationEvent.class.php | 17 +---------------- ...mentResponseUserNotificationEvent.class.php | 18 +----------------- ...ticleCommentUserNotificationEvent.class.php | 18 +----------------- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php index a11025d351..34a82743b5 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseOwnerUserNotificationEvent.class.php @@ -2,12 +2,10 @@ namespace wcf\system\user\notification\event; -use wcf\data\article\category\ArticleCategory; use wcf\data\user\UserProfile; use wcf\system\cache\runtime\CommentRuntimeCache; use wcf\system\cache\runtime\UserProfileRuntimeCache; use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache; -use wcf\system\comment\CommentHandler; use wcf\system\email\Email; use wcf\system\user\notification\object\CommentResponseUserNotificationObject; @@ -26,7 +24,7 @@ class ArticleCommentResponseOwnerUserNotificationEvent extends AbstractSharedUse ITestableUserNotificationEvent { use TTestableCommentResponseUserNotificationEvent; - use TTestableArticleUserNotificationEvent; + use TTestableArticleCommentUserNotificationEvent; use TTestableCategorizedUserNotificationEvent; /** @@ -154,17 +152,4 @@ class ArticleCommentResponseOwnerUserNotificationEvent extends AbstractSharedUse { return \sha1($this->eventID . '-' . $this->notification->objectID); } - - /** - * @inheritDoc - */ - protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) - { - return [ - 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author) - ->getArticleContent() - ->articleContentID, - 'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment'), - ]; - } } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php index d99a8465a7..6e49b82cce 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentResponseUserNotificationEvent.class.php @@ -2,11 +2,8 @@ namespace wcf\system\user\notification\event; -use wcf\data\article\category\ArticleCategory; -use wcf\data\user\UserProfile; use wcf\system\cache\runtime\CommentRuntimeCache; use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache; -use wcf\system\comment\CommentHandler; use wcf\system\email\Email; use wcf\system\user\notification\object\CommentResponseUserNotificationObject; @@ -25,7 +22,7 @@ class ArticleCommentResponseUserNotificationEvent extends AbstractSharedUserNoti ITestableUserNotificationEvent { use TTestableCommentResponseUserNotificationEvent; - use TTestableArticleUserNotificationEvent; + use TTestableArticleCommentUserNotificationEvent; use TTestableCategorizedUserNotificationEvent; /** @@ -134,17 +131,4 @@ class ArticleCommentResponseUserNotificationEvent extends AbstractSharedUserNoti { return \sha1($this->eventID . '-' . $this->notification->objectID); } - - /** - * @inheritDoc - */ - protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) - { - return [ - 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author) - ->getArticleContent() - ->articleContentID, - 'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment'), - ]; - } } diff --git a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentUserNotificationEvent.class.php b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentUserNotificationEvent.class.php index 5661542dd2..241a75bc0a 100644 --- a/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentUserNotificationEvent.class.php +++ b/wcfsetup/install/files/lib/system/user/notification/event/ArticleCommentUserNotificationEvent.class.php @@ -2,10 +2,7 @@ namespace wcf\system\user\notification\event; -use wcf\data\article\category\ArticleCategory; -use wcf\data\user\UserProfile; use wcf\system\cache\runtime\ViewableArticleContentRuntimeCache; -use wcf\system\comment\CommentHandler; use wcf\system\user\notification\object\CommentUserNotificationObject; /** @@ -23,7 +20,7 @@ class ArticleCommentUserNotificationEvent extends AbstractSharedUserNotification ITestableUserNotificationEvent { use TTestableCommentUserNotificationEvent; - use TTestableArticleUserNotificationEvent; + use TTestableArticleCommentUserNotificationEvent; use TTestableCategorizedUserNotificationEvent; /** @@ -120,17 +117,4 @@ class ArticleCommentUserNotificationEvent extends AbstractSharedUserNotification { return \sha1($this->eventID . '-' . $this->getUserNotificationObject()->objectID); } - - /** - * @inheritDoc - */ - protected static function getTestCommentObjectData(UserProfile $recipient, UserProfile $author) - { - return [ - 'objectID' => self::getTestArticle(self::createTestCategory(ArticleCategory::OBJECT_TYPE_NAME), $author) - ->getArticleContent() - ->articleContentID, - 'objectTypeID' => CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.articleComment'), - ]; - } } -- 2.20.1