Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / people / conduit / UserFindConduitAPIMethod.php
blob2390abad068862bb1e434639878216c0a53eabea
1 <?php
3 final class UserFindConduitAPIMethod extends UserConduitAPIMethod {
5 public function getAPIMethodName() {
6 return 'user.find';
9 public function getMethodStatus() {
10 return self::METHOD_STATUS_DEPRECATED;
13 public function getMethodStatusDescription() {
14 return pht('Obsoleted by "%s".', 'user.query');
17 public function getMethodDescription() {
18 return pht('Lookup PHIDs by username. Obsoleted by "%s".', 'user.query');
21 protected function defineParamTypes() {
22 return array(
23 'aliases' => 'required list<string>',
27 protected function defineReturnType() {
28 return 'nonempty dict<string, phid>';
31 protected function execute(ConduitAPIRequest $request) {
32 $users = id(new PhabricatorPeopleQuery())
33 ->setViewer($request->getUser())
34 ->withUsernames($request->getValue('aliases', array()))
35 ->execute();
37 return mpull($users, 'getPHID', 'getUsername');