| @@ 45-56 (lines=12) @@ | ||
| 42 | * @param string $authorUrl |
|
| 43 | * @return Account |
|
| 44 | */ |
|
| 45 | public function createAccount(string $shortName, string $authorName = '', string $authorUrl = ''): Account |
|
| 46 | { |
|
| 47 | $response = $this->httpClient->post('/createAccount', [ |
|
| 48 | 'json' => [ |
|
| 49 | 'short_name' => $shortName, |
|
| 50 | 'author_name' => $authorName, |
|
| 51 | 'author_url' => $authorUrl |
|
| 52 | ] |
|
| 53 | ]); |
|
| 54 | ||
| 55 | return new Account(self::getDecodedResponseResult($response)); |
|
| 56 | } |
|
| 57 | ||
| 58 | /** |
|
| 59 | * @param string $accessToken |
|
| @@ 65-77 (lines=13) @@ | ||
| 62 | * @param string $authorUrl |
|
| 63 | * @return Account |
|
| 64 | */ |
|
| 65 | public function editAccountInfo(string $accessToken, string $shortName, string $authorName = '', string $authorUrl = ''): Account |
|
| 66 | { |
|
| 67 | $response = $this->httpClient->post('/editAccountInfo', [ |
|
| 68 | 'json' => [ |
|
| 69 | 'access_token' => $accessToken, |
|
| 70 | 'short_name' => $shortName, |
|
| 71 | 'author_name' => $authorName, |
|
| 72 | 'author_url' => $authorUrl |
|
| 73 | ] |
|
| 74 | ]); |
|
| 75 | ||
| 76 | return new Account(self::getDecodedResponseResult($response)); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * @param string $accessToken |
|
| @@ 84-94 (lines=11) @@ | ||
| 81 | * @param array $fields |
|
| 82 | * @return Account |
|
| 83 | */ |
|
| 84 | public function getAccountInfo(string $accessToken, array $fields = ['short_name', 'author_name', 'author_url']): Account |
|
| 85 | { |
|
| 86 | $response = $this->httpClient->post('/getAccountInfo', [ |
|
| 87 | 'json' => [ |
|
| 88 | 'access_token' => $accessToken, |
|
| 89 | 'fields' => $fields |
|
| 90 | ] |
|
| 91 | ]); |
|
| 92 | ||
| 93 | return new Account(self::getDecodedResponseResult($response)); |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * @param string $accessToken |
|