Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/diffusion/conduit/DiffusionResolveRefsConduitAPIMethod.php
12242 views
1
<?php
2
3
final class DiffusionResolveRefsConduitAPIMethod
4
extends DiffusionQueryConduitAPIMethod {
5
6
public function getAPIMethodName() {
7
return 'diffusion.resolverefs';
8
}
9
10
public function getMethodDescription() {
11
return pht('Resolve references into stable, canonical identifiers.');
12
}
13
14
protected function defineReturnType() {
15
return 'dict<string, list<dict<string, wild>>>';
16
}
17
18
protected function defineCustomParamTypes() {
19
return array(
20
'refs' => 'required list<string>',
21
'types' => 'optional list<string>',
22
);
23
}
24
25
protected function getResult(ConduitAPIRequest $request) {
26
$refs = $request->getValue('refs');
27
$types = $request->getValue('types');
28
29
$query = id(new DiffusionLowLevelResolveRefsQuery())
30
->setRepository($this->getDiffusionRequest()->getRepository())
31
->withRefs($refs);
32
33
if ($types) {
34
$query->withTypes($types);
35
}
36
37
return $query->execute();
38
}
39
40
}
41
42