Replace old array syntax with new syntax
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 08:44:33 +0000 (10:44 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 08:44:33 +0000 (10:44 +0200)
28 files changed:
files/lib/data/conversation/ConversationParticipantList.class.php
files/lib/data/conversation/FeedConversation.class.php
files/lib/data/conversation/label/ConversationLabelAction.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php
files/lib/data/conversation/message/SearchResultConversationMessage.class.php
files/lib/data/modification/log/ConversationLogModificationLogList.class.php
files/lib/form/ConversationAddForm.class.php
files/lib/form/ConversationMessageAddForm.class.php
files/lib/form/ConversationMessageEditForm.class.php
files/lib/page/ConversationFeedPage.class.php
files/lib/page/ConversationPage.class.php
files/lib/system/attachment/ConversationMessageAttachmentObjectType.class.php
files/lib/system/clipboard/action/ConversationClipboardAction.class.php
files/lib/system/conversation/ConversationHandler.class.php
files/lib/system/importer/ConversationAttachmentImporter.class.php
files/lib/system/importer/ConversationImporter.class.php
files/lib/system/importer/ConversationLabelImporter.class.php
files/lib/system/importer/ConversationMessageImporter.class.php
files/lib/system/importer/ConversationUserImporter.class.php
files/lib/system/message/quote/ConversationMessageQuoteHandler.class.php
files/lib/system/moderation/queue/report/ConversationMessageModerationQueueReportHandler.class.php
files/lib/system/stat/ConversationMessageStatDailyHandler.class.php
files/lib/system/stat/ConversationStatDailyHandler.class.php
files/lib/system/user/notification/event/ConversationMessageUserNotificationEvent.class.php
files/lib/system/user/notification/event/ConversationUserNotificationEvent.class.php
files/lib/system/user/notification/object/type/ConversationNotificationObjectType.class.php
files/lib/system/worker/ConversationMessageRebuildDataWorker.class.php
files/lib/system/worker/ConversationRebuildDataWorker.class.php

index 87d2dd8c5043d3185d04ebb842aefce86c10b99a..438dae7c18dfb9fc3455c06e67e0de3ba12ae595 100644 (file)
@@ -36,10 +36,10 @@ class ConversationParticipantList extends UserProfileList {
                parent::__construct();
                
                $this->conversationID = $conversationID;
-               $this->getConditionBuilder()->add('conversation_to_user.conversationID = ?', array($conversationID));
+               $this->getConditionBuilder()->add('conversation_to_user.conversationID = ?', [$conversationID]);
                if (!$isAuthor) {
                        if ($userID) {
-                               $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0 OR conversation_to_user.participantID = ?', array($userID));
+                               $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0 OR conversation_to_user.participantID = ?', [$userID]);
                        }
                        else {
                                $this->getConditionBuilder()->add('conversation_to_user.isInvisible = 0');
@@ -70,7 +70,7 @@ class ConversationParticipantList extends UserProfileList {
         * @see \wcf\data\DatabaseObjectList::readObjectIDs()
         */
        public function readObjectIDs() {
-               $this->objectIDs = array();
+               $this->objectIDs = [];
                $sql = "SELECT  conversation_to_user.participantID AS objectID
                        FROM    wcf".WCF_N."_conversation_to_user conversation_to_user
                                ".$this->sqlConditionJoins."
@@ -93,7 +93,7 @@ class ConversationParticipantList extends UserProfileList {
                        WHERE   conversationID = ?
                                AND participantID IS NULL";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->conversationID));
+               $statement->execute([$this->conversationID]);
                $i = 0;
                while ($row = $statement->fetchArray()) {
                        // create fake user profiles
index b7e434a6be698defa4ef02c41d34d0f8532ff713..38e23181a024bef617bdcf0bc9b11a2f21d0a8ff 100644 (file)
@@ -24,11 +24,11 @@ class FeedConversation extends DatabaseObjectDecorator implements IFeedEntry {
         * @see \wcf\data\ILinkableObject::getLink()
         */
        public function getLink() {
-               return LinkHandler::getInstance()->getLink('Conversation', array(
+               return LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $this->getDecoratedObject(),
                        'appendSession' => false,
                        'encodeTitle' => true
-               ));
+               ]);
        }
        
        /**
@@ -98,7 +98,7 @@ class FeedConversation extends DatabaseObjectDecorator implements IFeedEntry {
         * @see \wcf\data\IFeedEntry::getCategories()
         */
        public function getCategories() {
-               return array();
+               return [];
        }
        
        /**
index 10859ecb282409bcd22ef1c31ac69f62f610f84b..6a0c96d09ae41688e3efd5f5281ca8446fddd732 100644 (file)
@@ -30,12 +30,12 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('user.conversation.canUseConversation');
+       protected $permissionsDelete = ['user.conversation.canUseConversation'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('user.conversation.canUseConversation');
+       protected $permissionsUpdate = ['user.conversation.canUseConversation'];
        
        /**
         * conversation object
@@ -110,18 +110,18 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
         * @return      array
         */
        public function add() {
-               $label = ConversationLabelEditor::create(array(
+               $label = ConversationLabelEditor::create([
                        'userID' => WCF::getUser()->userID,
                        'label' => $this->parameters['data']['labelName'],
                        'cssClassName' => $this->parameters['data']['cssClassName']
-               ));
+               ]);
                
-               return array(
+               return [
                        'actionName' => 'add',
                        'cssClassName' => $label->cssClassName,
                        'label' => StringUtil::encodeHTML($label->label),
                        'labelID' => $label->labelID
-               );
+               ];
        }
        
        /**
@@ -133,7 +133,7 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
                }
                
                // validate conversation id
-               $this->parameters['conversationIDs'] = (isset($this->parameters['conversationIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : array();
+               $this->parameters['conversationIDs'] = (isset($this->parameters['conversationIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : [];
                if (empty($this->parameters['conversationIDs'])) {
                        throw new UserInputException('conversationID');
                }
@@ -156,19 +156,19 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
         */
        public function getLabelForm() {
                // read assigned labels
-               $labelIDs = array();
+               $labelIDs = [];
                foreach ($this->labelList as $label) {
                        $labelIDs[] = $label->labelID;
                }
                
-               $assignedLabels = array();
+               $assignedLabels = [];
                // read assigned labels if editing single conversation
                if (count($this->parameters['conversationIDs']) == 1) {
                        $conversationID = current($this->parameters['conversationIDs']);
                        
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("conversationID = ?", array($conversationID));
-                       $conditions->add("labelID IN (?)", array($labelIDs));
+                       $conditions->add("conversationID = ?", [$conversationID]);
+                       $conditions->add("labelID IN (?)", [$labelIDs]);
                        
                        $sql = "SELECT  labelID
                                FROM    wcf".WCF_N."_conversation_label_to_object
@@ -178,16 +178,16 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
                        $assignedLabels = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'assignedLabels' => $assignedLabels,
                        'conversation' => $this->conversation,
                        'labelList' => $this->labelList
-               ));
+               ]);
                
-               return array(
+               return [
                        'actionName' => 'getLabelForm',
                        'template' => WCF::getTPL()->fetch('conversationLabelAssignment')
-               );
+               ];
        }
        
        /**
@@ -197,7 +197,7 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
                $this->validateGetLabelForm();
                
                // validate given labels
-               $this->parameters['labelIDs'] = (isset($this->parameters['labelIDs']) && is_array($this->parameters['labelIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['labelIDs']) : array();
+               $this->parameters['labelIDs'] = (isset($this->parameters['labelIDs']) && is_array($this->parameters['labelIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['labelIDs']) : [];
                if (!empty($this->parameters['labelIDs'])) {
                        foreach ($this->parameters['labelIDs'] as $labelID) {
                                $isValid = false;
@@ -223,14 +223,14 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
         */
        public function assignLabel() {
                // remove previous labels (if any)
-               $labelIDs = array();
+               $labelIDs = [];
                foreach ($this->labelList as $label) {
                        $labelIDs[] = $label->labelID;
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("conversationID IN (?)", array($this->parameters['conversationIDs']));
-               $conditions->add("labelID IN (?)", array($labelIDs));
+               $conditions->add("conversationID IN (?)", [$this->parameters['conversationIDs']]);
+               $conditions->add("labelID IN (?)", [$labelIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_conversation_label_to_object
                        ".$conditions;
@@ -247,10 +247,10 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
                        WCF::getDB()->beginTransaction();
                        foreach ($this->parameters['labelIDs'] as $labelID) {
                                foreach ($this->parameters['conversationIDs'] as $conversationID) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $labelID,
                                                $conversationID
-                                       ));
+                                       ]);
                                }
                        }
                        WCF::getDB()->commitTransaction();
@@ -260,9 +260,9 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction {
                        }
                }
                
-               return array(
+               return [
                        'actionName' => 'assignLabel',
                        'labelIDs' => $this->parameters['labelIDs']
-               );
+               ];
        }
 }
index fe572cbc1225859a809e1299630b61dc74367cb9..d0015c9abd0f4abf65d3978d71b8afb0ecd4373c 100644 (file)
@@ -93,7 +93,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        
                        // fire notification event
                        if (!$conversation->isDraft) {
-                               $notificationRecipients = array_diff($conversation->getParticipantIDs(true), array($message->userID)); // don't notify message author
+                               $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);
                                }
@@ -107,7 +107,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                                        WHERE   participantID = ?
                                                AND conversationID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array($message->userID, $conversation->conversationID));
+                               $statement->execute([$message->userID, $conversation->conversationID]);
                                
                                $conversationEditor->updateParticipantSummary();
                                $conversationEditor->updateParticipantCount();
@@ -119,11 +119,11 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                                WHERE   conversationID = ?
                                        AND hideConversation = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                Conversation::STATE_DEFAULT,
                                $conversation->conversationID,
                                Conversation::STATE_HIDDEN
-                       ));
+                       ]);
                }
                
                // reset storage
@@ -139,9 +139,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                
                // save embedded objects
                if (MessageEmbeddedObjectManager::getInstance()->registerObjects('com.woltlab.wcf.conversation.message', $message->messageID, $message->message)) {
-                       $messageEditor->update(array(
+                       $messageEditor->update([
                                'hasEmbeddedObjects' => 1
-                       ));
+                       ]);
                }
                
                // clear quotes
@@ -172,9 +172,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                                SearchIndexManager::getInstance()->update('com.woltlab.wcf.conversation.message', $message->messageID, $this->parameters['data']['message'], ($conversation->firstMessageID == $message->messageID ? $conversation->subject : ''), $message->time, $message->userID, $message->username);
                                
                                if ($message->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects('com.woltlab.wcf.conversation.message', $message->messageID, $this->parameters['data']['message'])) {
-                                       $message->update(array(
+                                       $message->update([
                                                'hasEmbeddedObjects' => ($message->hasEmbeddedObjects ? 0 : 1)
-                                       ));
+                                       ]);
                                }
                        }
                }
@@ -186,7 +186,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function delete() {
                $count = parent::delete();
                
-               $attachmentMessageIDs = $conversationIDs = array();
+               $attachmentMessageIDs = $conversationIDs = [];
                foreach ($this->objects as $message) {
                        if (!in_array($message->conversationID, $conversationIDs)) {
                                $conversationIDs[] = $message->conversationID;
@@ -205,7 +205,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                
                if (!empty($this->objectIDs)) {
                        // delete notifications
-                       UserNotificationHandler::getInstance()->deleteNotifications('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', array(), $this->objectIDs);
+                       UserNotificationHandler::getInstance()->deleteNotifications('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', [], $this->objectIDs);
                        
                        // update search index
                        SearchIndexManager::getInstance()->delete('com.woltlab.wcf.conversation.message', $this->objectIDs);
@@ -258,7 +258,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                if (!$this->conversation->conversationID) {
                        throw new UserInputException('containerID');
                }
-               else if ($this->conversation->isClosed || !Conversation::isParticipant(array($this->conversation->conversationID))) {
+               else if ($this->conversation->isClosed || !Conversation::isParticipant([$this->conversation->conversationID])) {
                        throw new PermissionDeniedException();
                }
                
@@ -282,12 +282,12 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                // quick reply
                if ($this->message === null) {
                        QuickReplyManager::getInstance()->setMessage('conversation', $this->conversation->conversationID, $this->parameters['message']);
-                       $url = LinkHandler::getInstance()->getLink('ConversationMessageAdd', array('id' => $this->conversation->conversationID));
+                       $url = LinkHandler::getInstance()->getLink('ConversationMessageAdd', ['id' => $this->conversation->conversationID]);
                }
                else {
                        // editing message
                        QuickReplyManager::getInstance()->setMessage('conversationMessage', $this->message->messageID, $this->parameters['message']);
-                       $url = LinkHandler::getInstance()->getLink('ConversationMessageEdit', array('id' => $this->message->messageID));
+                       $url = LinkHandler::getInstance()->getLink('ConversationMessageEdit', ['id' => $this->message->messageID]);
                }
                
                if (!empty($this->parameters['tmpHash'])) {
@@ -295,9 +295,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                }
                
                // redirect
-               return array(
+               return [
                        'url' => $url
-               );
+               ];
        }
        
        /**
@@ -312,7 +312,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        throw new UserInputException('containerID');
                }
                
-               if ($this->conversation->isClosed || !Conversation::isParticipant(array($this->conversation->conversationID))) {
+               if ($this->conversation->isClosed || !Conversation::isParticipant([$this->conversation->conversationID])) {
                        throw new PermissionDeniedException();
                }
                
@@ -332,32 +332,32 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function beginEdit() {
                BBCodeHandler::getInstance()->setAllowedBBCodes(explode(',', WCF::getSession()->getPermission('user.message.allowedBBCodes')));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'defaultSmilies' => SmileyCache::getInstance()->getCategorySmilies(),
                        'message' => $this->message,
                        'permissionCanUseSmilies' => 'user.message.canUseSmilies',
                        'wysiwygSelector' => 'messageEditor'.$this->message->messageID
-               ));
+               ]);
                
                if (MODULE_ATTACHMENT) {
                        $tmpHash = StringUtil::getRandomID();
                        $attachmentHandler = new AttachmentHandler('com.woltlab.wcf.conversation.message', $this->message->messageID, $tmpHash);
                        $attachmentList = $attachmentHandler->getAttachmentList();
                                
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'attachmentHandler' => $attachmentHandler,
                                'attachmentList' => $attachmentList->getObjects(),
                                'attachmentObjectID' => $this->message->messageID,
                                'attachmentObjectType' => 'com.woltlab.wcf.conversation.message',
                                'attachmentParentObjectID' => 0,
                                'tmpHash' => $tmpHash
-                       ));
+                       ]);
                }
                
-               return array(
+               return [
                        'actionName' => 'beginEdit',
                        'template' => WCF::getTPL()->fetch('conversationMessageInlineEditor')
-               );
+               ];
        }
        
        /**
@@ -378,15 +378,15 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         * @see \wcf\data\IMessageInlineEditorAction::save()
         */
        public function save() {
-               $data = array(
+               $data = [
                        'message' => PreParser::getInstance()->parse(MessageUtil::stripCrap($this->parameters['data']['message']), explode(',', WCF::getSession()->getPermission('user.message.allowedBBCodes')))
-               );
+               ];
                if (!$this->message->getConversation()->isDraft) {
                        $data['lastEditTime'] = TIME_NOW;
                        $data['editCount'] = $this->message->editCount + 1;
                }
                // execute update action
-               $action = new ConversationMessageAction(array($this->message), 'update', array('data' => $data));
+               $action = new ConversationMessageAction([$this->message], 'update', ['data' => $data]);
                $action->executeAction();
                
                // load new message
@@ -398,10 +398,10 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        $count = 0;
                        if ($attachmentList !== null) {
                                // set permissions
-                               $attachmentList->setPermissions(array(
+                               $attachmentList->setPermissions([
                                        'canDownload' => true,
                                        'canViewPreview' => true
-                               ));
+                               ]);
                                
                                $count = count($attachmentList);
                        }
@@ -409,23 +409,23 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        // update count to reflect number of attachments after edit
                        if ($count != $this->message->attachments) {
                                $messageEditor = new ConversationMessageEditor($this->message);
-                               $messageEditor->update(array('attachments' => $count));
+                               $messageEditor->update(['attachments' => $count]);
                        }
                }
                
                // load embedded objects
-               MessageEmbeddedObjectManager::getInstance()->loadObjects('com.woltlab.wcf.conversation.message', array($this->message->messageID));
+               MessageEmbeddedObjectManager::getInstance()->loadObjects('com.woltlab.wcf.conversation.message', [$this->message->messageID]);
                
-               $data = array(
+               $data = [
                        'actionName' => 'save',
                        'message' => $this->message->getFormattedMessage()
-               );
+               ];
                
                if (MODULE_ATTACHMENT) {
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'attachmentList' => $attachmentList,
                                'objectID' => $this->message->messageID
-                       ));
+                       ]);
                        $data['attachmentList'] = WCF::getTPL()->fetch('attachments');
                }
                
@@ -453,20 +453,20 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
         */
        public function validateMessage(DatabaseObject $container, $message) {
                if (mb_strlen($message) > WCF::getSession()->getPermission('user.conversation.maxLength')) {
-                       throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.tooLong', array('maxTextLength' => WCF::getSession()->getPermission('user.conversation.maxLength'))));
+                       throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.tooLong', ['maxTextLength' => WCF::getSession()->getPermission('user.conversation.maxLength')]));
                }
                
                // search for disallowed bbcodes
                $disallowedBBCodes = BBCodeParser::getInstance()->validateBBCodes($message, explode(',', WCF::getSession()->getPermission('user.message.allowedBBCodes')));
                if (!empty($disallowedBBCodes)) {
-                       throw new UserInputException('text', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', array('disallowedBBCodes' => $disallowedBBCodes)));
+                       throw new UserInputException('text', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', ['disallowedBBCodes' => $disallowedBBCodes]));
                }
                
                // search for censored words
                if (ENABLE_CENSORSHIP) {
                        $result = Censorship::getInstance()->test($message);
                        if ($result) {
-                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.censoredWordsFound', array('censoredWords' => $result)));
+                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.censoredWordsFound', ['censoredWords' => $result]));
                        }
                }
        }
@@ -477,8 +477,8 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function getMessageList(DatabaseObject $conversation, $lastMessageTime) {
                $messageList = new ViewableConversationMessageList();
                $messageList->setConversation($conversation);
-               $messageList->getConditionBuilder()->add("conversation_message.conversationID = ?", array($conversation->conversationID));
-               $messageList->getConditionBuilder()->add("conversation_message.time > ?", array($lastMessageTime));
+               $messageList->getConditionBuilder()->add("conversation_message.conversationID = ?", [$conversation->conversationID]);
+               $messageList->getConditionBuilder()->add("conversation_message.time > ?", [$lastMessageTime]);
                $messageList->sqlOrderBy = "conversation_message.time ".CONVERSATION_LIST_DEFAULT_SORT_ORDER;
                $messageList->readObjects();
                
@@ -493,20 +493,20 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        FROM    wcf".WCF_N."_conversation_message
                        WHERE   conversationID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($conversation->conversationID));
+               $statement->execute([$conversation->conversationID]);
                $count = $statement->fetchArray();
                
-               return array(intval(ceil($count['count'] / CONVERSATION_MESSAGES_PER_PAGE)), $count['count']);
+               return [intval(ceil($count['count'] / CONVERSATION_MESSAGES_PER_PAGE)), $count['count']];
        }
        
        /**
         * @see \wcf\data\IMessageQuickReply::getRedirectUrl()
         */
        public function getRedirectUrl(DatabaseObject $conversation, DatabaseObject $message) {
-               return LinkHandler::getInstance()->getLink('Conversation', array(
+               return LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $conversation,
                        'messageID' => $message->messageID
-               )).'#message'.$message->messageID;
+               ]).'#message'.$message->messageID;
        }
        
        /**
@@ -515,7 +515,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function validateSaveFullQuote() {
                $this->message = $this->getSingleObject();
                
-               if (!Conversation::isParticipant(array($this->message->conversationID))) {
+               if (!Conversation::isParticipant([$this->message->conversationID])) {
                        throw new PermissionDeniedException();
                }
        }
@@ -537,10 +537,10 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                        MessageQuoteManager::getInstance()->removeQuote($removeQuoteID);
                }
                
-               $returnValues = array(
+               $returnValues = [
                        'count' => MessageQuoteManager::getInstance()->countQuotes(),
-                       'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(array('com.woltlab.wcf.conversation.message'))
-               );
+                       'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(['com.woltlab.wcf.conversation.message'])
+               ];
                
                if ($quoteID) {
                        $returnValues['renderedQuote'] = MessageQuoteManager::getInstance()->getQuoteComponents($quoteID);
@@ -557,7 +557,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                $this->readBoolean('renderQuote', true);
                $this->message = $this->getSingleObject();
                
-               if (!Conversation::isParticipant(array($this->message->conversationID))) {
+               if (!Conversation::isParticipant([$this->message->conversationID])) {
                        throw new PermissionDeniedException();
                }
        }
@@ -568,10 +568,10 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function saveQuote() {
                $quoteID = MessageQuoteManager::getInstance()->addQuote('com.woltlab.wcf.conversation.message', $this->message->conversationID, $this->message->messageID, $this->parameters['message'], false);
                
-               $returnValues = array(
+               $returnValues = [
                        'count' => MessageQuoteManager::getInstance()->countQuotes(),
-                       'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(array('com.woltlab.wcf.conversation.message'))
-               );
+                       'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(['com.woltlab.wcf.conversation.message'])
+               ];
                
                if ($this->parameters['renderQuote']) {
                        $returnValues['renderedQuote'] = MessageQuoteManager::getInstance()->getQuoteComponents($quoteID);
@@ -598,9 +598,9 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
        public function getRenderedQuotes() {
                $quotes = MessageQuoteManager::getInstance()->getQuotesByParentObjectID('com.woltlab.wcf.conversation.message', $this->conversation->conversationID);
                
-               return array(
+               return [
                        'template' => implode("\n\n", $quotes)
-               );
+               ];
        }
        
        /**
index 683ef34a3b91262e40d2ccf30e211069cb3ab677..90e5b48fb94ae7805fd5fa18f80ba55f8c62e648 100644 (file)
@@ -29,10 +29,10 @@ class SearchResultConversationMessage extends ViewableConversationMessage implem
         */
        public function getConversation() {
                if ($this->conversation === null) {
-                       $this->conversation = new Conversation(null, array(
+                       $this->conversation = new Conversation(null, [
                                'conversationID' => $this->conversationID,
                                'subject' => $this->subject
-                       ));
+                       ]);
                }
                
                return $this->conversation;
@@ -57,11 +57,11 @@ class SearchResultConversationMessage extends ViewableConversationMessage implem
         */
        public function getLink($query = '') {
                if ($query) {
-                       return LinkHandler::getInstance()->getLink('Conversation', array(
+                       return LinkHandler::getInstance()->getLink('Conversation', [
                                'object' => $this->getConversation(),
                                'messageID' => $this->messageID,
                                'highlight' => urlencode($query)
-                       ), '#message'.$this->messageID);
+                       ], '#message'.$this->messageID);
                }
                
                return $this->getDecoratedObject()->getLink();
index 41802175786f974e7e0c389a06912dc789460fce..67ee2a5433a28481cd28c5a179e4facd617669c4 100644 (file)
@@ -27,8 +27,8 @@ class ConversationLogModificationLogList extends ModificationLogList {
                parent::__construct();
                
                // set conditions
-               $this->getConditionBuilder()->add('modification_log.objectTypeID = ?', array(ConversationModificationLogHandler::getInstance()->getObjectType('com.woltlab.wcf.conversation.conversation')->objectTypeID));
-               $this->getConditionBuilder()->add('modification_log.objectID = ?', array($conversationID));
+               $this->getConditionBuilder()->add('modification_log.objectTypeID = ?', [ConversationModificationLogHandler::getInstance()->getObjectType('com.woltlab.wcf.conversation.conversation')->objectTypeID]);
+               $this->getConditionBuilder()->add('modification_log.objectID = ?', [$conversationID]);
        }
        
        /**
index 09c4c7f81db4360a33d2b31c325e265842455805..f54d63f75b7b09be85c5246979fe3f597e6e3c5f 100644 (file)
@@ -43,12 +43,12 @@ class ConversationAddForm extends MessageForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_CONVERSATION');
+       public $neededModules = ['MODULE_CONVERSATION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('user.conversation.canUseConversation');
+       public $neededPermissions = ['user.conversation.canUseConversation'];
        
        /**
         * participants (comma separated user names)
@@ -78,13 +78,13 @@ class ConversationAddForm extends MessageForm {
         * participants (user ids)
         * @var integer[]
         */
-       public $participantIDs = array();
+       public $participantIDs = [];
        
        /**
         * invisible participants (user ids)
         * @var integer[]
         */
-       public $invisibleParticipantIDs = array();
+       public $invisibleParticipantIDs = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -111,7 +111,7 @@ class ConversationAddForm extends MessageForm {
                                Conversation::validateParticipant($user);
                        }
                        catch (UserInputException $e) {
-                               throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.conversation.participants.error.'.$e->getType(), array('errorData' => array('username' => $user->username))));
+                               throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.conversation.participants.error.'.$e->getType(), ['errorData' => ['username' => $user->username]]));
                        }
                        
                        $this->participants = $user->username;
@@ -183,38 +183,38 @@ class ConversationAddForm extends MessageForm {
                parent::save();
                
                // save conversation
-               $data = array_merge($this->additionalFields, array(
+               $data = array_merge($this->additionalFields, [
                        'subject' => $this->subject,
                        'time' => TIME_NOW,
                        'userID' => WCF::getUser()->userID,
                        'username' => WCF::getUser()->username,
                        'isDraft' => ($this->draft ? 1 : 0),
                        'participantCanInvite' => $this->participantCanInvite
-               ));
+               ]);
                if ($this->draft) {
-                       $data['draftData'] = serialize(array(
+                       $data['draftData'] = serialize([
                                'participants' => $this->participantIDs,
                                'invisibleParticipants' => $this->invisibleParticipantIDs
-                       ));
+                       ]);
                }
                
-               $conversationData = array(
+               $conversationData = [
                        'data' => $data,
                        'attachmentHandler' => $this->attachmentHandler,
-                       'messageData' => array(
+                       'messageData' => [
                                'message' => $this->text,
                                'enableBBCodes' => $this->enableBBCodes,
                                'enableHtml' => $this->enableHtml,
                                'enableSmilies' => $this->enableSmilies,
                                'showSignature' => $this->showSignature
-                       )
-               );
+                       ]
+               ];
                if (!$this->draft) {
                        $conversationData['participants'] = $this->participantIDs;
                        $conversationData['invisibleParticipants'] = $this->invisibleParticipantIDs;
                }
                
-               $this->objectAction = new ConversationAction(array(), 'create', $conversationData);
+               $this->objectAction = new ConversationAction([], 'create', $conversationData);
                $resultValues = $this->objectAction->executeAction();
                
                MessageQuoteManager::getInstance()->saved();
@@ -222,9 +222,9 @@ class ConversationAddForm extends MessageForm {
                $this->saved();
                
                // forward
-               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', array(
+               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $resultValues['returnValues']
-               )));
+               ]));
                exit;
        }
        
@@ -246,10 +246,10 @@ class ConversationAddForm extends MessageForm {
                
                MessageQuoteManager::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'participantCanInvite' => $this->participantCanInvite,
                        'participants' => $this->participants,
                        'invisibleParticipants' => $this->invisibleParticipants
-               ));
+               ]);
        }
 }
index 5f74b9cefea773fd1b891a57282f133458e3b338..f5664fdacd88394bdd4f7fc886cb9612146487bb 100644 (file)
@@ -42,12 +42,12 @@ class ConversationMessageAddForm extends MessageForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_CONVERSATION');
+       public $neededModules = ['MODULE_CONVERSATION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('user.conversation.canUseConversation');
+       public $neededPermissions = ['user.conversation.canUseConversation'];
        
        /**
         * conversation id
@@ -129,7 +129,7 @@ class ConversationMessageAddForm extends MessageForm {
                                                FROM    wcf".WCF_N."_conversation_message
                                                WHERE   conversationID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array($this->conversation->conversationID));
+                                       $statement->execute([$this->conversation->conversationID]);
                                        $messageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        $renderedQuotes = MessageQuoteManager::getInstance()->getQuotesByObjectIDs('com.woltlab.wcf.conversation.message', $messageIDs);
@@ -149,7 +149,7 @@ class ConversationMessageAddForm extends MessageForm {
                $this->messageList->setConversation($this->conversation);
                $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX;
                $this->messageList->sqlOrderBy = 'conversation_message.time DESC';
-               $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->conversation->conversationID));
+               $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', [$this->conversation->conversationID]);
                $this->messageList->readObjects();
        }
        
@@ -160,7 +160,7 @@ class ConversationMessageAddForm extends MessageForm {
                parent::save();
                
                // save message
-               $data = array_merge($this->additionalFields, array(
+               $data = array_merge($this->additionalFields, [
                        'conversationID' => $this->conversationID,
                        'message' => $this->text,
                        'time' => TIME_NOW,
@@ -170,14 +170,14 @@ class ConversationMessageAddForm extends MessageForm {
                        'enableHtml' => $this->enableHtml,
                        'enableSmilies' => $this->enableSmilies,
                        'showSignature' => $this->showSignature
-               ));
+               ]);
                
-               $messageData = array(
+               $messageData = [
                        'data' => $data,
                        'attachmentHandler' => $this->attachmentHandler
-               );
+               ];
                
-               $this->objectAction = new ConversationMessageAction(array(), 'create', $messageData);
+               $this->objectAction = new ConversationMessageAction([], 'create', $messageData);
                $resultValues = $this->objectAction->executeAction();
                
                MessageQuoteManager::getInstance()->saved();
@@ -185,10 +185,10 @@ class ConversationMessageAddForm extends MessageForm {
                $this->saved();
                
                // forward
-               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', array(
+               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $this->conversation,
                        'messageID' => $resultValues['returnValues']->messageID
-               )).'#message'.$resultValues['returnValues']->messageID);
+                       ]).'#message'.$resultValues['returnValues']->messageID);
                exit;
        }
        
@@ -200,13 +200,13 @@ class ConversationMessageAddForm extends MessageForm {
                
                MessageQuoteManager::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'conversation' => $this->conversation,
                        'conversationID' => $this->conversationID,
                        'items' => $this->messageList->countObjects(),
                        'messages' => $this->messageList->getObjects(),
                        'attachmentList' => $this->messageList->getAttachmentList()
-               ));
+               ]);
        }
        
        /**
index e7cca48bb86659025e77295bfd50b0d000cbf53d..e9add99280a93e9908138fd5e519cd07dbfc24fb 100644 (file)
@@ -121,13 +121,13 @@ class ConversationMessageEditForm extends ConversationAddForm {
                MessageForm::save();
                
                // save message
-               $data = array_merge($this->additionalFields, array(
+               $data = array_merge($this->additionalFields, [
                        'message' => $this->text,
                        'enableBBCodes' => $this->enableBBCodes,
                        'enableHtml' => $this->enableHtml,
                        'enableSmilies' => $this->enableSmilies,
                        'showSignature' => $this->showSignature
-               ));
+               ]);
                if ($this->conversation->isDraft && !$this->draft) {
                        $data['time'] = TIME_NOW;
                }
@@ -135,30 +135,30 @@ class ConversationMessageEditForm extends ConversationAddForm {
                        $data['lastEditTime'] = TIME_NOW;
                        $data['editCount'] = $this->message->editCount + 1;
                }
-               $messageData = array(
+               $messageData = [
                        'data' => $data,
                        'attachmentHandler' => $this->attachmentHandler
-               );
-               $this->objectAction = new ConversationMessageAction(array($this->message), 'update', $messageData);
+               ];
+               $this->objectAction = new ConversationMessageAction([$this->message], 'update', $messageData);
                $this->objectAction->executeAction();
                
                // update conversation
                if ($this->isFirstMessage) {
-                       $data = array(
+                       $data = [
                                'subject' => $this->subject,
                                'isDraft' => ($this->draft ? 1 : 0),
                                'participantCanInvite' => $this->participantCanInvite
-                       );
+                       ];
                        if ($this->draft) {
-                               $data['draftData'] = serialize(array(
+                               $data['draftData'] = serialize([
                                        'participants' => $this->participantIDs,
                                        'invisibleParticipants' => $this->invisibleParticipantIDs
-                               ));
+                               ]);
                        }
                        
-                       $conversationData = array(
+                       $conversationData = [
                                'data' => $data
-                       );
+                       ];
                        if ($this->conversation->isDraft && !$this->draft) {
                                $conversationData['participants'] = $this->participantIDs;
                                $conversationData['invisibleParticipants'] = $this->invisibleParticipantIDs;
@@ -166,16 +166,16 @@ class ConversationMessageEditForm extends ConversationAddForm {
                                $conversationData['data']['time'] = $conversationData['data']['lastPostTime'] = TIME_NOW;
                        }
                        
-                       $conversationAction = new ConversationAction(array($this->conversation), 'update', $conversationData);
+                       $conversationAction = new ConversationAction([$this->conversation], 'update', $conversationData);
                        $conversationAction->executeAction();
                }
                $this->saved();
                
                // forward
-               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', array(
+               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $this->conversation,
                        'messageID' => $this->messageID
-               )).'#message'.$this->messageID);
+                       ]).'#message'.$this->messageID);
                exit;
        }
        
@@ -219,8 +219,8 @@ class ConversationMessageEditForm extends ConversationAddForm {
                $this->messageList->setConversation($this->conversation);
                $this->messageList->sqlLimit = CONVERSATION_REPLY_SHOW_MESSAGES_MAX;
                $this->messageList->sqlOrderBy = 'conversation_message.time DESC';
-               $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', array($this->message->conversationID));
-               $this->messageList->getConditionBuilder()->add("conversation_message.messageID <> ?", array($this->message->messageID));
+               $this->messageList->getConditionBuilder()->add('conversation_message.conversationID = ?', [$this->message->conversationID]);
+               $this->messageList->getConditionBuilder()->add("conversation_message.messageID <> ?", [$this->message->messageID]);
                $this->messageList->readObjects();
        }
        
@@ -230,7 +230,7 @@ class ConversationMessageEditForm extends ConversationAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'messageID' => $this->messageID,
                        'message' => $this->message,
                        'conversationID' => $this->conversationID,
@@ -239,7 +239,7 @@ class ConversationMessageEditForm extends ConversationAddForm {
                        'items' => $this->messageList->countObjects(),
                        'messages' => $this->messageList->getObjects(),
                        'attachmentList' => $this->messageList->getAttachmentList()
-               ));
+               ]);
        }
        
        /**
index f3d0f42362860f5728f63f58d0f51334e26335ff..f58e5ac65166b946bed9d3409bb53b381a1613b4 100644 (file)
@@ -26,8 +26,8 @@ class ConversationFeedPage extends AbstractFeedPage {
                parent::readData();
                
                $this->items = new FeedConversationList();
-               $this->items->getConditionBuilder()->add('conversation_to_user.participantID = ?', array(WCF::getUser()->userID));
-               $this->items->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', array(0));
+               $this->items->getConditionBuilder()->add('conversation_to_user.participantID = ?', [WCF::getUser()->userID]);
+               $this->items->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [0]);
                $this->items->sqlConditionJoins = "LEFT JOIN wcf".WCF_N."_conversation conversation ON (conversation.conversationID = conversation_to_user.conversationID)";
                $this->items->sqlLimit = 20;
                $this->items->readObjects();
index 8d0d8d5afaabb44bb332e68882e768b27548affe..5c63cb3f23c1952f827d0ad3f84d6109d74d1274 100644 (file)
@@ -218,7 +218,7 @@ class ConversationPage extends MultipleLinkPage {
                                                        AND time > ?
                                        ORDER BY        time";
                                $statement = WCF::getDB()->prepareStatement($sql, 1);
-                               $statement->execute(array($this->conversationID, $this->objectList->current()->time));
+                               $statement->execute([$this->conversationID, $this->objectList->current()->time]);
                                $endTime = $statement->fetchSingleColumn() - 1;
                        }       
                }
index f30e6e80dcf33e13bfec3d413583309f2b37a9bc..7b6dbca80a9b162646b55f1b6ac9b4e7e7499ab2 100644 (file)
@@ -87,7 +87,7 @@ class ConversationMessageAttachmentObjectType extends AbstractAttachmentObjectTy
                $messageList = new ConversationMessageList();
                $messageList->setObjectIDs($objectIDs);
                $messageList->readObjects();
-               $conversationIDs = array();
+               $conversationIDs = [];
                foreach ($messageList as $message) {
                        $conversationIDs[] = $message->conversationID;
                }
@@ -107,13 +107,13 @@ class ConversationMessageAttachmentObjectType extends AbstractAttachmentObjectTy
         * @see \wcf\system\attachment\IAttachmentObjectType::setPermissions()
         */
        public function setPermissions(array $attachments) {
-               $messageIDs = array();
+               $messageIDs = [];
                foreach ($attachments as $attachment) {
                        // set default permissions
-                       $attachment->setPermissions(array(
+                       $attachment->setPermissions([
                                'canDownload' => false,
                                'canViewPreview' => false
-                       ));
+                       ]);
                        
                        if ($this->getObject($attachment->objectID) === null) {
                                $messageIDs[] = $attachment->objectID;
@@ -128,16 +128,16 @@ class ConversationMessageAttachmentObjectType extends AbstractAttachmentObjectTy
                        if (($message = $this->getObject($attachment->objectID)) !== null) {
                                if (!$message->getConversation()->canRead()) continue;
                                
-                               $attachment->setPermissions(array(
+                               $attachment->setPermissions([
                                        'canDownload' => true,
                                        'canViewPreview' => true
-                               ));
+                               ]);
                        }
                        else if ($attachment->tmpHash != '' && $attachment->userID == WCF::getUser()->userID) {
-                               $attachment->setPermissions(array(
+                               $attachment->setPermissions([
                                        'canDownload' => true,
                                        'canViewPreview' => true
-                               ));
+                               ]);
                        }
                }
        }
index 435c464edf7d4e85dc5fb5247847d77c6be0b647..ad66da9cc6b49fc59b30b5b5ace8f7910b95baa5 100644 (file)
@@ -19,7 +19,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$actionClassActions
         */
-       protected $actionClassActions = array('close', 'markAsRead', 'open');
+       protected $actionClassActions = ['close', 'markAsRead', 'open'];
        
        /**
         * list of conversations
@@ -30,7 +30,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$supportedActions
         */
-       protected $supportedActions = array('assignLabel', 'close', 'leave', 'leavePermanently', 'markAsRead', 'open', 'restore');
+       protected $supportedActions = ['assignLabel', 'close', 'leave', 'leavePermanently', 'markAsRead', 'open', 'restore'];
        
        /**
         * @see \wcf\system\clipboard\action\IClipboardAction::execute()
@@ -59,7 +59,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
                                        FROM    wcf".WCF_N."_conversation_label
                                        WHERE   userID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(WCF::getUser()->userID));
+                               $statement->execute([WCF::getUser()->userID]);
                                $row = $statement->fetchArray();
                                if ($row['count'] == 0) {
                                        return null;
@@ -69,14 +69,14 @@ class ConversationClipboardAction extends AbstractClipboardAction {
                        break;
                        
                        case 'leave':
-                               $item->addInternalData('parameters', array('hideConversation' => 1));
+                               $item->addInternalData('parameters', ['hideConversation' => 1]);
                                $item->addParameter('actionName', 'hideConversation');
                                $item->addParameter('className', $this->getClassName());
                        break;
                        
                        case 'leavePermanently':
                                $item->addParameter('objectIDs', array_keys($this->conversations));
-                               $item->addInternalData('parameters', array('hideConversation' => 2));
+                               $item->addInternalData('parameters', ['hideConversation' => 2]);
                                $item->addParameter('actionName', 'hideConversation');
                                $item->addParameter('className', $this->getClassName());
                        break;
@@ -85,13 +85,13 @@ class ConversationClipboardAction extends AbstractClipboardAction {
                                $item->addParameter('objectIDs', array_keys($this->conversations));
                                $item->addParameter('actionName', 'markAsRead');
                                $item->addParameter('className', $this->getClassName());
-                               $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.markAsRead.confirmMessage', array(
+                               $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.conversation.conversation.markAsRead.confirmMessage', [
                                        'count' => $item->getCount()
-                               )));
+                               ]));
                        break;
                        
                        case 'restore':
-                               $item->addInternalData('parameters', array('hideConversation' => 0));
+                               $item->addInternalData('parameters', ['hideConversation' => 0]);
                                $item->addParameter('actionName', 'hideConversation');
                                $item->addParameter('className', $this->getClassName());
                        break;
@@ -121,7 +121,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      Conversation[]
         */
        protected function validateParticipation(array $conversations) {
-               $conversationIDs = array();
+               $conversationIDs = [];
                
                // validate ownership
                foreach ($conversations as $conversation) {
@@ -133,8 +133,8 @@ class ConversationClipboardAction extends AbstractClipboardAction {
                // validate participation as non-owner
                if (!empty($conversationIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("conversationID IN (?)", array($conversationIDs));
-                       $conditions->add("participantID = ?", array(WCF::getUser()->userID));
+                       $conditions->add("conversationID IN (?)", [$conversationIDs]);
+                       $conditions->add("participantID = ?", [WCF::getUser()->userID]);
                        
                        $sql = "SELECT  conversationID
                                FROM    wcf".WCF_N."_conversation_to_user
@@ -167,7 +167,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      integer[]
         */
        protected function validateClose() {
-               $conversationIDs = array();
+               $conversationIDs = [];
                
                foreach ($this->conversations as $conversation) {
                        if (!$conversation->isClosed && $conversation->userID == WCF::getUser()->userID) {
@@ -184,15 +184,15 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      integer[]
         */
        public function validateLeave() {
-               $tmpIDs = array();
+               $tmpIDs = [];
                foreach ($this->conversations as $conversation) {
                        $tmpIDs[] = $conversation->conversationID;
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("conversationID IN (?)", array($tmpIDs));
-               $conditions->add("participantID = ?", array(WCF::getUser()->userID));
-               $conditions->add("hideConversation <> ?", array(1));
+               $conditions->add("conversationID IN (?)", [$tmpIDs]);
+               $conditions->add("participantID = ?", [WCF::getUser()->userID]);
+               $conditions->add("hideConversation <> ?", [1]);
                
                $sql = "SELECT  conversationID
                        FROM    wcf".WCF_N."_conversation_to_user
@@ -209,18 +209,18 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      integer[]
         */
        public function validateMarkAsRead() {
-               $conversationIDs = array();
+               $conversationIDs = [];
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("conversationID IN (?)", array(array_keys($this->conversations)));
-               $conditions->add("participantID = ?", array(WCF::getUser()->userID));
+               $conditions->add("conversationID IN (?)", [array_keys($this->conversations)]);
+               $conditions->add("participantID = ?", [WCF::getUser()->userID]);
                
                $sql = "SELECT  conversationID, lastVisitTime
                        FROM    wcf".WCF_N."_conversation_to_user
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $lastVisitTime = array();
+               $lastVisitTime = [];
                while ($row = $statement->fetchArray()) {
                        $lastVisitTime[$row['conversationID']] = $row['lastVisitTime'];
                }
@@ -240,7 +240,7 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      integer[]
         */
        protected function validateOpen() {
-               $conversationIDs = array();
+               $conversationIDs = [];
                
                foreach ($this->conversations as $conversation) {
                        if ($conversation->isClosed && $conversation->userID == WCF::getUser()->userID) {
@@ -257,15 +257,15 @@ class ConversationClipboardAction extends AbstractClipboardAction {
         * @return      integer[]
         */
        public function validateRestore() {
-               $tmpIDs = array();
+               $tmpIDs = [];
                foreach ($this->conversations as $conversation) {
                        $tmpIDs[] = $conversation->conversationID;
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("conversationID IN (?)", array($tmpIDs));
-               $conditions->add("participantID = ?", array(WCF::getUser()->userID));
-               $conditions->add("hideConversation <> ?", array(0));
+               $conditions->add("conversationID IN (?)", [$tmpIDs]);
+               $conditions->add("participantID = ?", [WCF::getUser()->userID]);
+               $conditions->add("hideConversation <> ?", [0]);
                
                $sql = "SELECT  conversationID
                        FROM    wcf".WCF_N."_conversation_to_user
index 7959eedb10bb0182af9176bff5b33f5efc7cc4a8..57ea2c3ed3a6b40489e98eed49a85e4329b5fc97 100644 (file)
@@ -20,13 +20,13 @@ class ConversationHandler extends SingletonFactory {
         * number of unread conversations
         * @var integer[]
         */
-       protected $unreadConversationCount = array();
+       protected $unreadConversationCount = [];
        
        /**
         * number of conversations
         * @var integer[]
         */
-       protected $conversationCount = array();
+       protected $conversationCount = [];
        
        /**
         * Returns the number of unread conversations for given user.
@@ -42,16 +42,16 @@ class ConversationHandler extends SingletonFactory {
                        $this->unreadConversationCount[$userID] = 0;
                        
                        // load storage data
-                       UserStorageHandler::getInstance()->loadStorage(array($userID));
+                       UserStorageHandler::getInstance()->loadStorage([$userID]);
                        
                        // get ids
-                       $data = UserStorageHandler::getInstance()->getStorage(array($userID), 'unreadConversationCount');
+                       $data = UserStorageHandler::getInstance()->getStorage([$userID], 'unreadConversationCount');
                        
                        // cache does not exist or is outdated
                        if ($data[$userID] === null || $skipCache) {
                                $conditionBuilder = new PreparedStatementConditionBuilder();
                                $conditionBuilder->add('conversation.conversationID = conversation_to_user.conversationID');
-                               $conditionBuilder->add('conversation_to_user.participantID = ?', array($userID));
+                               $conditionBuilder->add('conversation_to_user.participantID = ?', [$userID]);
                                $conditionBuilder->add('conversation_to_user.hideConversation = 0');
                                $conditionBuilder->add('conversation_to_user.lastVisitTime < conversation.lastPostTime');
                                
@@ -88,18 +88,18 @@ class ConversationHandler extends SingletonFactory {
                        $this->conversationCount[$userID] = 0;
                        
                        // load storage data
-                       UserStorageHandler::getInstance()->loadStorage(array($userID));
+                       UserStorageHandler::getInstance()->loadStorage([$userID]);
                        
                        // get ids
-                       $data = UserStorageHandler::getInstance()->getStorage(array($userID), 'conversationCount');
+                       $data = UserStorageHandler::getInstance()->getStorage([$userID], 'conversationCount');
                        
                        // cache does not exist or is outdated
                        if ($data[$userID] === null) {
                                $conditionBuilder1 = new PreparedStatementConditionBuilder();
-                               $conditionBuilder1->add('conversation_to_user.participantID = ?', array($userID));
+                               $conditionBuilder1->add('conversation_to_user.participantID = ?', [$userID]);
                                $conditionBuilder1->add('conversation_to_user.hideConversation IN (0,1)');
                                $conditionBuilder2 = new PreparedStatementConditionBuilder();
-                               $conditionBuilder2->add('conversation.userID = ?', array($userID));
+                               $conditionBuilder2->add('conversation.userID = ?', [$userID]);
                                $conditionBuilder2->add('conversation.isDraft = 1');
                                
                                $sql = "SELECT (SELECT  COUNT(*)
index 10419ee100d73dbe4e5a552eafcf6f3944fa717e..d81afaeccd163d5436c5f0c7cda4a90e9ea7f201 100644 (file)
@@ -26,7 +26,7 @@ class ConversationAttachmentImporter extends AbstractAttachmentImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['objectID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation.message', $data['objectID']);
                if (!$data['objectID']) return 0;
                
@@ -37,9 +37,9 @@ class ConversationAttachmentImporter extends AbstractAttachmentImporter {
                        
                        if (($newMessage = $this->fixEmbeddedAttachments($messageObj->message, $oldID, $attachmentID)) !== false) {
                                $editor = new ConversationMessageEditor($messageObj);
-                               $editor->update(array(
+                               $editor->update([
                                        'message' => $newMessage
-                               ));
+                               ]);
                        }
                }
                
index 4b407838c136dbc671158c22f527e59c97f15153..78458da39ae6c3ecff516c2460f656d6dea33391 100644 (file)
@@ -22,7 +22,7 @@ class ConversationImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $oldUserID = $data['userID'];
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
@@ -38,14 +38,14 @@ class ConversationImporter extends AbstractImporter {
                
                // add author
                if (empty($data['isDraft'])) {
-                       ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.user')->import(0, array(
+                       ImportHandler::getInstance()->getImporter('com.woltlab.wcf.conversation.user')->import(0, [
                                'conversationID' => $oldID,
                                'participantID' => $oldUserID,
                                'username' => $data['username'],
                                'hideConversation' => 0,
                                'isInvisible' => 0,
                                'lastVisitTime' => $data['time']
-                       ), array('labelIDs' => array()));
+                       ], ['labelIDs' => []]);
                }
                
                return $conversation->conversationID;
index bd8c5470876b1fb74c353cff130768a44cca2e70..d573b3f418b9e668ec7e58032f9496bc4c5c794a 100644 (file)
@@ -21,13 +21,13 @@ class ConversationLabelImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                if (!$data['userID']) return 0;
                
-               $action = new ConversationLabelAction(array(), 'create', array(
+               $action = new ConversationLabelAction([], 'create', [
                        'data' => $data
-               ));
+               ]);
                $returnValues = $action->executeAction();
                $newID = $returnValues['returnValues']->labelID;
                
index 3d53129ce301d3a05f59560a6a5b03282bed0ae6..5fdbdfa2e7ec3e7f5f096087cec566986431e4de 100644 (file)
@@ -22,7 +22,7 @@ class ConversationMessageImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['conversationID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation', $data['conversationID']);
                if (!$data['conversationID']) return 0;
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
index af403a90cf5a7fb46d37bf2131827ca783d80be6..6e76050e0faa07715d0026384945490a0375fc72 100644 (file)
@@ -16,7 +16,7 @@ class ConversationUserImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['conversationID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation', $data['conversationID']);
                if (!$data['conversationID']) return 0;
                $data['participantID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['participantID']);
@@ -28,14 +28,14 @@ class ConversationUserImporter extends AbstractImporter {
                                                        isInvisible = IF(isInvisible AND VALUES(isInvisible),1,0),
                                                        lastVisitTime = GREATEST(lastVisitTime,VALUES(lastVisitTime))";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $data['conversationID'],
                        $data['participantID'],
                        $data['username'],
                        $data['hideConversation'],
                        $data['isInvisible'],
                        $data['lastVisitTime']
-               ));
+               ]);
                
                // save labels
                if ($data['participantID'] && !empty($additionalData['labelIDs'])) {
@@ -45,7 +45,7 @@ class ConversationUserImporter extends AbstractImporter {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($additionalData['labelIDs'] as $labelID) {
                                $labelID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.conversation.label', $labelID);
-                               if ($labelID) $statement->execute(array($labelID, $data['conversationID']));
+                               if ($labelID) $statement->execute([$labelID, $data['conversationID']]);
                        }
                }
                
index b1718de9eef702a0158e3296d2f2c5e36a42fce6..d61f83312755a1caa895e89f25c4e89c091b45e0 100644 (file)
@@ -25,13 +25,13 @@ class ConversationMessageQuoteHandler extends AbstractMessageQuoteHandler {
                $messages = $messageList->getObjects();
                
                // read conversations
-               $conversationIDs = $validMessageIDs = array();
+               $conversationIDs = $validMessageIDs = [];
                foreach ($messages as $message) {
                        $conversationIDs[] = $message->conversationID;
                        $validMessageIDs[] = $message->messageID;
                }
                
-               $quotedMessages = array();
+               $quotedMessages = [];
                if (!empty($conversationIDs)) {
                        $conversationList = new ConversationList();
                        $conversationList->setObjectIDs($conversationIDs);
@@ -57,7 +57,7 @@ class ConversationMessageQuoteHandler extends AbstractMessageQuoteHandler {
                
                // check for orphaned quotes
                if (count($validMessageIDs) != count($data)) {
-                       $orphanedQuoteIDs = array();
+                       $orphanedQuoteIDs = [];
                        foreach ($data as $messageID => $quoteIDs) {
                                if (!in_array($messageID, $validMessageIDs)) {
                                        foreach (array_keys($quoteIDs) as $quoteID) {
index 954b207c3e0eaf6f413252c6ee35c5d063797801..b61da2cb583aaa069d2149487607a2abe7180245 100644 (file)
@@ -42,7 +42,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
         * list of conversation message
         * @var ConversationMessage[]
         */
-       protected static $messages = array();
+       protected static $messages = [];
        
        /**
         * @see \wcf\system\moderation\queue\AbstractModerationQueueHandler::$requiredPermission
@@ -53,7 +53,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
         * @see \wcf\system\moderation\queue\IModerationQueueHandler::assignQueues()
         */
        public function assignQueues(array $queues) {
-               $assignments = array();
+               $assignments = [];
                foreach ($queues as $queue) {
                        $assignUser = false;
                        if (WCF::getSession()->getPermission('mod.conversation.canModerateConversation')) {
@@ -74,7 +74,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
                        return false;
                }
                
-               if (!Conversation::isParticipant(array($this->getMessage($objectID)->conversationID))) {
+               if (!Conversation::isParticipant([$this->getMessage($objectID)->conversationID])) {
                        return false;
                }
                
@@ -92,9 +92,9 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
         * @see \wcf\system\moderation\queue\report\IModerationQueueReportHandler::getReportedContent()
         */
        public function getReportedContent(ViewableModerationQueue $queue) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'message' => new ViewableConversationMessage($queue->getAffectedObject())
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('moderationConversationMessage');
        }
@@ -142,7 +142,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
         * @see \wcf\system\moderation\queue\IModerationQueueHandler::populate()
         */
        public function populate(array $queues) {
-               $objectIDs = array();
+               $objectIDs = [];
                foreach ($queues as $object) {
                        $objectIDs[] = $object->objectID;
                }
@@ -161,7 +161,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
                }
                
                // fetch conversations
-               $conversationIDs = array();
+               $conversationIDs = [];
                foreach ($messages as $message) {
                        $conversationIDs[] = $message->conversationID;
                }
@@ -188,7 +188,7 @@ class ConversationMessageModerationQueueReportHandler extends AbstractModeration
         */
        public function removeContent(ModerationQueue $queue, $message) {
                if ($this->isValid($queue->objectID)) {
-                       $messageAction = new ConversationMessageAction(array($this->getMessage($queue->objectID)), 'delete');
+                       $messageAction = new ConversationMessageAction([$this->getMessage($queue->objectID)], 'delete');
                        $messageAction->executeAction();
                }
        }
index c156bfd49b3e623ac235bf0d3e10a1eeb25a8201..950ca02e4d7fc055f32b7cb52ca72f10c7df654a 100644 (file)
@@ -16,9 +16,9 @@ class ConversationMessageStatDailyHandler extends AbstractStatDailyHandler {
         * @see \wcf\system\stat\IStatDailyHandler::getData()
         */
        public function getData($date) {
-               return array(
+               return [
                        'counter' => $this->getCounter($date, 'wcf'.WCF_N.'_conversation_message', 'time'),
                        'total' => $this->getTotal($date, 'wcf'.WCF_N.'_conversation_message', 'time')
-               );
+               ];
        }
 }
index 68d74b76d83b42d84c975cb43d8d104a1d06ae8c..83e621b9ed0d52e52ffc8fbac1e9ed473eaaa664 100644 (file)
@@ -16,9 +16,9 @@ class ConversationStatDailyHandler extends AbstractStatDailyHandler {
         * @see \wcf\system\stat\IStatDailyHandler::getData()
         */
        public function getData($date) {
-               return array(
+               return [
                        'counter' => $this->getCounter($date, 'wcf'.WCF_N.'_conversation', 'time'),
                        'total' => $this->getTotal($date, 'wcf'.WCF_N.'_conversation', 'time')
-               );
+               ];
        }
 }
index cfa442eb07a84556ee09c39bbcf32b92f4ecd3a4..637069b4462e6180bb890c36925e87fed7398892 100644 (file)
@@ -24,7 +24,7 @@ class ConversationMessageUserNotificationEvent extends AbstractUserNotificationE
        public function getTitle() {
                $count = count($this->getAuthors());
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.title.stacked', array('count' => $count));
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.title.stacked', ['count' => $count]);
                }
                
                return $this->getLanguage()->get('wcf.user.notification.conversation.message.title');
@@ -38,40 +38,40 @@ class ConversationMessageUserNotificationEvent extends AbstractUserNotificationE
                $count = count($authors);
                
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.message.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.message.stacked', [
                                'author' => $this->author,
                                'authors' => $authors,
                                'count' => $count,
                                'message' => $this->userNotificationObject,
                                'others' => $count - 1
-                       ));
+                       ]);
                }
                
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.message', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.message', [
                        'author' => $this->author,
                        'message' => $this->userNotificationObject
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
         */
        public function getEmailMessage($notificationType = 'instant') {
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.mail', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.mail', [
                        'message' => $this->userNotificationObject,
                        'author' => $this->author,
                        'notificationType' => $notificationType
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
         */
        public function getLink() {
-               return LinkHandler::getInstance()->getLink('Conversation', array(
+               return LinkHandler::getInstance()->getLink('Conversation', [
                        'object' => $this->userNotificationObject->getConversation(),
                        'messageID' => $this->userNotificationObject->messageID
-               ), '#message'.$this->userNotificationObject->messageID);
+               ], '#message'.$this->userNotificationObject->messageID);
        }
        
        /**
index 9638d941445272355a9fce9d8b0309ac3e16d96d..640192cbf4f6d846bb3517191e0752bbd377213f 100644 (file)
@@ -24,28 +24,28 @@ class ConversationUserNotificationEvent extends AbstractUserNotificationEvent {
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
         */
        public function getMessage() {
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message', [
                        'author' => $this->author,
                        'conversation' => $this->userNotificationObject
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
         */
        public function getEmailMessage($notificationType = 'instant') {
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.mail', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.mail', [
                        'conversation' => $this->userNotificationObject,
                        'author' => $this->author,
                        'notificationType' => $notificationType
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
         */
        public function getLink() {
-               return LinkHandler::getInstance()->getLink('Conversation', array('object' => $this->userNotificationObject));
+               return LinkHandler::getInstance()->getLink('Conversation', ['object' => $this->userNotificationObject]);
        }
        
        /**
index fe64fe992b9144e0478a5c2f66953d15dc65b3ea..a30d5efff5d7305af498a539b07bffabb46e5489 100644 (file)
@@ -45,10 +45,10 @@ class ConversationNotificationObjectType extends AbstractUserNotificationObjectT
                                // '__unknownNotificationObject' tells the notification API
                                // that the object does not exist anymore so that the related
                                // notification can be deleted automatically
-                               $objects[$objectID] = new static::$decoratorClassName(new static::$objectClassName(null, array(
+                               $objects[$objectID] = new static::$decoratorClassName(new static::$objectClassName(null, [
                                        '__unknownNotificationObject' => true,
                                        'conversationID' => $objectID
-                               )));
+                               ]));
                        }
                }
                
index da4f169eb75077d7751425f8641cef01228d980c..3d62cac3ef8ed92506b8e7748578d81038d81e0b 100644 (file)
@@ -52,7 +52,7 @@ class ConversationMessageRebuildDataWorker extends AbstractRebuildDataWorker {
         * @see \wcf\system\worker\IWorker::execute()
         */
        public function execute() {
-               $this->objectList->getConditionBuilder()->add('conversation_message.messageID BETWEEN ? AND ?', array($this->limit * $this->loopCount + 1, $this->limit * $this->loopCount + $this->limit));
+               $this->objectList->getConditionBuilder()->add('conversation_message.messageID BETWEEN ? AND ?', [$this->limit * $this->loopCount + 1, $this->limit * $this->loopCount + $this->limit]);
                
                parent::execute();
                
@@ -73,10 +73,10 @@ class ConversationMessageRebuildDataWorker extends AbstractRebuildDataWorker {
                        SearchIndexManager::getInstance()->add('com.woltlab.wcf.conversation.message', $message->messageID, $message->message, ($message->subject ?: ''), $message->time, $message->userID, $message->username);
                        
                        $editor = new ConversationMessageEditor($message);
-                       $data = array();
+                       $data = [];
                        
                        // count attachments
-                       $attachmentStatement->execute(array($attachmentObjectType->objectTypeID, $message->messageID));
+                       $attachmentStatement->execute([$attachmentObjectType->objectTypeID, $message->messageID]);
                        $row = $attachmentStatement->fetchSingleRow();
                        $data['attachments'] = $row['attachments'];
                        
index 0faf3ce0d30910a5ca3dcbb130b62e6210b2d374..8b7b761b7e40f61e4daf53139343f324091ac510 100644 (file)
@@ -49,7 +49,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
         * @see \wcf\system\worker\IWorker::execute()
         */
        public function execute() {
-               $this->objectList->getConditionBuilder()->add('conversation.conversationID BETWEEN ? AND ?', array($this->limit * $this->loopCount + 1, $this->limit * $this->loopCount + $this->limit));
+               $this->objectList->getConditionBuilder()->add('conversation.conversationID BETWEEN ? AND ?', [$this->limit * $this->loopCount + 1, $this->limit * $this->loopCount + $this->limit]);
                
                parent::execute();
                
@@ -92,7 +92,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                                AND participantID IS NOT NULL";
                $existingParticipantStatement = WCF::getDB()->prepareStatement($sql, 5);
                
-               $obsoleteConversations = array();
+               $obsoleteConversations = [];
                foreach ($this->objectList as $conversation) {
                        $editor = new ConversationEditor($conversation);
                        
@@ -102,7 +102,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                                if (!$conversation->userID) $obsolete = true;
                        }
                        else {
-                               $existingParticipantStatement->execute(array($conversation->conversationID));
+                               $existingParticipantStatement->execute([$conversation->conversationID]);
                                $row = $existingParticipantStatement->fetchSingleRow();
                                if (!$row['participants']) $obsolete = true;
                        }
@@ -112,10 +112,10 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                        }
                        
                        // update data
-                       $data = array();
+                       $data = [];
                        
                        // get first post
-                       $firstMessageStatement->execute(array($conversation->conversationID));
+                       $firstMessageStatement->execute([$conversation->conversationID]);
                        if (($row = $firstMessageStatement->fetchSingleRow()) !== false) {
                                $data['firstMessageID'] = $row['messageID'];
                                $data['lastPostTime'] = $data['time'] = $row['time'];
@@ -124,7 +124,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                        }
                        
                        // get last post
-                       $lastMessageStatement->execute(array($conversation->conversationID));
+                       $lastMessageStatement->execute([$conversation->conversationID]);
                        if (($row = $lastMessageStatement->fetchSingleRow()) !== false) {
                                $data['lastPostTime'] = $row['time'];
                                $data['lastPosterID'] = $row['userID'];
@@ -132,19 +132,19 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker {
                        }
                        
                        // get stats
-                       $statsStatement->execute(array($conversation->conversationID));
+                       $statsStatement->execute([$conversation->conversationID]);
                        $row = $statsStatement->fetchSingleRow();
                        $data['replies'] = ($row['messages'] ? $row['messages'] - 1 : 0);
                        $data['attachments'] = ($row['attachments'] ?: 0);
                        
                        // get number of participants
-                       $participantCounterStatement->execute(array($conversation->conversationID, Conversation::STATE_LEFT, $conversation->userID, 0));
+                       $participantCounterStatement->execute([$conversation->conversationID, Conversation::STATE_LEFT, $conversation->userID, 0]);
                        $row = $participantCounterStatement->fetchSingleRow();
                        $data['participants'] = $row['participants'];
                        
                        // get participant summary
-                       $participantStatement->execute(array($conversation->conversationID, $conversation->userID, 0));
-                       $users = array();
+                       $participantStatement->execute([$conversation->conversationID, $conversation->userID, 0]);
+                       $users = [];
                        while ($row = $participantStatement->fetchArray()) {
                                $users[] = $row;
                        }