From: Matthias Schmidt Date: Thu, 26 May 2016 14:04:23 +0000 (+0200) Subject: Fix warnings about parameter type comparability X-Git-Tag: 3.0.0_Beta_1~77 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9ee8de8e5ff2513d0f31b5f7e92cf5f286c17e1;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git Fix warnings about parameter type comparability --- diff --git a/files/lib/data/conversation/ConversationAction.class.php b/files/lib/data/conversation/ConversationAction.class.php index 47f766b..378e9d3 100644 --- a/files/lib/data/conversation/ConversationAction.class.php +++ b/files/lib/data/conversation/ConversationAction.class.php @@ -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()); } } diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index dcab31f..063d1a8 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -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; }