mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-06 11:58:30 +01:00
Summary: Ref T10967. Improves some method names: - `Revision->getReviewerStatus()` -> `Revision->getReviewers()` - `Revision->attachReviewerStatus()` -> `Revision->attachReviewers()` - `Reviewer->getStatus()` -> `Reviewer->getReviewerStatus()` (this is mostly to make this more greppable) Test Plan: - bunch o' `grep` - Browsed around. - If I missed anything, it should fatal in an obvious way. We have a lot of other `getStatus()` calls and it's hard to be sure I got them all. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17522
59 lines
1.3 KiB
PHP
59 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class DifferentialReviewedByCommitMessageField
|
|
extends DifferentialCommitMessageField {
|
|
|
|
const FIELDKEY = 'reviewedByPHIDs';
|
|
|
|
public function getFieldName() {
|
|
return pht('Reviewed By');
|
|
}
|
|
|
|
public function getFieldOrder() {
|
|
return 5000;
|
|
}
|
|
|
|
public function parseFieldValue($value) {
|
|
return $this->parseObjectList(
|
|
$value,
|
|
array(
|
|
PhabricatorPeopleUserPHIDType::TYPECONST,
|
|
PhabricatorProjectProjectPHIDType::TYPECONST,
|
|
),
|
|
$allow_partial = true);
|
|
}
|
|
|
|
public function isFieldEditable() {
|
|
return false;
|
|
}
|
|
|
|
public function isTemplateField() {
|
|
return false;
|
|
}
|
|
|
|
public function readFieldValueFromObject(DifferentialRevision $revision) {
|
|
if (!$revision->getPHID()) {
|
|
return array();
|
|
}
|
|
|
|
$phids = array();
|
|
foreach ($revision->getReviewers() as $reviewer) {
|
|
switch ($reviewer->getReviewerStatus()) {
|
|
case DifferentialReviewerStatus::STATUS_ACCEPTED:
|
|
$phids[] = $reviewer->getReviewerPHID();
|
|
break;
|
|
}
|
|
}
|
|
|
|
return $phids;
|
|
}
|
|
|
|
public function readFieldValueFromConduit($value) {
|
|
return $this->readStringListFieldValueFromConduit($value);
|
|
}
|
|
|
|
public function renderFieldValue($value) {
|
|
return $this->renderHandleList($value);
|
|
}
|
|
|
|
}
|