Differential D17067 Diff 41083 src/applications/differential/field/DifferentialReviewersCommitMessageField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/field/DifferentialReviewersCommitMessageField.php
| Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | foreach ($value as $reviewer) { | ||||
| if (isset($reviewer['suffixes']['!'])) { | if (isset($reviewer['suffixes']['!'])) { | ||||
| $suffix_map[$phid] = '!'; | $suffix_map[$phid] = '!'; | ||||
| } | } | ||||
| } | } | ||||
| return $this->renderHandleList($phid_list, $suffix_map); | return $this->renderHandleList($phid_list, $suffix_map); | ||||
| } | } | ||||
| public function getFieldTransactions($value) { | |||||
| $value = $this->inflateReviewers($value); | |||||
| $reviewer_list = array(); | |||||
| foreach ($value as $reviewer) { | |||||
| $phid = $reviewer['phid']; | |||||
| if (isset($reviewer['suffixes']['!'])) { | |||||
| $reviewer_list[] = 'blocking('.$phid.')'; | |||||
| } else { | |||||
| $reviewer_list[] = $phid; | |||||
| } | |||||
| } | |||||
| $xaction_key = DifferentialRevisionReviewersTransaction::EDITKEY; | |||||
| $xaction_type = "{$xaction_key}.set"; | |||||
| return array( | |||||
| array( | |||||
| 'type' => $xaction_type, | |||||
| 'value' => $reviewer_list, | |||||
| ), | |||||
| ); | |||||
| } | |||||
| private function flattenReviewers(array $values) { | private function flattenReviewers(array $values) { | ||||
| // NOTE: For now, `arc` relies on this field returning only scalars, so we | // NOTE: For now, `arc` relies on this field returning only scalars, so we | ||||
| // need to reduce the results into scalars. See T10981. | // need to reduce the results into scalars. See T10981. | ||||
| $result = array(); | $result = array(); | ||||
| foreach ($values as $value) { | foreach ($values as $value) { | ||||
| $result[] = $value['phid'].implode('', array_keys($value['suffixes'])); | $result[] = $value['phid'].implode('', array_keys($value['suffixes'])); | ||||
| } | } | ||||
| Show All 25 Lines | |||||