Changeset View
Changeset View
Standalone View
Standalone View
src/ref/revision/ArcanistRevisionSymbolRef.php
<?php | <?php | ||||
final class ArcanistRevisionSymbolRef | final class ArcanistRevisionSymbolRef | ||||
extends ArcanistSymbolRef { | extends ArcanistSimpleSymbolRef { | ||||
public function getRefDisplayName() { | public function getRefDisplayName() { | ||||
return pht('Revision Symbol "%s"', $this->getSymbol()); | return pht('Revision Symbol "%s"', $this->getSymbol()); | ||||
} | } | ||||
protected function resolveSymbol($symbol) { | protected function getSimpleSymbolPrefixPattern() { | ||||
$matches = null; | return '[Dd]?'; | ||||
} | |||||
protected function getSimpleSymbolPHIDType() { | |||||
return 'DREV'; | |||||
} | |||||
public function getSimpleSymbolConduitSearchMethodName() { | |||||
return 'differential.revision.search'; | |||||
} | |||||
if (!preg_match('/^[Dd]?([1-9]\d*)\z/', $symbol, $matches)) { | public function getSimpleSymbolInspectFunctionName() { | ||||
throw new PhutilArgumentUsageException( | return 'revision'; | ||||
pht( | |||||
'The format of revision symbol "%s" is unrecognized. '. | |||||
'Expected a revision monogram like "D123", or a '. | |||||
'revision ID like "123".', | |||||
$symbol)); | |||||
} | } | ||||
return (int)$matches[1]; | public function newSimpleSymbolObjectRef() { | ||||
return new ArcanistRevisionRef(); | |||||
} | } | ||||
} | } |