@@ -10,5 +10,8 @@ |
||
| 10 | 10 | |
| 11 | 11 | interface IMediaWikiClient |
| 12 | 12 | { |
| 13 | + /** |
|
| 14 | + * @param string $method |
|
| 15 | + */ |
|
| 13 | 16 | function doApiCall($params, $method); |
| 14 | 17 | } |
| 15 | 18 | \ No newline at end of file |
@@ -63,6 +63,10 @@ discard block |
||
| 63 | 63 | private $siteConfiguration; |
| 64 | 64 | |
| 65 | 65 | #region Static methods |
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param null|string $requestToken |
|
| 69 | + */ |
|
| 66 | 70 | public static function findUserByRequestToken($requestToken, PdoDatabase $database) |
| 67 | 71 | { |
| 68 | 72 | $statement = $database->prepare(<<<'SQL' |
@@ -119,6 +123,11 @@ discard block |
||
| 119 | 123 | } |
| 120 | 124 | } |
| 121 | 125 | |
| 126 | + /** |
|
| 127 | + * @param integer $userId |
|
| 128 | + * @param null|PdoDatabase $database |
|
| 129 | + * @param string $tokenType |
|
| 130 | + */ |
|
| 122 | 131 | private static function runTokenCount($userId, $database, $tokenType) |
| 123 | 132 | { |
| 124 | 133 | if (self::$tokenCountStatement === null) { |
@@ -182,7 +191,7 @@ discard block |
||
| 182 | 191 | /** |
| 183 | 192 | * Attempts to figure out if a user is partially linked to OAuth, and therefore needs to complete the OAuth |
| 184 | 193 | * procedure before configuring. |
| 185 | - * @return bool |
|
| 194 | + * @return boolean|null |
|
| 186 | 195 | */ |
| 187 | 196 | public function isPartiallyLinked() |
| 188 | 197 | { |
@@ -245,6 +254,9 @@ discard block |
||
| 245 | 254 | return $this->oauthProtocolHelper->getAuthoriseUrl($token->key); |
| 246 | 255 | } |
| 247 | 256 | |
| 257 | + /** |
|
| 258 | + * @param null|string $verificationToken |
|
| 259 | + */ |
|
| 248 | 260 | public function completeHandshake($verificationToken) |
| 249 | 261 | { |
| 250 | 262 | $this->getTokenStatement->execute(array(':user' => $this->user->getId(), ':type' => self::TOKEN_REQUEST)); |
@@ -42,6 +42,10 @@ |
||
| 42 | 42 | $this->database = $database; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | + /** |
|
| 46 | + * @param string $data |
|
| 47 | + * @param integer $stage |
|
| 48 | + */ |
|
| 45 | 49 | public function authenticate(User $user, $data, $stage) |
| 46 | 50 | { |
| 47 | 51 | $sql = 'SELECT type FROM credential WHERE user = :user AND factor = :stage'; |