diff --git a/src/applications/audit/controller/PhabricatorAuditListController.php b/src/applications/audit/controller/PhabricatorAuditListController.php index 73afb12c1f..f68862fa3c 100644 --- a/src/applications/audit/controller/PhabricatorAuditListController.php +++ b/src/applications/audit/controller/PhabricatorAuditListController.php @@ -1,8 +1,7 @@ delegateToController($controller); } - public function renderResultsList( - array $commits, - PhabricatorSavedQuery $query) { - assert_instances_of($commits, 'PhabricatorRepositoryCommit'); - - $viewer = $this->getRequest()->getUser(); - $nodata = pht('No matching audits.'); - $view = id(new PhabricatorAuditListView()) - ->setUser($viewer) - ->setCommits($commits) - ->setAuthorityPHIDs( - PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer)) - ->setNoDataString($nodata); - - $phids = $view->getRequiredHandlePHIDs(); - $handles = $this->loadViewerHandles($phids); - $view->setHandles($handles); - return $view->buildList(); - } } diff --git a/src/applications/audit/query/PhabricatorCommitSearchEngine.php b/src/applications/audit/query/PhabricatorCommitSearchEngine.php index dcbaaa445c..a24a11a7f1 100644 --- a/src/applications/audit/query/PhabricatorCommitSearchEngine.php +++ b/src/applications/audit/query/PhabricatorCommitSearchEngine.php @@ -159,4 +159,35 @@ final class PhabricatorCommitSearchEngine ); } + protected function renderResultList( + array $commits, + PhabricatorSavedQuery $query, + array $handles) { + + assert_instances_of($commits, 'PhabricatorRepositoryCommit'); + + $viewer = $this->requireViewer(); + $nodata = pht('No matching audits.'); + $view = id(new PhabricatorAuditListView()) + ->setUser($viewer) + ->setCommits($commits) + ->setAuthorityPHIDs( + PhabricatorAuditCommentEditor::loadAuditPHIDsForUser($viewer)) + ->setNoDataString($nodata); + + $phids = $view->getRequiredHandlePHIDs(); + if ($phids) { + $handles = id(new PhabricatorHandleQuery()) + ->setViewer($viewer) + ->withPHIDs($phids) + ->execute(); + } else { + $handles = array(); + } + + $view->setHandles($handles); + + return $view->buildList(); + } + } diff --git a/src/applications/feed/query/PhabricatorFeedSearchEngine.php b/src/applications/feed/query/PhabricatorFeedSearchEngine.php index 725e2d474e..3c8ce59a76 100644 --- a/src/applications/feed/query/PhabricatorFeedSearchEngine.php +++ b/src/applications/feed/query/PhabricatorFeedSearchEngine.php @@ -124,7 +124,7 @@ final class PhabricatorFeedSearchEngine return parent::buildSavedQueryFromBuiltin($query_key); } - public function renderResultList( + protected function renderResultList( array $objects, PhabricatorSavedQuery $query, array $handles) { diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php index e05261bd47..bfc0cd748a 100644 --- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php +++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php @@ -576,13 +576,13 @@ abstract class PhabricatorApplicationSearchEngine { return $this->renderResultList($objects, $query, $handles); } - public function getRequiredHandlePHIDsForResultList( + protected function getRequiredHandlePHIDsForResultList( array $objects, PhabricatorSavedQuery $query) { return array(); } - public function renderResultList( + protected function renderResultList( array $objects, PhabricatorSavedQuery $query, array $handles) { diff --git a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php index 1377cfaab9..708af75e5c 100644 --- a/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php +++ b/src/applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php @@ -121,7 +121,7 @@ final class PhabricatorSlowvoteSearchEngine return mpull($polls, 'getAuthorPHID'); } - public function renderResultList( + protected function renderResultList( array $polls, PhabricatorSavedQuery $query, array $handles) {