Fix warnings about parameter type comparability
authorMatthias Schmidt <gravatronics@live.com>
Thu, 26 May 2016 14:04:23 +0000 (16:04 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 26 May 2016 14:27:35 +0000 (16:27 +0200)
files/lib/data/conversation/ConversationAction.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php

index 47f766b6064e7f8e29c1f5055db622986a7cf350..378e9d30529755158e977005c11d82482911b694 100644 (file)
@@ -165,7 +165,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                
                parent::update();
                
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        // participants
                        if (!empty($this->parameters['participants']) || !empty($this->parameters['invisibleParticipants'])) {
                                // get current participants
@@ -219,7 +219,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                                AND conversationID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                WCF::getDB()->beginTransaction();
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        $statement->execute([
                                $this->parameters['visitTime'],
                                WCF::getUser()->userID,
@@ -308,7 +308,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                
                // check participation
                $conversationIDs = [];
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        $conversationIDs[] = $conversation->conversationID;
                }
                
@@ -425,7 +425,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                }
                
                // validate ownership
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        if ($conversation->isClosed || ($conversation->userID != WCF::getUser()->userID)) {
                                throw new PermissionDeniedException();
                        }
@@ -438,7 +438,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
         * @return      mixed[][]
         */
        public function close() {
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        $conversation->update(['isClosed' => 1]);
                        $this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 1);
                        
@@ -464,7 +464,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                }
                
                // validate ownership
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        if (!$conversation->isClosed || ($conversation->userID != WCF::getUser()->userID)) {
                                throw new PermissionDeniedException();
                        }
@@ -477,7 +477,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
         * @return      mixed[][]
         */
        public function open() {
-               foreach ($this->objects as $conversation) {
+               foreach ($this->getObjects() as $conversation) {
                        $conversation->update(['isClosed' => 0]);
                        $this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 0);
                        
@@ -581,7 +581,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo
                if ($this->parameters['hideConversation'] == Conversation::STATE_LEFT) {
                        if (empty($this->objects)) $this->readObjects();
                        
-                       foreach ($this->objects as $conversation) {
+                       foreach ($this->getObjects() as $conversation) {
                                ConversationModificationLogHandler::getInstance()->leave($conversation->getDecoratedObject());
                        }
                }
index dcab31f2ff543ecc3a278664dfcdcd81c23a4484..063d1a8dae956bff5be95a89b7c7bfeae3bb6dfd 100644 (file)
@@ -96,6 +96,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                }
                
                // create message
+               /** @var ConversationMessage $message */
                $message = parent::create();
                $messageEditor = new ConversationMessageEditor($message);
                
@@ -183,7 +184,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                
                // update search index / embedded objects
                if (isset($this->parameters['data']) && isset($this->parameters['data']['message'])) {
-                       foreach ($this->objects as $message) {
+                       foreach ($this->getObjects() as $message) {
                                $conversation = $message->getConversation();
                                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);
                                
@@ -203,7 +204,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements
                $count = parent::delete();
                
                $attachmentMessageIDs = $conversationIDs = [];
-               foreach ($this->objects as $message) {
+               foreach ($this->getObjects() as $message) {
                        if (!in_array($message->conversationID, $conversationIDs)) {
                                $conversationIDs[] = $message->conversationID;
                        }