@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod {
4
5 public function getAPIMethodName() {
6 return 'conduit.query';
7 }
8
9 public function getMethodDescription() {
10 return pht('Returns the parameters of the Conduit methods.');
11 }
12
13 protected function defineParamTypes() {
14 return array();
15 }
16
17 protected function defineReturnType() {
18 return 'dict<dict>';
19 }
20
21 public function getRequiredScope() {
22 return self::SCOPE_ALWAYS;
23 }
24
25 protected function execute(ConduitAPIRequest $request) {
26 $methods = id(new PhabricatorConduitMethodQuery())
27 ->setViewer($request->getUser())
28 ->execute();
29
30 $map = array();
31 foreach ($methods as $method) {
32 $map[$method->getAPIMethodName()] = array(
33 'description' => $method->getMethodDescription(),
34 'params' => $method->getParamTypes(),
35 'return' => $method->getReturnType(),
36 );
37 }
38
39 return $map;
40 }
41
42}