Rename "needReviewerStatus()" into "needReviewers()"

Summary: Ref T10967. The old name was because we had a `getReviewers()` tied to `needRelationships()`, rename this method to use a simpler and more clear name.

Test Plan: `grep`, browsed around.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10967

Differential Revision: https://secure.phabricator.com/D17519
This commit is contained in:
epriestley
2017-03-20 14:37:24 -07:00
parent d179d0150c
commit a15df4f8d5
22 changed files with 29 additions and 29 deletions

View File

@@ -44,7 +44,7 @@ final class DifferentialCloseConduitAPIMethod
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($id))
->setViewer($viewer)
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
if (!$revision) {
throw new ConduitException('ERR_NOT_FOUND');

View File

@@ -47,7 +47,7 @@ final class DifferentialCreateCommentConduitAPIMethod
$revision = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($request->getValue('revision_id')))
->needReviewerStatus(true)
->needReviewers(true)
->needReviewerAuthority(true)
->executeOne();
if (!$revision) {

View File

@@ -39,7 +39,7 @@ final class DifferentialGetCommitMessageConduitAPIMethod
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($id))
->setViewer($viewer)
->needReviewerStatus(true)
->needReviewers(true)
->needActiveDiffs(true)
->executeOne();
if (!$revision) {

View File

@@ -42,7 +42,7 @@ final class DifferentialGetRevisionConduitAPIMethod
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($revision_id))
->setViewer($request->getUser())
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
if (!$revision) {

View File

@@ -182,7 +182,7 @@ final class DifferentialQueryConduitAPIMethod
$query->withBranches($branches);
}
$query->needReviewerStatus(true);
$query->needReviewers(true);
$query->needCommitPHIDs(true);
$query->needDiffIDs(true);
$query->needActiveDiffs(true);

View File

@@ -57,7 +57,7 @@ final class DifferentialUpdateRevisionConduitAPIMethod
$revision = id(new DifferentialRevisionQuery())
->setViewer($request->getUser())
->withIDs(array($request->getValue('id')))
->needReviewerStatus(true)
->needReviewers(true)
->needActiveDiffs(true)
->requireCapabilities(
array(

View File

@@ -17,7 +17,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($this->revisionID))
->setViewer($viewer)
->needReviewerStatus(true)
->needReviewers(true)
->needReviewerAuthority(true)
->executeOne();
if (!$revision) {
@@ -784,7 +784,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
->setLimit(10)
->needFlags(true)
->needDrafts(true)
->needReviewerStatus(true);
->needReviewers(true);
foreach ($path_map as $path => $path_id) {
$query->withPath($repository->getID(), $path_id);

View File

@@ -26,7 +26,7 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher
return id(new DifferentialRevisionQuery())
->setViewer($this->getViewer())
->withIDs(array($object->getID()))
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
}

View File

@@ -41,7 +41,7 @@ final class DifferentialRevisionEditEngine
protected function newObjectQuery() {
return id(new DifferentialRevisionQuery())
->needActiveDiffs(true)
->needReviewerStatus(true)
->needReviewers(true)
->needReviewerAuthority(true);
}

View File

@@ -614,7 +614,7 @@ final class DifferentialTransactionEditor
$new_revision = id(new DifferentialRevisionQuery())
->setViewer($this->getActor())
->needReviewerStatus(true)
->needReviewers(true)
->needActiveDiffs(true)
->withIDs(array($object->getID()))
->executeOne();
@@ -1575,7 +1575,7 @@ final class DifferentialTransactionEditor
->setViewer($this->getActor())
->withPHIDs(array($object->getPHID()))
->needActiveDiffs(true)
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
if (!$revision) {
throw new Exception(
@@ -1791,7 +1791,7 @@ final class DifferentialTransactionEditor
// Reload to pick up the active diff and reviewer status.
return id(new DifferentialRevisionQuery())
->setViewer($this->getActor())
->needReviewerStatus(true)
->needReviewers(true)
->needActiveDiffs(true)
->withIDs(array($object->getID()))
->executeOne();

View File

@@ -25,7 +25,7 @@ final class DifferentialHovercardEngineExtension
$revisions = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withPHIDs($phids)
->needReviewerStatus(true)
->needReviewers(true)
->execute();
$revisions = mpull($revisions, null, 'getPHID');

View File

@@ -85,7 +85,7 @@ final class HeraldDifferentialRevisionAdapter
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($revision->getID()))
->setViewer(PhabricatorUser::getOmnipotentUser())
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
$object->revision = $revision;

View File

@@ -18,7 +18,7 @@ final class DifferentialRevisionMailReceiver
return id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($id))
->needReviewerStatus(true)
->needReviewers(true)
->needReviewerAuthority(true)
->needActiveDiffs(true)
->executeOne();

View File

@@ -47,7 +47,7 @@ final class DifferentialRevisionQuery
private $needDiffIDs = false;
private $needCommitPHIDs = false;
private $needHashes = false;
private $needReviewerStatus = false;
private $needReviewers = false;
private $needReviewerAuthority;
private $needDrafts;
private $needFlags;
@@ -283,14 +283,14 @@ final class DifferentialRevisionQuery
/**
* Set whether or not the query should load associated reviewer status.
* Set whether or not the query should load associated reviewers.
*
* @param bool True to load and attach reviewers.
* @return this
* @task config
*/
public function needReviewerStatus($need_reviewer_status) {
$this->needReviewerStatus = $need_reviewer_status;
public function needReviewers($need_reviewers) {
$this->needReviewers = $need_reviewers;
return $this;
}
@@ -429,7 +429,7 @@ final class DifferentialRevisionQuery
$this->loadHashes($conn_r, $revisions);
}
if ($this->needReviewerStatus || $this->needReviewerAuthority) {
if ($this->needReviewers || $this->needReviewerAuthority) {
$this->loadReviewers($conn_r, $revisions);
}

View File

@@ -19,7 +19,7 @@ final class DifferentialRevisionSearchEngine
return id(new DifferentialRevisionQuery())
->needFlags(true)
->needDrafts(true)
->needReviewerStatus(true);
->needReviewers(true);
}
protected function buildQueryFromParameters(array $map) {

View File

@@ -10,7 +10,7 @@ final class DifferentialRevisionFulltextEngine
$revision = id(new DifferentialRevisionQuery())
->setViewer($this->getViewer())
->withPHIDs(array($object->getPHID()))
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
// TODO: This isn't very clean, but custom fields currently rely on it.

View File

@@ -478,7 +478,7 @@ final class DifferentialRevision extends DifferentialDAO
$reviewers = id(new DifferentialRevisionQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withPHIDs(array($this->getPHID()))
->needReviewerStatus(true)
->needReviewers(true)
->executeOne()
->getReviewerStatus();
} else {

View File

@@ -1765,7 +1765,7 @@ final class DiffusionBrowseController extends DiffusionController {
->withUpdatedEpochBetween($recent, null)
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
->setLimit(10)
->needReviewerStatus(true)
->needReviewers(true)
->needFlags(true)
->needDrafts(true)
->execute();

View File

@@ -190,7 +190,7 @@ final class HeraldCommitAdapter
$revision = id(new DifferentialRevisionQuery())
->withIDs(array($revision_id))
->setViewer(PhabricatorUser::getOmnipotentUser())
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
if ($revision) {
$this->affectedRevision = $revision;

View File

@@ -190,7 +190,7 @@ final class HeraldPreCommitContentAdapter extends HeraldPreCommitAdapter {
$this->revision = id(new DifferentialRevisionQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withIDs(array($revision_id))
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
}
}

View File

@@ -67,7 +67,7 @@ final class PhabricatorRepositoryCommitOwnersWorker
$revision = id(new DifferentialRevisionQuery())
->setViewer($viewer)
->withIDs(array($revision_id))
->needReviewerStatus(true)
->needReviewers(true)
->executeOne();
} else {
$revision = null;

View File

@@ -178,7 +178,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$revision_query = id(new DifferentialRevisionQuery())
->withIDs(array($revision_id))
->setViewer($actor)
->needReviewerStatus(true)
->needReviewers(true)
->needActiveDiffs(true);
$revision = $revision_query->executeOne();