From: Matthias Schmidt Date: Sun, 31 Jul 2016 07:25:48 +0000 (+0200) Subject: Remove unnecessary parentheses X-Git-Tag: 3.0.0_Beta_1~39 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a6ee07517a0af47ed99a03e6c94bfccd5ef43ad;p=GitHub%2FWoltLab%2Fcom.woltlab.wcf.conversation.git Remove unnecessary parentheses --- diff --git a/files/lib/data/conversation/Conversation.class.php b/files/lib/data/conversation/Conversation.class.php index 05756ab..29c366a 100644 --- a/files/lib/data/conversation/Conversation.class.php +++ b/files/lib/data/conversation/Conversation.class.php @@ -183,7 +183,7 @@ class Conversation extends DatabaseObject implements IRouteController, ITitledLi $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditionBuilder->getParameters()); $conversations = []; - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $conversations[$row['conversationID']] = new Conversation(null, $row); } @@ -342,7 +342,7 @@ class Conversation extends DatabaseObject implements IRouteController, ITitledLi ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $index = array_search($row['conversationID'], $conversationIDs); unset($conversationIDs[$index]); } @@ -359,7 +359,7 @@ class Conversation extends DatabaseObject implements IRouteController, ITitledLi ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $index = array_search($row['conversationID'], $conversationIDs); unset($conversationIDs[$index]); } diff --git a/files/lib/data/conversation/ConversationAction.class.php b/files/lib/data/conversation/ConversationAction.class.php index 07a1a1a..650f178 100644 --- a/files/lib/data/conversation/ConversationAction.class.php +++ b/files/lib/data/conversation/ConversationAction.class.php @@ -107,8 +107,8 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo 'data' => $messageData, 'conversation' => $conversation, 'isFirstPost' => true, - 'attachmentHandler' => (isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null), - 'htmlInputProcessor' => (isset($this->parameters['htmlInputProcessor']) ? $this->parameters['htmlInputProcessor'] : null) + 'attachmentHandler' => isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null, + 'htmlInputProcessor' => isset($this->parameters['htmlInputProcessor']) ? $this->parameters['htmlInputProcessor'] : null ]); $resultValues = $messageAction->executeAction(); @@ -542,7 +542,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo * Validates parameters to hide conversations. */ public function validateHideConversation() { - $this->parameters['hideConversation'] = (isset($this->parameters['hideConversation'])) ? intval($this->parameters['hideConversation']) : null; + $this->parameters['hideConversation'] = isset($this->parameters['hideConversation']) ? intval($this->parameters['hideConversation']) : null; if ($this->parameters['hideConversation'] === null || !in_array($this->parameters['hideConversation'], [Conversation::STATE_DEFAULT, Conversation::STATE_HIDDEN, Conversation::STATE_LEFT])) { throw new UserInputException('hideConversation'); } @@ -859,7 +859,7 @@ class ConversationAction extends AbstractDatabaseObjectAction implements IClipbo $statement->execute($conditionBuilder->getParameters()); $objectIDs = []; - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { if (!$row['messages']) { continue; } diff --git a/files/lib/data/conversation/ConversationEditor.class.php b/files/lib/data/conversation/ConversationEditor.class.php index c95c035..03bf97f 100644 --- a/files/lib/data/conversation/ConversationEditor.class.php +++ b/files/lib/data/conversation/ConversationEditor.class.php @@ -65,7 +65,7 @@ class ConversationEditor extends DatabaseObjectEditor { ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $usernames[$row['userID']] = $row['username']; } } diff --git a/files/lib/data/conversation/ConversationParticipantList.class.php b/files/lib/data/conversation/ConversationParticipantList.class.php index 31689a1..1cccb48 100644 --- a/files/lib/data/conversation/ConversationParticipantList.class.php +++ b/files/lib/data/conversation/ConversationParticipantList.class.php @@ -96,7 +96,7 @@ class ConversationParticipantList extends UserProfileList { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute([$this->conversationID]); $i = 0; - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { // create fake user profiles $this->objects['x'.(++$i)] = UserProfile::getGuestUserProfile($row['username']); $this->indexToObject[] = 'x'.$i; diff --git a/files/lib/data/conversation/UserConversationList.class.php b/files/lib/data/conversation/UserConversationList.class.php index 3251253..8a4f96a 100644 --- a/files/lib/data/conversation/UserConversationList.class.php +++ b/files/lib/data/conversation/UserConversationList.class.php @@ -62,7 +62,7 @@ class UserConversationList extends ConversationList { } else { $this->getConditionBuilder()->add('conversation_to_user.participantID = ?', [$userID]); - $this->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [($this->filter == 'hidden' ? 1 : 0)]); + $this->getConditionBuilder()->add('conversation_to_user.hideConversation = ?', [$this->filter == 'hidden' ? 1 : 0]); $this->sqlConditionJoins = "LEFT JOIN wcf".WCF_N."_conversation conversation ON (conversation.conversationID = conversation_to_user.conversationID)"; if ($this->filter == 'outbox') $this->getConditionBuilder()->add('conversation.userID = ?', [$userID]); } @@ -200,7 +200,7 @@ class UserConversationList extends ConversationList { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $data = []; - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { if (!isset($data[$row['conversationID']])) { $data[$row['conversationID']] = []; } diff --git a/files/lib/data/conversation/ViewableConversation.class.php b/files/lib/data/conversation/ViewableConversation.class.php index 5bbecca..75e7e1b 100644 --- a/files/lib/data/conversation/ViewableConversation.class.php +++ b/files/lib/data/conversation/ViewableConversation.class.php @@ -247,7 +247,7 @@ class ViewableConversation extends DatabaseObjectDecorator { ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $conversation->assignLabel($labels[$row['labelID']]); } } diff --git a/files/lib/data/conversation/label/ConversationLabelAction.class.php b/files/lib/data/conversation/label/ConversationLabelAction.class.php index 97edc65..330adf3 100644 --- a/files/lib/data/conversation/label/ConversationLabelAction.class.php +++ b/files/lib/data/conversation/label/ConversationLabelAction.class.php @@ -135,7 +135,7 @@ class ConversationLabelAction extends AbstractDatabaseObjectAction { } // validate conversation id - $this->parameters['conversationIDs'] = (isset($this->parameters['conversationIDs'])) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : []; + $this->parameters['conversationIDs'] = isset($this->parameters['conversationIDs']) ? ArrayUtil::toIntegerArray($this->parameters['conversationIDs']) : []; if (empty($this->parameters['conversationIDs'])) { throw new UserInputException('conversationID'); } diff --git a/files/lib/data/conversation/message/ConversationMessageAction.class.php b/files/lib/data/conversation/message/ConversationMessageAction.class.php index 7b538c3..82c2181 100644 --- a/files/lib/data/conversation/message/ConversationMessageAction.class.php +++ b/files/lib/data/conversation/message/ConversationMessageAction.class.php @@ -221,7 +221,7 @@ class ConversationMessageAction extends AbstractDatabaseObjectAction implements $this->parameters['htmlInputProcessor']->setObjectID($message->messageID); if ($message->hasEmbeddedObjects != MessageEmbeddedObjectManager::getInstance()->registerObjects($this->parameters['htmlInputProcessor'])) { - $message->update(['hasEmbeddedObjects' => ($message->hasEmbeddedObjects ? 0 : 1)]); + $message->update(['hasEmbeddedObjects' => $message->hasEmbeddedObjects ? 0 : 1]); } } } diff --git a/files/lib/form/ConversationAddForm.class.php b/files/lib/form/ConversationAddForm.class.php index 0998d7d..ec1cb3f 100644 --- a/files/lib/form/ConversationAddForm.class.php +++ b/files/lib/form/ConversationAddForm.class.php @@ -186,7 +186,7 @@ class ConversationAddForm extends MessageForm { 'time' => TIME_NOW, 'userID' => WCF::getUser()->userID, 'username' => WCF::getUser()->username, - 'isDraft' => ($this->draft ? 1 : 0), + 'isDraft' => $this->draft ? 1 : 0, 'participantCanInvite' => $this->participantCanInvite ]); if ($this->draft) { diff --git a/files/lib/page/ConversationPage.class.php b/files/lib/page/ConversationPage.class.php index bfdaf18..14f5556 100644 --- a/files/lib/page/ConversationPage.class.php +++ b/files/lib/page/ConversationPage.class.php @@ -184,7 +184,7 @@ class ConversationPage extends MultipleLinkPage { } // get participants - $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, ($this->conversation->userID == WCF::getUser()->userID)); + $this->participantList = new ConversationParticipantList($this->conversationID, WCF::getUser()->userID, $this->conversation->userID == WCF::getUser()->userID); $this->participantList->readObjects(); // init quote objects diff --git a/files/lib/system/clipboard/action/ConversationClipboardAction.class.php b/files/lib/system/clipboard/action/ConversationClipboardAction.class.php index 0382530..3ff2025 100644 --- a/files/lib/system/clipboard/action/ConversationClipboardAction.class.php +++ b/files/lib/system/clipboard/action/ConversationClipboardAction.class.php @@ -140,7 +140,7 @@ class ConversationClipboardAction extends AbstractClipboardAction { ".$conditions; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $index = array_search($row['conversationID'], $conversationIDs); unset($conversationIDs[$index]); } @@ -220,7 +220,7 @@ class ConversationClipboardAction extends AbstractClipboardAction { $statement = WCF::getDB()->prepareStatement($sql); $statement->execute($conditions->getParameters()); $lastVisitTime = []; - while (($row = $statement->fetchArray())) { + while ($row = $statement->fetchArray()) { $lastVisitTime[$row['conversationID']] = $row['lastVisitTime']; } diff --git a/files/lib/system/worker/ConversationRebuildDataWorker.class.php b/files/lib/system/worker/ConversationRebuildDataWorker.class.php index 852f06f..8f3320e 100644 --- a/files/lib/system/worker/ConversationRebuildDataWorker.class.php +++ b/files/lib/system/worker/ConversationRebuildDataWorker.class.php @@ -145,7 +145,7 @@ class ConversationRebuildDataWorker extends AbstractRebuildDataWorker { // get participant summary $participantStatement->execute([$conversation->conversationID, $conversation->userID, 0]); $users = []; - while (($row = $participantStatement->fetchArray())) { + while ($row = $participantStatement->fetchArray()) { $users[] = $row; } $data['participantSummary'] = serialize($users);