From 77bf2456370407b634c945702b07ebc8f4e0ab5a Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 11 Aug 2017 13:23:41 -0700 Subject: [PATCH] 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 --- .../xaction/DifferentialRevisionCloseTransaction.php | 8 ++------ .../DifferentialRevisionPlanChangesTransaction.php | 3 +-- .../DifferentialRevisionRequestReviewTransaction.php | 3 +-- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php b/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php index 30bfd5044f..30ca39a362 100644 --- a/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionCloseTransaction.php @@ -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); diff --git a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php index 58152bdb67..043071dc96 100644 --- a/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionPlanChangesTransaction.php @@ -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) { diff --git a/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php b/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php index 65b96d6d8e..2dae24b6fa 100644 --- a/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php +++ b/src/applications/differential/xaction/DifferentialRevisionRequestReviewTransaction.php @@ -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) {