Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / people / conduit / UserWhoAmIConduitAPIMethod.php
blob2911056f5e2a1f4831e87e25bcb76a0426422eea
1 <?php
3 final class UserWhoAmIConduitAPIMethod extends UserConduitAPIMethod {
5 public function getAPIMethodName() {
6 return 'user.whoami';
9 public function getMethodDescription() {
10 return pht('Retrieve information about the logged-in user.');
13 protected function defineParamTypes() {
14 return array();
17 protected function defineReturnType() {
18 return 'nonempty dict<string, wild>';
21 public function getRequiredScope() {
22 return self::SCOPE_ALWAYS;
25 protected function execute(ConduitAPIRequest $request) {
26 $person = id(new PhabricatorPeopleQuery())
27 ->setViewer($request->getUser())
28 ->needProfileImage(true)
29 ->withPHIDs(array($request->getUser()->getPHID()))
30 ->executeOne();
32 return $this->buildUserInformationDictionary(
33 $person,
34 $with_email = true,
35 $with_availability = false);