Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / phid / conduit / PHIDInfoConduitAPIMethod.php
blob76afb1ef54f335fe84dea8014d84496dc3e67331
1 <?php
3 final class PHIDInfoConduitAPIMethod extends PHIDConduitAPIMethod {
5 public function getAPIMethodName() {
6 return 'phid.info';
9 public function getMethodStatus() {
10 return self::METHOD_STATUS_DEPRECATED;
13 public function getMethodStatusDescription() {
14 return pht("Replaced by 'phid.query'.");
17 public function getMethodDescription() {
18 return pht('Retrieve information about an arbitrary PHID.');
21 protected function defineParamTypes() {
22 return array(
23 'phid' => 'required phid',
27 protected function defineReturnType() {
28 return 'nonempty dict<string, wild>';
31 protected function defineErrorTypes() {
32 return array(
33 'ERR-BAD-PHID' => pht('No such object exists.'),
37 protected function execute(ConduitAPIRequest $request) {
38 $phid = $request->getValue('phid');
40 $handle = id(new PhabricatorHandleQuery())
41 ->setViewer($request->getUser())
42 ->withPHIDs(array($phid))
43 ->executeOne();
45 if (!$handle->isComplete()) {
46 throw new ConduitException('ERR-BAD-PHID');
49 return $this->buildHandleInformationDictionary($handle);