Differential D18625 Diff 44719 src/applications/differential/constants/DifferentialRevisionStatus.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/constants/DifferentialRevisionStatus.php
| <?php | <?php | ||||
| final class DifferentialRevisionStatus extends Phobject { | final class DifferentialRevisionStatus extends Phobject { | ||||
| const NEEDS_REVIEW = 'needs-review'; | const NEEDS_REVIEW = 'needs-review'; | ||||
| const NEEDS_REVISION = 'needs-revision'; | const NEEDS_REVISION = 'needs-revision'; | ||||
| const CHANGES_PLANNED = 'changes-planned'; | const CHANGES_PLANNED = 'changes-planned'; | ||||
| const ACCEPTED = 'accepted'; | const ACCEPTED = 'accepted'; | ||||
| const PUBLISHED = 'published'; | const PUBLISHED = 'published'; | ||||
| const ABANDONED = 'abandoned'; | const ABANDONED = 'abandoned'; | ||||
| const DRAFT = 'draft'; | |||||
| private $key; | private $key; | ||||
| private $spec = array(); | private $spec = array(); | ||||
| public function getKey() { | public function getKey() { | ||||
| return $this->key; | return $this->key; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | final class DifferentialRevisionStatus extends Phobject { | ||||
| public function isPublished() { | public function isPublished() { | ||||
| return ($this->key === self::PUBLISHED); | return ($this->key === self::PUBLISHED); | ||||
| } | } | ||||
| public function isChangePlanned() { | public function isChangePlanned() { | ||||
| return ($this->key === self::CHANGES_PLANNED); | return ($this->key === self::CHANGES_PLANNED); | ||||
| } | } | ||||
| public function isDraft() { | |||||
| return ($this->key === self::DRAFT); | |||||
| } | |||||
| public static function newForStatus($status) { | public static function newForStatus($status) { | ||||
| $result = new self(); | $result = new self(); | ||||
| $map = self::getMap(); | $map = self::getMap(); | ||||
| if (isset($map[$status])) { | if (isset($map[$status])) { | ||||
| $result->key = $status; | $result->key = $status; | ||||
| $result->spec = $map[$status]; | $result->spec = $map[$status]; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | return array( | ||||
| 'name' => pht('Abandoned'), | 'name' => pht('Abandoned'), | ||||
| 'legacy' => 4, | 'legacy' => 4, | ||||
| 'icon' => 'fa-plane', | 'icon' => 'fa-plane', | ||||
| 'closed' => true, | 'closed' => true, | ||||
| 'color.icon' => 'black', | 'color.icon' => 'black', | ||||
| 'color.tag' => 'indigo', | 'color.tag' => 'indigo', | ||||
| 'color.ansi' => null, | 'color.ansi' => null, | ||||
| ), | ), | ||||
| self::DRAFT => array( | |||||
| 'name' => pht('Draft'), | |||||
| // For legacy clients, treat this as though it is "Needs Review". | |||||
| 'legacy' => 0, | |||||
| 'icon' => 'fa-file-text-o', | |||||
| 'closed' => false, | |||||
| 'color.icon' => 'grey', | |||||
| 'color.tag' => 'grey', | |||||
| 'color.ansi' => null, | |||||
| ), | |||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||