Differential D17059 Diff 41035 src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/xaction/DifferentialRevisionReviewersTransaction.php
| Show First 20 Lines • Show All 280 Lines • ▼ Show 20 Lines | if ($this->isTextMode()) { | ||||
| return phutil_implode_html(' ', $parts); | return phutil_implode_html(' ', $parts); | ||||
| } | } | ||||
| } | } | ||||
| public function validateTransactions($object, array $xactions) { | public function validateTransactions($object, array $xactions) { | ||||
| $actor = $this->getActor(); | $actor = $this->getActor(); | ||||
| $errors = array(); | $errors = array(); | ||||
| if (!$xactions) { | |||||
| // If we aren't applying new reviewer transactions, just bail. We need | |||||
| // reviewers to be attached to the revision continue validation, and | |||||
| // they won't always be (for example, when mentioning a revision). | |||||
| return $errors; | |||||
| } | |||||
| $author_phid = $object->getAuthorPHID(); | $author_phid = $object->getAuthorPHID(); | ||||
| $config_self_accept_key = 'differential.allow-self-accept'; | $config_self_accept_key = 'differential.allow-self-accept'; | ||||
| $allow_self_accept = PhabricatorEnv::getEnvConfig($config_self_accept_key); | $allow_self_accept = PhabricatorEnv::getEnvConfig($config_self_accept_key); | ||||
| $old = $this->generateOldValue($object); | $old = $this->generateOldValue($object); | ||||
| foreach ($xactions as $xaction) { | foreach ($xactions as $xaction) { | ||||
| $new = $this->generateNewValue($object, $xaction->getNewValue()); | $new = $this->generateNewValue($object, $xaction->getNewValue()); | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||