r95246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95245‎ | r95246 | r95247 >
Date:20:37, 22 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Tidy up documentation
Modified paths:
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.list.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php
@@ -16,11 +16,10 @@
1717 /**
1818 * getUserPermissionsErrorsExpensive hook
1919 *
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
2524 * @return bool
2625 */
2726 public static function userCan( $title, $user, $action, &$result ) {
@@ -45,11 +44,10 @@
4645 /**
4746 * AbortMove hook
4847 *
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
5452 * @return bool
5553 */
5654 public static function abortMove( $old, $nt, $user, &$err ) {
@@ -88,9 +86,9 @@
8987 return true;
9088 }
9189
92 - /** AbortNewAccount hook
 90+ /**
 91+ * AbortNewAccount hook
9392 *
94 - *
9593 * @param User $user
9694 */
9795 public static function abortNewAccount( $user, &$message ) {
@@ -105,9 +103,10 @@
106104 return self::acceptNewUserName( $userName, $message );
107105 }
108106
109 - /** EditFilter hook
 107+ /**
 108+ * EditFilter hook
110109 *
111 - * @param EditPage $editor
 110+ * @param $editor EditPage
112111 */
113112 public static function validateBlacklist( $editor, $text, $section, $error ) {
114113 global $wgUser;
@@ -153,7 +152,8 @@
154153 return true;
155154 }
156155
157 - /** ArticleSaveComplete hook
 156+ /**
 157+ * ArticleSaveComplete hook
158158 *
159159 * @param Article $article
160160 */
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php
@@ -146,16 +146,17 @@
147147 *
148148 * @param $title Title to check
149149 * @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;
153153 * otherwise FALSE
154154 */
155155 public function userCannot( $title, $user, $action = 'edit', $override = true ) {
156 - if( $override && self::userCanOverride( $action ) )
 156+ if( $override && self::userCanOverride( $action ) ) {
157157 return false;
158 - else
 158+ } else {
159159 return $this->isBlacklisted( $title, $action );
 160+ }
160161 }
161162
162163 /**
@@ -163,8 +164,8 @@
164165 * performing a specific action on the given Title
165166 *
166167 * @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;
169170 * otherwise FALSE
170171 */
171172 public function isBlacklisted( $title, $action = 'edit' ) {
@@ -188,8 +189,8 @@
189190 * current User may perform a specific action on the given Title
190191 *
191192 * @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
194195 */
195196 public function isWhitelisted( $title, $action = 'edit' ) {
196197 if( !($title instanceof Title) ) {
@@ -216,7 +217,7 @@
217218 return $this->mBlacklist;
218219 }
219220
220 - /*
 221+ /**
221222 * Get the current whitelist
222223 *
223224 * @return Array of TitleBlacklistEntry items
@@ -231,8 +232,8 @@
232233 /**
233234 * Get the text of a blacklist source via HTTP
234235 *
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
237238 */
238239 private static function getHttp( $url ) {
239240 global $messageMemc, $wgTitleBlacklistCaching;
@@ -255,11 +256,11 @@
256257 global $wgMemc;
257258 $wgMemc->delete( wfMemcKey( "title_blacklist_entries" ) );
258259 }
259 -
 260+
260261 /**
261262 * Validate a new blacklist
262263 *
263 - * @param $list Text of the new blacklist, as a string
 264+ * @param $blacklist array
264265 * @return Array of bad entries; empty array means blacklist is valid
265266 */
266267 public function validate( $blacklist ) {
@@ -277,8 +278,10 @@
278279
279280 /**
280281 * Inidcates whether user can override blacklist on certain action.
281 - *
 282+ *
282283 * @param $action Action
 284+ *
 285+ * @return bool
283286 */
284287 public static function userCanOverride( $action ) {
285288 global $wgUser;
@@ -318,7 +321,7 @@
319322 *
320323 * @param $title Title to check
321324 * @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
323326 * else false if it doesn't match (or was overridden)
324327 */
325328 public function matches( $title, $action ) {
@@ -420,7 +423,7 @@
421424 }
422425
423426 /**
424 - * @returns This entry's regular expression
 427+ * @return This entry's regular expression
425428 */
426429 public function getRegex() {
427430 return $this->mRegex;
@@ -434,21 +437,21 @@
435438 }
436439
437440 /**
438 - * @returns This entry's options
 441+ * @return This entry's options
439442 */
440443 public function getOptions() {
441444 return $this->mOptions;
442445 }
443446
444447 /**
445 - * @returns Custom message for this entry
 448+ * @return Custom message for this entry
446449 */
447450 public function getCustomMessage() {
448451 return isset( $this->mParams['errmsg'] ) ? $this->mParams['errmsg'] : null;
449452 }
450453
451454 /**
452 - * @returns The format version
 455+ * @return The format version
453456 */
454457 public function getFormatVersion() { return $this->mFormatVersion; }
455458
@@ -461,10 +464,10 @@
462465
463466 /**
464467 * Return the error message name for the blacklist entry.
465 - *
 468+ *
466469 * @param $operation Operation name (as in titleblacklist-forbidden message name)
467 - *
468 - * @returns The error message name
 470+ *
 471+ * @return The error message name
469472 */
470473 public function getErrorMessage( $operation ) {
471474 $message = $this->getCustomMessage();

Status & tagging log