Differential D20466 Diff 48841 src/applications/repository/storage/PhabricatorRepositoryCommitData.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryCommitData.php
| Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | public function toDictionary() { | ||||
| ); | ); | ||||
| } | } | ||||
| public static function newFromDictionary(array $dict) { | public static function newFromDictionary(array $dict) { | ||||
| return id(new PhabricatorRepositoryCommitData()) | return id(new PhabricatorRepositoryCommitData()) | ||||
| ->loadFromArray($dict); | ->loadFromArray($dict); | ||||
| } | } | ||||
| public function getPublisherHoldReasons() { | public function newPublisherHoldReasons() { | ||||
| $holds = $this->getCommitDetail('holdReasons'); | $holds = $this->getCommitDetail('holdReasons'); | ||||
| // Look for the legacy "autocloseReason" if we don't have a modern list | // Look for the legacy "autocloseReason" if we don't have a modern list | ||||
| // of hold reasons. | // of hold reasons. | ||||
| if (!$holds) { | if (!$holds) { | ||||
| $old_hold = $this->getCommitDetail('autocloseReason'); | $old_hold = $this->getCommitDetail('autocloseReason'); | ||||
| if ($old_hold) { | if ($old_hold) { | ||||
| $holds = array($old_hold); | $holds = array($old_hold); | ||||
| } | } | ||||
| } | } | ||||
| if (!$holds) { | if (!$holds) { | ||||
| $holds = array(); | $holds = array(); | ||||
| } | } | ||||
| return $holds; | foreach ($holds as $key => $reason) { | ||||
| $holds[$key] = PhabricatorRepositoryPublisherHoldReason::newForHoldKey( | |||||
| $reason); | |||||
| } | |||||
| return array_values($holds); | |||||
| } | } | ||||
| } | } | ||||