Split long method calls into multiple lines
authorMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 19:04:12 +0000 (21:04 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 30 Jul 2016 19:04:12 +0000 (21:04 +0200)
files/lib/data/conversation/ConversationAction.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php
files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php

index a18523cf7c86dc1c3dcb0415d9b81020e1840755..07a1a1ac3651775f649644b221b0502425e7ebf4 100644 (file)
@@ -121,7 +121,12 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                if (!$conversation->isDraft) {
                        // fire notification event
                        $notificationRecipients = array_merge((!empty($this->parameters['participants']) ? $this->parameters['participants'] : []), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : []));
-                       UserNotificationHandler::getInstance()->fireEvent('conversation', 'com.woltlab.wcf.conversation.notification', new ConversationUserNotificationObject($conversation), $notificationRecipients);
+                       UserNotificationHandler::getInstance()->fireEvent(
+                               'conversation',
+                               'com.woltlab.wcf.conversation.notification',
+                               new ConversationUserNotificationObject($conversation),
+                               $notificationRecipients
+                       );
                }
                
                return $conversation;
@@ -181,7 +186,12 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                                        UserStorageHandler::getInstance()->reset($newParticipantIDs, 'conversationCount');
                                        
                                        // fire notification event
-                                       UserNotificationHandler::getInstance()->fireEvent('conversation', 'com.woltlab.wcf.conversation.notification', new ConversationUserNotificationObject($conversation->getDecoratedObject()), $newParticipantIDs);
+                                       UserNotificationHandler::getInstance()->fireEvent(
+                                               'conversation',
+                                               'com.woltlab.wcf.conversation.notification',
+                                               new ConversationUserNotificationObject($conversation->getDecoratedObject()),
+                                               $newParticipantIDs
+                                       );
                                }
                        }
                        
index 00f0b05a1e98986876b4b98350719b6e2c763929..7b538c3ecaf38d6bd495aa940747de8ea838c1e3 100644 (file)
@@ -110,7 +110,12 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        if (!$conversation->isDraft) {
                                $notificationRecipients = array_diff($conversation->getParticipantIDs(true), [$message->userID]); // don't notify message author
                                if (!empty($notificationRecipients)) {
-                                       UserNotificationHandler::getInstance()->fireEvent('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', new ConversationMessageUserNotificationObject($message), $notificationRecipients);
+                                       UserNotificationHandler::getInstance()->fireEvent(
+                                               'conversationMessage',
+                                               'com.woltlab.wcf.conversation.message.notification',
+                                               new ConversationMessageUserNotificationObject($message),
+                                               $notificationRecipients
+                                       );
                                }
                        }
                        
@@ -145,7 +150,15 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                UserStorageHandler::getInstance()->reset($conversation->getParticipantIDs(), 'unreadConversationCount');
                
                // update search index
-               SearchIndexManager::getInstance()->set('com.woltlab.wcf.conversation.message', $message->messageID, $message->message, (!empty($this->parameters['isFirstPost']) ? $conversation->subject : ''), $message->time, $message->userID, $message->username);
+               SearchIndexManager::getInstance()->set(
+                       'com.woltlab.wcf.conversation.message',
+                       $message->messageID,
+                       $message->message,
+                       !empty($this->parameters['isFirstPost']) ? $conversation->subject : '',
+                       $message->time,
+                       $message->userID,
+                       $message->username
+               );
                
                // update attachments
                if (isset($this->parameters['attachmentHandler']) && $this->parameters['attachmentHandler'] !== null) {
@@ -193,7 +206,15 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                if (isset($this->parameters['data']) && isset($this->parameters['data']['message'])) {
                        foreach ($this->getObjects() as $message) {
                                $conversation = $message->getConversation();
-                               SearchIndexManager::getInstance()->set('com.woltlab.wcf.conversation.message', $message->messageID, $this->parameters['data']['message'], ($conversation->firstMessageID == $message->messageID ? $conversation->subject : ''), $message->time, $message->userID, $message->username);
+                               SearchIndexManager::getInstance()->set(
+                                       'com.woltlab.wcf.conversation.message',
+                                       $message->messageID,
+                                       $this->parameters['data']['message'],
+                                       $conversation->firstMessageID == $message->messageID ? $conversation->subject : '',
+                                       $message->time,
+                                       $message->userID,
+                                       $message->username
+                               );
                                
                                if (!empty($this->parameters['htmlInputProcessor'])) {
                                        /** @noinspection PhpUndefinedMethodInspection */
@@ -572,7 +593,12 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                );
                
                if ($quoteID === false) {
-                       $removeQuoteID = MessageQuoteManager::getInstance()->getQuoteID('com.woltlab.wcf.conversation.message', $this->message->messageID, $this->message->getExcerpt(), $this->message->getMessage());
+                       $removeQuoteID = MessageQuoteManager::getInstance()->getQuoteID(
+                               'com.woltlab.wcf.conversation.message',
+                               $this->message->messageID,
+                               $this->message->getExcerpt(),
+                               $this->message->getMessage()
+                       );
                        MessageQuoteManager::getInstance()->removeQuote($removeQuoteID);
                }
                
@@ -605,7 +631,13 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         * @inheritDoc
         */
        public function saveQuote() {
-               $quoteID = MessageQuoteManager::getInstance()->addQuote('com.woltlab.wcf.conversation.message', $this->message->conversationID, $this->message->messageID, $this->parameters['message'], false);
+               $quoteID = MessageQuoteManager::getInstance()->addQuote(
+                       'com.woltlab.wcf.conversation.message',
+                       $this->message->conversationID,
+                       $this->message->messageID,
+                       $this->parameters['message'],
+                       false
+               );
                
                $returnValues = [
                        'count' => MessageQuoteManager::getInstance()->countQuotes(),
index 8f7db90b80704add1d844bc5d447d64faf26a3d8..7bb1cd5469bc50b8df78c547c734895328e5b906 100644 (file)
@@ -71,7 +71,15 @@ class ConversationMessageRebuildDataWorker extends AbstractRebuildDataWorker {
                $attachmentStatement = WCF::getDB()->prepareStatement($sql);
                
                foreach ($this->objectList as $message) {
-                       SearchIndexManager::getInstance()->set('com.woltlab.wcf.conversation.message', $message->messageID, $message->message, ($message->subject ?: ''), $message->time, $message->userID, $message->username);
+                       SearchIndexManager::getInstance()->set(
+                               'com.woltlab.wcf.conversation.message',
+                               $message->messageID,
+                               $message->message, 
+                               $message->subject ?: '',
+                               $message->time,
+                               $message->userID,
+                               $message->username
+                       );
                        
                        $editor = new ConversationMessageEditor($message);
                        $data = [];