mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 17:52:43 +01:00
36e2d02d6e
Summary: `pht`ize a whole bunch of strings in rP. Test Plan: Intense eyeballing. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Differential Revision: https://secure.phabricator.com/D12797
52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PHIDInfoConduitAPIMethod extends PHIDConduitAPIMethod {
|
|
|
|
public function getAPIMethodName() {
|
|
return 'phid.info';
|
|
}
|
|
|
|
public function getMethodStatus() {
|
|
return self::METHOD_STATUS_DEPRECATED;
|
|
}
|
|
|
|
public function getMethodStatusDescription() {
|
|
return pht("Replaced by 'phid.query'.");
|
|
}
|
|
|
|
public function getMethodDescription() {
|
|
return pht('Retrieve information about an arbitrary PHID.');
|
|
}
|
|
|
|
protected function defineParamTypes() {
|
|
return array(
|
|
'phid' => 'required phid',
|
|
);
|
|
}
|
|
|
|
protected function defineReturnType() {
|
|
return 'nonempty dict<string, wild>';
|
|
}
|
|
|
|
protected function defineErrorTypes() {
|
|
return array(
|
|
'ERR-BAD-PHID' => pht('No such object exists.'),
|
|
);
|
|
}
|
|
|
|
protected function execute(ConduitAPIRequest $request) {
|
|
$phid = $request->getValue('phid');
|
|
|
|
$handle = id(new PhabricatorHandleQuery())
|
|
->setViewer($request->getUser())
|
|
->withPHIDs(array($phid))
|
|
->executeOne();
|
|
|
|
if (!$handle->isComplete()) {
|
|
throw new ConduitException('ERR-BAD-PHID');
|
|
}
|
|
|
|
return $this->buildHandleInformationDictionary($handle);
|
|
}
|
|
|
|
}
|