From: Matthias Schmidt Date: Sat, 30 Jul 2016 19:06:12 +0000 (+0200) Subject: Split long method calls into multiple lines X-Git-Tag: 3.0.0_Beta_1~862 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e5adfbe2d257ba76b76efb6c8cf6469188af512c;p=GitHub%2FWoltLab%2FWCF.git Split long method calls into multiple lines --- diff --git a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php index 40346f132c..cd57ca28fb 100644 --- a/wcfsetup/install/files/lib/data/article/ArticleAction.class.php +++ b/wcfsetup/install/files/lib/data/article/ArticleAction.class.php @@ -81,7 +81,17 @@ class ArticleAction extends AbstractDatabaseObjectAction { } // update search index - SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser); + SearchIndexManager::getInstance()->set( + 'com.woltlab.wcf.article', + $articleContent->articleContentID, + $articleContent->content, + $articleContent->title, + $article->time, + $article->userID, + $article->username, + $languageID ?: null, + $articleContent->teaser + ); // save embedded objects if (!empty($content['htmlInputProcessor'])) { @@ -149,7 +159,17 @@ class ArticleAction extends AbstractDatabaseObjectAction { } // update search index - SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $article->time, $article->userID, $article->username, ($languageID ?: null), $articleContent->teaser); + SearchIndexManager::getInstance()->set( + 'com.woltlab.wcf.article', + $articleContent->articleContentID, + $articleContent->content, + $articleContent->title, + $article->time, + $article->userID, + $article->username, + $languageID ?: null, + $articleContent->teaser + ); // save embedded objects if (!empty($content['htmlInputProcessor'])) { diff --git a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php index ca74ce0768..cc99ab4304 100644 --- a/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php +++ b/wcfsetup/install/files/lib/data/article/LikeableArticle.class.php @@ -66,9 +66,13 @@ class LikeableArticle extends AbstractLikeObject { /* @todo if ($this->getDecoratedObject()->userID != WCF::getUser()->userID) { $notificationObject = new LikeUserNotificationObject($like); - UserNotificationHandler::getInstance()->fireEvent('like', 'com.woltlab.wcf.likeableArticle.notification', $notificationObject, [$this->getDecoratedObject()->userID], [ - 'objectID' => $this->getDecoratedObject()->articleID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'like', + 'com.woltlab.wcf.likeableArticle.notification', + $notificationObject, + [$this->getDecoratedObject()->userID], + ['objectID' => $this->getDecoratedObject()->articleID] + ); } */ } diff --git a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php index 828e71c867..41ea0b5284 100644 --- a/wcfsetup/install/files/lib/data/comment/CommentAction.class.php +++ b/wcfsetup/install/files/lib/data/comment/CommentAction.class.php @@ -264,15 +264,24 @@ class CommentAction extends AbstractDatabaseObjectAction { $recipientIDs = array_diff($recipientIDs, [WCF::getUser()->userID]); if (!empty($recipientIDs)) { - UserNotificationHandler::getInstance()->fireEvent('comment', $objectType->objectType . '.notification', $notificationObject, $recipientIDs); + UserNotificationHandler::getInstance()->fireEvent( + 'comment', + $objectType->objectType . '.notification', + $notificationObject, + $recipientIDs + ); } } else { $userID = $notificationObjectType->getOwnerID($this->createdComment->commentID); if ($userID != WCF::getUser()->userID) { - UserNotificationHandler::getInstance()->fireEvent('comment', $objectType->objectType . '.notification', $notificationObject, [$userID], [ - 'objectUserID' => $userID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'comment', + $objectType->objectType . '.notification', + $notificationObject, + [$userID], + ['objectUserID' => $userID] + ); } } } @@ -382,34 +391,51 @@ class CommentAction extends AbstractDatabaseObjectAction { $recipientIDs = array_diff($recipientIDs, [WCF::getUser()->userID]); if (!empty($recipientIDs)) { - UserNotificationHandler::getInstance()->fireEvent('commentResponse', $objectType->objectType.'.response.notification', $notificationObject, $recipientIDs, [ - 'commentID' => $this->comment->commentID, - 'objectID' => $this->comment->objectID, - 'userID' => $this->comment->userID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'commentResponse', + $objectType->objectType . '.response.notification', + $notificationObject, + $recipientIDs, + [ + 'commentID' => $this->comment->commentID, + 'objectID' => $this->comment->objectID, + 'userID' => $this->comment->userID + ] + ); } } else { $userID = $notificationObjectType->getOwnerID($this->comment->commentID); if ($this->comment->userID != WCF::getUser()->userID) { - UserNotificationHandler::getInstance()->fireEvent('commentResponse', $objectType->objectType.'.response.notification', $notificationObject, [$this->comment->userID], [ - 'commentID' => $this->comment->commentID, - 'objectID' => $this->comment->objectID, - 'objectUserID' => $userID, - 'userID' => $this->comment->userID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'commentResponse', + $objectType->objectType . '.response.notification', + $notificationObject, + [$this->comment->userID], + [ + 'commentID' => $this->comment->commentID, + 'objectID' => $this->comment->objectID, + 'objectUserID' => $userID, + 'userID' => $this->comment->userID + ] + ); } // notify the container owner if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.notification')) { if ($userID != $this->comment->userID && $userID != WCF::getUser()->userID) { - UserNotificationHandler::getInstance()->fireEvent('commentResponseOwner', $objectType->objectType . '.response.notification', $notificationObject, [$userID], [ - 'commentID' => $this->comment->commentID, - 'objectID' => $this->comment->objectID, - 'objectUserID' => $userID, - 'userID' => $this->comment->userID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'commentResponseOwner', + $objectType->objectType . '.response.notification', + $notificationObject, + [$userID], [ + 'commentID' => $this->comment->commentID, + 'objectID' => $this->comment->objectID, + 'objectUserID' => $userID, + 'userID' => $this->comment->userID + ] + ); } } } diff --git a/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php b/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php index e8fb9f7759..f811f3ee23 100644 --- a/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php +++ b/wcfsetup/install/files/lib/data/comment/LikeableComment.class.php @@ -65,10 +65,16 @@ class LikeableComment extends AbstractLikeObject { if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.like.notification')) { if ($this->userID != WCF::getUser()->userID) { $notificationObject = new LikeUserNotificationObject($like); - UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.like.notification', $notificationObject, [$this->userID], [ - 'objectID' => $this->getDecoratedObject()->objectID, - 'objectOwnerID' => $this->userID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'like', + $objectType->objectType . '.like.notification', + $notificationObject, + [$this->userID], + [ + 'objectID' => $this->getDecoratedObject()->objectID, + 'objectOwnerID' => $this->userID + ] + ); } } } diff --git a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php index 8133180413..170ebbf9ff 100644 --- a/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php +++ b/wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php @@ -67,11 +67,17 @@ class LikeableCommentResponse extends AbstractLikeObject { if (UserNotificationHandler::getInstance()->getObjectTypeID($objectType->objectType.'.response.like.notification')) { if ($this->userID != WCF::getUser()->userID) { $notificationObject = new LikeUserNotificationObject($like); - UserNotificationHandler::getInstance()->fireEvent('like', $objectType->objectType.'.response.like.notification', $notificationObject, [$this->userID], [ - 'commentID' => $comment->commentID, - 'commentUserID' => $comment->userID, - 'objectID' => $comment->objectID - ]); + UserNotificationHandler::getInstance()->fireEvent( + 'like', + $objectType->objectType . '.response.like.notification', + $notificationObject, + [$this->userID], + [ + 'commentID' => $comment->commentID, + 'commentUserID' => $comment->userID, + 'objectID' => $comment->objectID + ] + ); } } } diff --git a/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php b/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php index 8aed582883..cb3c38445c 100644 --- a/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php +++ b/wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php @@ -81,7 +81,12 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU ]); // send notification - UserNotificationHandler::getInstance()->fireEvent('following', 'com.woltlab.wcf.user.follow', new UserFollowUserNotificationObject($follow), [$follow->followUserID]); + UserNotificationHandler::getInstance()->fireEvent( + 'following', + 'com.woltlab.wcf.user.follow', + new UserFollowUserNotificationObject($follow), + [$follow->followUserID] + ); // fire activity event UserActivityEventHandler::getInstance()->fireEvent('com.woltlab.wcf.user.recentActivityEvent.follow', $this->parameters['data']['userID']); diff --git a/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php b/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php index 54b21b2c24..5de9ee1ddd 100644 --- a/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php @@ -123,7 +123,13 @@ class UserObjectWatchHandler extends SingletonFactory { if (!empty($recipientIDs)) { // create notifications - UserNotificationHandler::getInstance()->fireEvent($notificationEventName, $notificationObjectType, $notificationObject, $recipientIDs, $additionalData); + UserNotificationHandler::getInstance()->fireEvent( + $notificationEventName, + $notificationObjectType, + $notificationObject, + $recipientIDs, + $additionalData + ); } } } diff --git a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php index 40e5d86f70..690a4b1e8d 100644 --- a/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php @@ -73,7 +73,17 @@ class ArticleRebuildDataWorker extends AbstractRebuildDataWorker { $comments[$articleContent->articleID] += $row['comments'] + $row['responses']; // update search index - SearchIndexManager::getInstance()->set('com.woltlab.wcf.article', $articleContent->articleContentID, $articleContent->content, $articleContent->title, $articles[$articleContent->articleID]->time, $articles[$articleContent->articleID]->userID, $articles[$articleContent->articleID]->username, $articleContent->languageID, $articleContent->teaser); + SearchIndexManager::getInstance()->set( + 'com.woltlab.wcf.article', + $articleContent->articleContentID, + $articleContent->content, + $articleContent->title, + $articles[$articleContent->articleID]->time, + $articles[$articleContent->articleID]->userID, + $articles[$articleContent->articleID]->username, + $articleContent->languageID, + $articleContent->teaser + ); } // fetch cumulative likes