Changeset View
Changeset View
Standalone View
Standalone View
src/ref/user/ArcanistUserSymbolRef.php
<?php | <?php | ||||
final class ArcanistUserSymbolRef | final class ArcanistUserSymbolRef | ||||
extends ArcanistSymbolRef { | extends ArcanistSymbolRef { | ||||
private $type; | private $type; | ||||
const TYPE_ID = 'id'; | const TYPE_ID = 'id'; | ||||
const TYPE_PHID = 'phid'; | const TYPE_PHID = 'phid'; | ||||
const TYPE_USERNAME = 'username'; | const TYPE_USERNAME = 'username'; | ||||
const TYPE_FUNCTION = 'function'; | const TYPE_FUNCTION = 'function'; | ||||
public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
return pht('User Symbol "%s"', $this->getSymbol()); | return pht('User Symbol "%s"', $this->getSymbol()); | ||||
} | } | ||||
protected function newCacheKeyParts() { | |||||
return array( | |||||
sprintf('type(%s)', $this->type), | |||||
); | |||||
} | |||||
public function getSymbolType() { | public function getSymbolType() { | ||||
return $this->type; | return $this->type; | ||||
} | } | ||||
protected function resolveSymbol($symbol) { | protected function resolveSymbol($symbol) { | ||||
$matches = null; | $matches = null; | ||||
$is_id = preg_match('/^([1-9]\d*)\z/', $symbol, $matches); | $is_id = preg_match('/^([1-9]\d*)\z/', $symbol, $matches); | ||||
Show All 32 Lines |