@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 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}