1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

Continue reducing callsites to ArcanistDifferentialRevisionStatus in transactions

Summary: Ref T2543. Cleans up some more references to ArcanistDifferentialRevisionStatus, moving toward getting rid of it completely.

Test Plan: Planned changes, requested review, inspected the "close" one since it isn't trivial to trigger.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T2543

Differential Revision: https://secure.phabricator.com/D18408
This commit is contained in:
epriestley 2017-08-11 13:23:41 -07:00
parent 36197bf783
commit 77bf245637
3 changed files with 4 additions and 10 deletions

View file

@ -35,15 +35,11 @@ final class DifferentialRevisionCloseTransaction
}
public function applyInternalEffects($object, $value) {
$was_accepted = $object->isAccepted();
$status_closed = ArcanistDifferentialRevisionStatus::CLOSED;
$status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED;
$old_status = $object->getStatus();
$object->setStatus($status_closed);
$was_accepted = ($old_status == $status_accepted);
$object->setProperty(
DifferentialRevision::PROPERTY_CLOSED_FROM_ACCEPTED,
$was_accepted);

View file

@ -46,8 +46,7 @@ final class DifferentialRevisionPlanChangesTransaction
}
public function generateOldValue($object) {
$status_planned = ArcanistDifferentialRevisionStatus::CHANGES_PLANNED;
return ($object->getStatus() == $status_planned);
return $object->isChangePlanned();
}
public function applyInternalEffects($object, $value) {

View file

@ -27,8 +27,7 @@ final class DifferentialRevisionRequestReviewTransaction
}
public function generateOldValue($object) {
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
return ($object->getStatus() == $status_review);
return $object->isNeedsReview();
}
public function applyInternalEffects($object, $value) {