| @@ 421-431 (lines=11) @@ | ||
| 418 | * |
|
| 419 | * @return array|Answer |
|
| 420 | */ |
|
| 421 | public function myAnswers(array $params = self::QUERY_PARAMS, $serialize = true) |
|
| 422 | { |
|
| 423 | if (!$this->authentication instanceof Authentication) { |
|
| 424 | throw new \Exception('Authentication is required'); |
|
| 425 | } |
|
| 426 | $response = Http::instance()->get( |
|
| 427 | 'me/' . self::URL, array_merge($params, ['access_token' => $this->authentication->accessToken()]) |
|
| 428 | ); |
|
| 429 | ||
| 430 | return $serialize === true ? AnswerSerializer::serialize($response) : $response; |
|
| 431 | } |
|
| 432 | ||
| 433 | /** |
|
| 434 | * Returns the top 30 answers a user has posted in response to questions with the given tags. |
|
| @@ 102-112 (lines=11) @@ | ||
| 99 | * |
|
| 100 | * @return User |
|
| 101 | */ |
|
| 102 | public function me(array $params = self::QUERY_PARAMS, $serialize = true) |
|
| 103 | { |
|
| 104 | if (!$this->authentication instanceof Authentication) { |
|
| 105 | throw new \Exception('Authentication is required'); |
|
| 106 | } |
|
| 107 | $response = Http::instance()->get( |
|
| 108 | 'me', array_merge($params, ['access_token' => $this->authentication->accessToken()]) |
|
| 109 | ); |
|
| 110 | ||
| 111 | return $serialize === true ? UserSerializer::serialize($response) : $response; |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * Gets those users on a site who can exercise moderation powers. |
|