Changeset View
Changeset View
Standalone View
Standalone View
src/ref/revision/ArcanistRevisionRef.php
- This file was moved from src/ref/ArcanistRevisionRef.php.
| <?php | <?php | ||||
| final class ArcanistRevisionRef | final class ArcanistRevisionRef | ||||
| extends ArcanistRef { | extends ArcanistRef { | ||||
| const HARDPOINT_COMMITMESSAGE = 'ref.revision.commitmessage'; | |||||
| private $parameters; | private $parameters; | ||||
| private $sources = array(); | private $sources = array(); | ||||
| public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
| return pht('Revision %s', $this->getMonogram()); | return pht('Revision %s', $this->getMonogram()); | ||||
| } | } | ||||
| protected function newHardpoints() { | |||||
| return array( | |||||
| $this->newHardpoint(self::HARDPOINT_COMMITMESSAGE), | |||||
| ); | |||||
| } | |||||
| public static function newFromConduit(array $dict) { | public static function newFromConduit(array $dict) { | ||||
| $ref = new self(); | $ref = new self(); | ||||
| $ref->parameters = $dict; | $ref->parameters = $dict; | ||||
| return $ref; | return $ref; | ||||
| } | } | ||||
| public function getMonogram() { | public function getMonogram() { | ||||
| return 'D'.$this->getID(); | return 'D'.$this->getID(); | ||||
| Show All 19 Lines | public function getURI() { | ||||
| return idx($this->parameters, 'uri'); | return idx($this->parameters, 'uri'); | ||||
| } | } | ||||
| public function getFullName() { | public function getFullName() { | ||||
| return pht('%s: %s', $this->getMonogram(), $this->getName()); | return pht('%s: %s', $this->getMonogram(), $this->getName()); | ||||
| } | } | ||||
| public function getID() { | public function getID() { | ||||
| return idx($this->parameters, 'id'); | return (int)idx($this->parameters, 'id'); | ||||
| } | } | ||||
| public function getPHID() { | public function getPHID() { | ||||
| return idx($this->parameters, 'phid'); | return idx($this->parameters, 'phid'); | ||||
| } | } | ||||
| public function getName() { | public function getName() { | ||||
| return idx($this->parameters, 'title'); | return idx($this->parameters, 'title'); | ||||
| Show All 16 Lines | |||||