Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / maniphest / conduit / ManiphestInfoConduitAPIMethod.php
blob8bd439253f6f3145677cd18dc9c9b9fe2c2ccfa9
1 <?php
3 final class ManiphestInfoConduitAPIMethod extends ManiphestConduitAPIMethod {
5 public function getAPIMethodName() {
6 return 'maniphest.info';
9 public function getMethodDescription() {
10 return pht('Retrieve information about a Maniphest task, given its ID.');
13 public function getMethodStatus() {
14 return self::METHOD_STATUS_FROZEN;
17 public function getMethodStatusDescription() {
18 return pht(
19 'This method is frozen and will eventually be deprecated. New code '.
20 'should use "maniphest.search" instead.');
23 protected function defineParamTypes() {
24 return array(
25 'task_id' => 'required id',
29 protected function defineReturnType() {
30 return 'nonempty dict';
33 protected function defineErrorTypes() {
34 return array(
35 'ERR_BAD_TASK' => pht('No such Maniphest task exists.'),
39 protected function execute(ConduitAPIRequest $request) {
40 $task_id = $request->getValue('task_id');
42 $task = id(new ManiphestTaskQuery())
43 ->setViewer($request->getUser())
44 ->withIDs(array($task_id))
45 ->needSubscriberPHIDs(true)
46 ->needProjectPHIDs(true)
47 ->executeOne();
48 if (!$task) {
49 throw new ConduitException('ERR_BAD_TASK');
52 return $this->buildTaskInfoDictionary($task);