Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / tokens / conduit / TokenConduitAPIMethod.php
blobfa6810d5d557fb718ba83b35292e7dbf0783556d
1 <?php
3 abstract class TokenConduitAPIMethod extends ConduitAPIMethod {
5 final public function getApplication() {
6 return PhabricatorApplication::getByClass('PhabricatorTokensApplication');
9 public function getMethodStatus() {
10 return self::METHOD_STATUS_UNSTABLE;
13 public function buildTokenDicts(array $tokens) {
14 assert_instances_of($tokens, 'PhabricatorToken');
16 $list = array();
17 foreach ($tokens as $token) {
18 $list[] = array(
19 'id' => $token->getID(),
20 'name' => $token->getName(),
21 'phid' => $token->getPHID(),
25 return $list;
28 public function buildTokenGivenDicts(array $tokens_given) {
29 assert_instances_of($tokens_given, 'PhabricatorTokenGiven');
31 $list = array();
32 foreach ($tokens_given as $given) {
33 $list[] = array(
34 'authorPHID' => $given->getAuthorPHID(),
35 'objectPHID' => $given->getObjectPHID(),
36 'tokenPHID' => $given->getTokenPHID(),
37 'dateCreated' => $given->getDateCreated(),
41 return $list;