Path: blob/master/src/applications/differential/constants/DifferentialReviewerStatus.php
12256 views
<?php12final class DifferentialReviewerStatus extends Phobject {34const STATUS_BLOCKING = 'blocking';5const STATUS_ADDED = 'added';6const STATUS_ACCEPTED = 'accepted';7const STATUS_REJECTED = 'rejected';8const STATUS_COMMENTED = 'commented';9const STATUS_ACCEPTED_OLDER = 'accepted-older';10const STATUS_REJECTED_OLDER = 'rejected-older';11const STATUS_RESIGNED = 'resigned';1213/**14* Returns the relative strength of a status, used to pick a winner when a15* transaction group makes several status changes to a particular reviewer.16*17* For example, if you accept a revision and leave a comment, the transactions18* will attempt to update you to both "commented" and "accepted". We want19* "accepted" to win, because it's the stronger of the two.20*21* @param const Reviewer status constant.22* @return int Relative strength (higher is stronger).23*/24public static function getStatusStrength($constant) {25$map = array(26self::STATUS_ADDED => 1,2728self::STATUS_COMMENTED => 2,2930self::STATUS_BLOCKING => 3,3132self::STATUS_ACCEPTED_OLDER => 4,33self::STATUS_REJECTED_OLDER => 4,3435self::STATUS_ACCEPTED => 5,36self::STATUS_REJECTED => 5,37self::STATUS_RESIGNED => 5,38);3940return idx($map, $constant, 0);41}4243}444546