Remove unnecessary parentheses
authorMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 07:25:48 +0000 (09:25 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 31 Jul 2016 07:25:48 +0000 (09:25 +0200)
12 files changed:
files/lib/data/conversation/Conversation.class.php
files/lib/data/conversation/ConversationAction.class.php
files/lib/data/conversation/ConversationEditor.class.php
files/lib/data/conversation/ConversationParticipantList.class.php
files/lib/data/conversation/UserConversationList.class.php
files/lib/data/conversation/ViewableConversation.class.php
files/lib/data/conversation/label/ConversationLabelAction.class.php
files/lib/data/conversation/message/ConversationMessageAction.class.php
files/lib/form/ConversationAddForm.class.php
files/lib/page/ConversationPage.class.php
files/lib/system/clipboard/action/ConversationClipboardAction.class.php
files/lib/system/worker/ConversationRebuildDataWorker.class.php

index 05756ab01f8c4252b3fab956387a623bac44d475..29c366a8573af3d5f2551302d16bc83e2d6d4221 100644 (file)
@@ -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]);
                        }
index 07a1a1ac3651775f649644b221b0502425e7ebf4..650f178095f770060e4467b52d71ceb8bc1b96e1 100644 (file)
@@ -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;
                        }
index c95c03533515c95eb7c25d7b4e91a9e6c4d9119b..03bf97fe33728c56531c71716e5cca1c0e500e74 100644 (file)
@@ -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'];
                        }
                }
index 31689a1c7f84b0a9858c5c6c47dde5b6b7aff6dc..1cccb484b881ae76c5018fba238df53c4c5a63f4 100644 (file)
@@ -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;
index 325125346639d715149a23282c816ec8046c18c3..8a4f96aa7a82fcf3ffcd7618b3531342764bff74 100644 (file)
@@ -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']] = [];
                        }
index 5bbecca28044d82f5cfa6c1593f928b536f7b4d5..75e7e1b5892bb9845d80d10d96ca95aa0ca2c7d2 100644 (file)
@@ -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']]);
                        }
                }
index 97edc6514217e1964ca411cb78fbe87552d8b746..330adf3de65bf0f16e17b49cb15fcd21515aaf29 100644 (file)
@@ -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');
                }
index 7b538c3ecaf38d6bd495aa940747de8ea838c1e3..82c2181c254d768b273136b4f942f02e9027f3b8 100644 (file)
@@ -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]);
                                        }
                                }
                        }
index 0998d7dc76eea77a6d73819835773cd106fa66a7..ec1cb3f800e9bcade578cad689a960d421ece44f 100644 (file)
@@ -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) {
index bfdaf182016272170fc79578713416619f2eb660..14f5556aa1b03310461d5fe5d0af6d367a84d144 100644 (file)
@@ -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
index 0382530ccfa58325773f5888cd912c5cc6ba3db2..3ff202572c5cc705d429752245df2cda2455eb45 100644 (file)
@@ -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'];
                }
                
index 852f06fae813559e1ce810f183366e337209ab2a..8f3320e9a261ab15b4a3be02a35da184c2904114 100644 (file)
@@ -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);