Split long method calls into multiple lines
authorMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 19:06:12 +0000 (21:06 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 19:06:20 +0000 (21:06 +0200)
wcfsetup/install/files/lib/data/article/ArticleAction.class.php
wcfsetup/install/files/lib/data/article/LikeableArticle.class.php
wcfsetup/install/files/lib/data/comment/CommentAction.class.php
wcfsetup/install/files/lib/data/comment/LikeableComment.class.php
wcfsetup/install/files/lib/data/comment/response/LikeableCommentResponse.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php
wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php
wcfsetup/install/files/lib/system/worker/ArticleRebuildDataWorker.class.php

index 40346f132c6fb978badc776cc831659f5e563762..cd57ca28fbd8796611ddab1112074271c1755169 100644 (file)
@@ -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'])) {
index ca74ce0768467bdb1862ae89a05e38b8533b25e8..cc99ab4304ebab8baf6f58d4a299ba7eda8f4eaf 100644 (file)
@@ -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]
+                       );
                }
                */
        }
index 828e71c867c0e992fb8223e750d928cfac80a7f9..41ea0b5284f2045bd657beef85880141810a6c06 100644 (file)
@@ -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
+                                                       ]
+                                               );
                                        }
                                }
                        }
index e8fb9f77599e014e1cd07bf76854ac6948881572..f811f3ee23efecd0c467958e03c008974d909c2d 100644 (file)
@@ -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
+                                       ]
+                               );
                        }
                }
        }
index 8133180413245bba66383773e0b6af044b5e94b3..170ebbf9ff8e122effa24975072630a4865bd9ba 100644 (file)
@@ -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
+                                       ]
+                               );
                        }
                }
        }
index 8aed582883709afccc7998d119a6bc593ccbfe67..cb3c38445cfc6665c992fa029256843a7db6104e 100644 (file)
@@ -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']);
index 54b21b2c24e95419cd25b6c94e65a61beea7d21f..5de9ee1ddddf85a17d8fc1285eefb876094df0b7 100644 (file)
@@ -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
+                               );
                        }
                }
        }
index 40e5d86f70bb47641378a26a272567451eb5a5bb..690a4b1e8d968dabcd5c464e9b27cace7a3e4dcf 100644 (file)
@@ -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