Path: blob/master/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
12256 views
<?php12final class UserWhoAmIConduitAPIMethod extends UserConduitAPIMethod {34public function getAPIMethodName() {5return 'user.whoami';6}78public function getMethodDescription() {9return pht('Retrieve information about the logged-in user.');10}1112protected function defineParamTypes() {13return array();14}1516protected function defineReturnType() {17return 'nonempty dict<string, wild>';18}1920public function getRequiredScope() {21return self::SCOPE_ALWAYS;22}2324protected function execute(ConduitAPIRequest $request) {25$person = id(new PhabricatorPeopleQuery())26->setViewer($request->getUser())27->needProfileImage(true)28->withPHIDs(array($request->getUser()->getPHID()))29->executeOne();3031return $this->buildUserInformationDictionary(32$person,33$with_email = true,34$with_availability = false);35}3637}383940