Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / diffusion / herald / DiffusionPreCommitContentRevisionAcceptingReviewersHeraldField.php
blobb6d50d4a2ae00d87b8cc69ef74ce6c4c04552111
1 <?php
3 final class DiffusionPreCommitContentRevisionAcceptingReviewersHeraldField
4 extends DiffusionPreCommitContentHeraldField {
6 const FIELDCONST = 'diffusion.pre.content.revision.accepting';
8 public function getHeraldFieldName() {
9 return pht('Accepting reviewers');
12 public function getFieldGroupKey() {
13 return HeraldRelatedFieldGroup::FIELDGROUPKEY;
16 public function getHeraldFieldValue($object) {
17 $revision = $this->getAdapter()->getRevision();
19 if (!$revision) {
20 return array();
23 $diff_phid = $revision->getActiveDiffPHID();
25 $reviewer_phids = array();
26 foreach ($revision->getReviewers() as $reviewer) {
27 if ($reviewer->isAccepted($diff_phid)) {
28 $reviewer_phids[] = $reviewer->getReviewerPHID();
32 return $reviewer_phids;
35 protected function getHeraldFieldStandardType() {
36 return self::STANDARD_PHID_LIST;
39 protected function getDatasource() {
40 return new DifferentialReviewerDatasource();