Differential D18019 Diff 43343 src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionReviewTransaction.php
Show All 11 Lines | if (!is_array($value)) { | ||||
return true; | return true; | ||||
} | } | ||||
// If the list of options is the same as the default list, just treat this | // If the list of options is the same as the default list, just treat this | ||||
// as a "take the default action" transaction. | // as a "take the default action" transaction. | ||||
$viewer = $this->getActor(); | $viewer = $this->getActor(); | ||||
list($options, $default) = $this->getActionOptions($viewer, $object); | list($options, $default) = $this->getActionOptions($viewer, $object); | ||||
// Remove reviewers which aren't actionable. In the case of "Accept", we | |||||
// may allow the transaction to proceed with some reviewers who have | |||||
// already accepted, to avoid race conditions where two reviewers fill | |||||
// out the form at the same time and accept on behalf of the same package. | |||||
// It's okay for these reviewers to survive validation, but they should | |||||
// not survive beyond this point. | |||||
lvital: ๐ | |||||
$value = array_fuse($value); | |||||
$value = array_intersect($value, array_keys($options)); | |||||
$value = array_values($value); | |||||
sort($default); | sort($default); | ||||
sort($value); | sort($value); | ||||
if ($default === $value) { | if ($default === $value) { | ||||
return true; | return true; | ||||
} | } | ||||
return $value; | return $value; | ||||
โฒ Show 20 Lines โข Show All 256 Lines โข Show Last 20 Lines |
๐