Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/conduit/ManiphestStatusSearchConduitAPIMethod.php
12256 views
1
<?php
2
3
final class ManiphestStatusSearchConduitAPIMethod
4
extends ManiphestConduitAPIMethod {
5
6
public function getAPIMethodName() {
7
return 'maniphest.status.search';
8
}
9
10
public function getMethodSummary() {
11
return pht('Read information about task statuses.');
12
}
13
14
public function getMethodDescription() {
15
return pht(
16
'Returns information about the possible statuses for Maniphest '.
17
'tasks.');
18
}
19
20
protected function defineParamTypes() {
21
return array();
22
}
23
24
protected function defineReturnType() {
25
return 'map<string, wild>';
26
}
27
28
public function getRequiredScope() {
29
return self::SCOPE_ALWAYS;
30
}
31
32
protected function execute(ConduitAPIRequest $request) {
33
$config = PhabricatorEnv::getEnvConfig('maniphest.statuses');
34
$results = array();
35
foreach ($config as $code => $status) {
36
$stripped_status = array(
37
'name' => $status['name'],
38
'value' => $code,
39
'closed' => !empty($status['closed']),
40
);
41
42
if (isset($status['special'])) {
43
$stripped_status['special'] = $status['special'];
44
}
45
46
$results[] = $stripped_status;
47
}
48
49
return array('data' => $results);
50
}
51
52
}
53
54