Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitQueryConduitAPIMethod.php
<?php | <?php | ||||
final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod { | final class ConduitQueryConduitAPIMethod extends ConduitAPIMethod { | ||||
public function getAPIMethodName() { | public function getAPIMethodName() { | ||||
return 'conduit.query'; | return 'conduit.query'; | ||||
} | } | ||||
public function getMethodDescription() { | public function getMethodDescription() { | ||||
return 'Returns the parameters of the Conduit methods.'; | return 'Returns the parameters of the Conduit methods.'; | ||||
} | } | ||||
public function defineParamTypes() { | protected function defineParamTypes() { | ||||
return array(); | return array(); | ||||
} | } | ||||
public function defineReturnType() { | protected function defineReturnType() { | ||||
return 'dict<dict>'; | return 'dict<dict>'; | ||||
} | } | ||||
public function defineErrorTypes() { | |||||
return array(); | |||||
} | |||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$classes = id(new PhutilSymbolLoader()) | $classes = id(new PhutilSymbolLoader()) | ||||
->setAncestorClass('ConduitAPIMethod') | ->setAncestorClass('ConduitAPIMethod') | ||||
->setType('class') | ->setType('class') | ||||
->loadObjects(); | ->loadObjects(); | ||||
$names_to_params = array(); | $names_to_params = array(); | ||||
foreach ($classes as $class) { | foreach ($classes as $class) { | ||||
$names_to_params[$class->getAPIMethodName()] = array( | $names_to_params[$class->getAPIMethodName()] = array( | ||||
'description' => $class->getMethodDescription(), | 'description' => $class->getMethodDescription(), | ||||
'params' => $class->defineParamTypes(), | 'params' => $class->getParamTypes(), | ||||
'return' => $class->defineReturnType(), | 'return' => $class->getReturnType(), | ||||
); | ); | ||||
} | } | ||||
return $names_to_params; | return $names_to_params; | ||||
} | } | ||||
} | } |