Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -16,11 +16,10 @@ |
17 | 17 | /** |
18 | 18 | * getUserPermissionsErrorsExpensive hook |
19 | 19 | * |
20 | | - * @static |
21 | | - * @param Title $title |
22 | | - * @param User $user |
23 | | - * @param $action |
24 | | - * @param $result |
| 20 | + * @param $title Title |
| 21 | + * @param $user User |
| 22 | + * @param $action |
| 23 | + * @param $result |
25 | 24 | * @return bool |
26 | 25 | */ |
27 | 26 | public static function userCan( $title, $user, $action, &$result ) { |
— | — | @@ -45,11 +44,10 @@ |
46 | 45 | /** |
47 | 46 | * AbortMove hook |
48 | 47 | * |
49 | | - * @static |
50 | | - * @param Title $old |
51 | | - * @param Title $nt |
52 | | - * @param User $user |
53 | | - * @param $err |
| 48 | + * @param $old Title |
| 49 | + * @param $nt Title |
| 50 | + * @param $user User |
| 51 | + * @param $err |
54 | 52 | * @return bool |
55 | 53 | */ |
56 | 54 | public static function abortMove( $old, $nt, $user, &$err ) { |
— | — | @@ -88,9 +86,9 @@ |
89 | 87 | return true; |
90 | 88 | } |
91 | 89 | |
92 | | - /** AbortNewAccount hook |
| 90 | + /** |
| 91 | + * AbortNewAccount hook |
93 | 92 | * |
94 | | - * |
95 | 93 | * @param User $user |
96 | 94 | */ |
97 | 95 | public static function abortNewAccount( $user, &$message ) { |
— | — | @@ -105,9 +103,10 @@ |
106 | 104 | return self::acceptNewUserName( $userName, $message ); |
107 | 105 | } |
108 | 106 | |
109 | | - /** EditFilter hook |
| 107 | + /** |
| 108 | + * EditFilter hook |
110 | 109 | * |
111 | | - * @param EditPage $editor |
| 110 | + * @param $editor EditPage |
112 | 111 | */ |
113 | 112 | public static function validateBlacklist( $editor, $text, $section, $error ) { |
114 | 113 | global $wgUser; |
— | — | @@ -153,7 +152,8 @@ |
154 | 153 | return true; |
155 | 154 | } |
156 | 155 | |
157 | | - /** ArticleSaveComplete hook |
| 156 | + /** |
| 157 | + * ArticleSaveComplete hook |
158 | 158 | * |
159 | 159 | * @param Article $article |
160 | 160 | */ |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -146,16 +146,17 @@ |
147 | 147 | * |
148 | 148 | * @param $title Title to check |
149 | 149 | * @param $user User to check |
150 | | - * @param $action Action to check; 'edit' if unspecified |
151 | | - * @param $override If set to true, overrides work |
152 | | - * @return The corresponding TitleBlacklistEntry if blacklisted; |
| 150 | + * @param $action string Action to check; 'edit' if unspecified |
| 151 | + * @param $override bool If set to true, overrides work |
| 152 | + * @return TitleBlacklistEntry|false The corresponding TitleBlacklistEntry if blacklisted; |
153 | 153 | * otherwise FALSE |
154 | 154 | */ |
155 | 155 | public function userCannot( $title, $user, $action = 'edit', $override = true ) { |
156 | | - if( $override && self::userCanOverride( $action ) ) |
| 156 | + if( $override && self::userCanOverride( $action ) ) { |
157 | 157 | return false; |
158 | | - else |
| 158 | + } else { |
159 | 159 | return $this->isBlacklisted( $title, $action ); |
| 160 | + } |
160 | 161 | } |
161 | 162 | |
162 | 163 | /** |
— | — | @@ -163,8 +164,8 @@ |
164 | 165 | * performing a specific action on the given Title |
165 | 166 | * |
166 | 167 | * @param $title Title to check |
167 | | - * @param $action Action to check; 'edit' if unspecified |
168 | | - * @return The corresponding TitleBlacklistEntry if blacklisted; |
| 168 | + * @param $action string Action to check; 'edit' if unspecified |
| 169 | + * @return TitleBlacklistEntry|false The corresponding TitleBlacklistEntry if blacklisted; |
169 | 170 | * otherwise FALSE |
170 | 171 | */ |
171 | 172 | public function isBlacklisted( $title, $action = 'edit' ) { |
— | — | @@ -188,8 +189,8 @@ |
189 | 190 | * current User may perform a specific action on the given Title |
190 | 191 | * |
191 | 192 | * @param $title Title to check |
192 | | - * @param $action Action to check; 'edit' if unspecified |
193 | | - * @return TRUE if whitelisted; otherwise FALSE |
| 193 | + * @param $action string Action to check; 'edit' if unspecified |
| 194 | + * @return bool TRUE if whitelisted; otherwise FALSE |
194 | 195 | */ |
195 | 196 | public function isWhitelisted( $title, $action = 'edit' ) { |
196 | 197 | if( !($title instanceof Title) ) { |
— | — | @@ -216,7 +217,7 @@ |
217 | 218 | return $this->mBlacklist; |
218 | 219 | } |
219 | 220 | |
220 | | - /* |
| 221 | + /** |
221 | 222 | * Get the current whitelist |
222 | 223 | * |
223 | 224 | * @return Array of TitleBlacklistEntry items |
— | — | @@ -231,8 +232,8 @@ |
232 | 233 | /** |
233 | 234 | * Get the text of a blacklist source via HTTP |
234 | 235 | * |
235 | | - * @param $source URL of the blacklist source |
236 | | - * @return The content of the blacklist source as a string |
| 236 | + * @param $url string URL of the blacklist source |
| 237 | + * @return string The content of the blacklist source as a string |
237 | 238 | */ |
238 | 239 | private static function getHttp( $url ) { |
239 | 240 | global $messageMemc, $wgTitleBlacklistCaching; |
— | — | @@ -255,11 +256,11 @@ |
256 | 257 | global $wgMemc; |
257 | 258 | $wgMemc->delete( wfMemcKey( "title_blacklist_entries" ) ); |
258 | 259 | } |
259 | | - |
| 260 | + |
260 | 261 | /** |
261 | 262 | * Validate a new blacklist |
262 | 263 | * |
263 | | - * @param $list Text of the new blacklist, as a string |
| 264 | + * @param $blacklist array |
264 | 265 | * @return Array of bad entries; empty array means blacklist is valid |
265 | 266 | */ |
266 | 267 | public function validate( $blacklist ) { |
— | — | @@ -277,8 +278,10 @@ |
278 | 279 | |
279 | 280 | /** |
280 | 281 | * Inidcates whether user can override blacklist on certain action. |
281 | | - * |
| 282 | + * |
282 | 283 | * @param $action Action |
| 284 | + * |
| 285 | + * @return bool |
283 | 286 | */ |
284 | 287 | public static function userCanOverride( $action ) { |
285 | 288 | global $wgUser; |
— | — | @@ -318,7 +321,7 @@ |
319 | 322 | * |
320 | 323 | * @param $title Title to check |
321 | 324 | * @param $action %Action to check |
322 | | - * @return TRUE if the the regex matches the title, and is not overridden |
| 325 | + * @return bool TRUE if the the regex matches the title, and is not overridden |
323 | 326 | * else false if it doesn't match (or was overridden) |
324 | 327 | */ |
325 | 328 | public function matches( $title, $action ) { |
— | — | @@ -420,7 +423,7 @@ |
421 | 424 | } |
422 | 425 | |
423 | 426 | /** |
424 | | - * @returns This entry's regular expression |
| 427 | + * @return This entry's regular expression |
425 | 428 | */ |
426 | 429 | public function getRegex() { |
427 | 430 | return $this->mRegex; |
— | — | @@ -434,21 +437,21 @@ |
435 | 438 | } |
436 | 439 | |
437 | 440 | /** |
438 | | - * @returns This entry's options |
| 441 | + * @return This entry's options |
439 | 442 | */ |
440 | 443 | public function getOptions() { |
441 | 444 | return $this->mOptions; |
442 | 445 | } |
443 | 446 | |
444 | 447 | /** |
445 | | - * @returns Custom message for this entry |
| 448 | + * @return Custom message for this entry |
446 | 449 | */ |
447 | 450 | public function getCustomMessage() { |
448 | 451 | return isset( $this->mParams['errmsg'] ) ? $this->mParams['errmsg'] : null; |
449 | 452 | } |
450 | 453 | |
451 | 454 | /** |
452 | | - * @returns The format version |
| 455 | + * @return The format version |
453 | 456 | */ |
454 | 457 | public function getFormatVersion() { return $this->mFormatVersion; } |
455 | 458 | |
— | — | @@ -461,10 +464,10 @@ |
462 | 465 | |
463 | 466 | /** |
464 | 467 | * Return the error message name for the blacklist entry. |
465 | | - * |
| 468 | + * |
466 | 469 | * @param $operation Operation name (as in titleblacklist-forbidden message name) |
467 | | - * |
468 | | - * @returns The error message name |
| 470 | + * |
| 471 | + * @return The error message name |
469 | 472 | */ |
470 | 473 | public function getErrorMessage( $operation ) { |
471 | 474 | $message = $this->getCustomMessage(); |