From 9383abc6b07c20e4a8542fde46d025cf5b9efaa3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 24 Jul 2013 15:30:26 -0700 Subject: [PATCH] Remove unnecessary empty checks from willFilterPage() Summary: Fixes T3600. These checks are obsolete after D6512. Test Plan: Syntax / static / inspection. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3600 Differential Revision: https://secure.phabricator.com/D6563 --- .../differential/query/DifferentialRevisionQuery.php | 4 ---- src/applications/diviner/query/DivinerAtomQuery.php | 4 ---- src/applications/legalpad/query/LegalpadDocumentQuery.php | 4 ---- src/applications/macro/query/PhabricatorMacroQuery.php | 4 ---- src/applications/paste/query/PhabricatorPasteQuery.php | 4 ---- src/applications/phortune/query/PhortuneAccountQuery.php | 4 ---- .../phortune/query/PhortunePaymentMethodQuery.php | 4 ---- src/applications/phriction/query/PhrictionDocumentQuery.php | 4 ---- src/applications/slowvote/query/PhabricatorSlowvoteQuery.php | 4 ---- .../tokens/query/PhabricatorTokenReceiverQuery.php | 4 ---- 10 files changed, 40 deletions(-) diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php index ca9edbbe93..a4c377ec24 100644 --- a/src/applications/differential/query/DifferentialRevisionQuery.php +++ b/src/applications/differential/query/DifferentialRevisionQuery.php @@ -360,10 +360,6 @@ final class DifferentialRevisionQuery } public function willFilterPage(array $revisions) { - if (!$revisions) { - return $revisions; - } - $table = new DifferentialRevision(); $conn_r = $table->establishConnection('r'); diff --git a/src/applications/diviner/query/DivinerAtomQuery.php b/src/applications/diviner/query/DivinerAtomQuery.php index 90bbbe0f02..6de47c4614 100644 --- a/src/applications/diviner/query/DivinerAtomQuery.php +++ b/src/applications/diviner/query/DivinerAtomQuery.php @@ -75,10 +75,6 @@ final class DivinerAtomQuery } protected function willFilterPage(array $atoms) { - if (!$atoms) { - return $atoms; - } - $books = array_unique(mpull($atoms, 'getBookPHID')); $books = id(new DivinerBookQuery()) diff --git a/src/applications/legalpad/query/LegalpadDocumentQuery.php b/src/applications/legalpad/query/LegalpadDocumentQuery.php index 264bf3e018..ccca424de9 100644 --- a/src/applications/legalpad/query/LegalpadDocumentQuery.php +++ b/src/applications/legalpad/query/LegalpadDocumentQuery.php @@ -75,10 +75,6 @@ final class LegalpadDocumentQuery } protected function willFilterPage(array $documents) { - if (!$documents) { - return $documents; - } - if ($this->needDocumentBodies) { $documents = $this->loadDocumentBodies($documents); } diff --git a/src/applications/macro/query/PhabricatorMacroQuery.php b/src/applications/macro/query/PhabricatorMacroQuery.php index 70b3b2018d..f5647e6efc 100644 --- a/src/applications/macro/query/PhabricatorMacroQuery.php +++ b/src/applications/macro/query/PhabricatorMacroQuery.php @@ -157,10 +157,6 @@ final class PhabricatorMacroQuery } protected function willFilterPage(array $macros) { - if (!$macros) { - return array(); - } - $file_phids = mpull($macros, 'getFilePHID'); $files = id(new PhabricatorFileQuery()) ->setViewer($this->getViewer()) diff --git a/src/applications/paste/query/PhabricatorPasteQuery.php b/src/applications/paste/query/PhabricatorPasteQuery.php index 0dd8ed33d5..d0aaac75a9 100644 --- a/src/applications/paste/query/PhabricatorPasteQuery.php +++ b/src/applications/paste/query/PhabricatorPasteQuery.php @@ -85,10 +85,6 @@ final class PhabricatorPasteQuery } protected function willFilterPage(array $pastes) { - if (!$pastes) { - return $pastes; - } - if ($this->needRawContent) { $pastes = $this->loadRawContent($pastes); } diff --git a/src/applications/phortune/query/PhortuneAccountQuery.php b/src/applications/phortune/query/PhortuneAccountQuery.php index 63eab3d200..ca48f78767 100644 --- a/src/applications/phortune/query/PhortuneAccountQuery.php +++ b/src/applications/phortune/query/PhortuneAccountQuery.php @@ -39,10 +39,6 @@ final class PhortuneAccountQuery } protected function willFilterPage(array $accounts) { - if (!$accounts) { - return array(); - } - $query = id(new PhabricatorEdgeQuery()) ->withSourcePHIDs(mpull($accounts, 'getPHID')) ->withEdgeTypes(array(PhabricatorEdgeConfig::TYPE_ACCOUNT_HAS_MEMBER)); diff --git a/src/applications/phortune/query/PhortunePaymentMethodQuery.php b/src/applications/phortune/query/PhortunePaymentMethodQuery.php index a950d1a4b6..552845bfaa 100644 --- a/src/applications/phortune/query/PhortunePaymentMethodQuery.php +++ b/src/applications/phortune/query/PhortunePaymentMethodQuery.php @@ -47,10 +47,6 @@ final class PhortunePaymentMethodQuery } protected function willFilterPage(array $methods) { - if (!$methods) { - return array(); - } - $accounts = id(new PhortuneAccountQuery()) ->setViewer($this->getViewer()) ->withPHIDs(mpull($methods, 'getAccountPHID')) diff --git a/src/applications/phriction/query/PhrictionDocumentQuery.php b/src/applications/phriction/query/PhrictionDocumentQuery.php index 449e5a9a31..a45d701ed5 100644 --- a/src/applications/phriction/query/PhrictionDocumentQuery.php +++ b/src/applications/phriction/query/PhrictionDocumentQuery.php @@ -60,10 +60,6 @@ final class PhrictionDocumentQuery } protected function willFilterPage(array $documents) { - if (!$documents) { - return array(); - } - $contents = id(new PhrictionContent())->loadAllWhere( 'id IN (%Ld)', mpull($documents, 'getContentID')); diff --git a/src/applications/slowvote/query/PhabricatorSlowvoteQuery.php b/src/applications/slowvote/query/PhabricatorSlowvoteQuery.php index 0f3a4d6f68..28963a44bc 100644 --- a/src/applications/slowvote/query/PhabricatorSlowvoteQuery.php +++ b/src/applications/slowvote/query/PhabricatorSlowvoteQuery.php @@ -69,10 +69,6 @@ final class PhabricatorSlowvoteQuery public function willFilterPage(array $polls) { assert_instances_of($polls, 'PhabricatorSlowvotePoll'); - if (!$polls) { - return array(); - } - $ids = mpull($polls, 'getID'); $viewer = $this->getViewer(); diff --git a/src/applications/tokens/query/PhabricatorTokenReceiverQuery.php b/src/applications/tokens/query/PhabricatorTokenReceiverQuery.php index accafd697c..196954d43b 100644 --- a/src/applications/tokens/query/PhabricatorTokenReceiverQuery.php +++ b/src/applications/tokens/query/PhabricatorTokenReceiverQuery.php @@ -19,10 +19,6 @@ final class PhabricatorTokenReceiverQuery } public function willFilterPage(array $phids) { - if (!$phids) { - return array(); - } - $objects = id(new PhabricatorObjectHandleData($phids)) ->setViewer($this->getViewer()) ->loadObjects();