r44060 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44059‎ | r44060 | r44061 >
Date:10:10, 30 November 2008
Author:ialex
Status:ok
Tags:
Comment:
* Fixed doxygen warning in Article.php and User.php
* fix in Doxyfile
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/maintenance/Doxyfile (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Doxyfile
@@ -290,7 +290,7 @@
291291 "string=\type{String}" \
292292 "str=\string" \
293293 "mixed=\type{Mixed}" \
294 - "access=\n<b> Access </b>:\n" \
 294+ "access=\par Access:\n" \
295295 "private=\access private" \
296296 "protected=\access protected" \
297297 "public=\access public"
\ No newline at end of file
Index: trunk/phase3/includes/User.php
@@ -2278,8 +2278,8 @@
22792279 * Set a cookie on the user's client. Wrapper for
22802280 * WebResponse::setCookie
22812281 * @param $name \string Name of the cookie to set
2282 - * @param $name \string Value to set
2283 - * @param $name \int Expiration time, as a UNIX time value;
 2282+ * @param $value \string Value to set
 2283+ * @param $exp \int Expiration time, as a UNIX time value;
22842284 * if 0 or not specified, use the default $wgCookieExpiration
22852285 */
22862286 protected function setCookie( $name, $value, $exp=0 ) {
@@ -3249,13 +3249,13 @@
32503250 static function crypt( $password, $salt = false ) {
32513251 global $wgPasswordSalt;
32523252
3253 - if($wgPasswordSalt) {
 3253+ if( $wgPasswordSalt ) {
32543254 if ( $salt === false ) {
32553255 $salt = substr( wfGenerateToken(), 0, 8 );
32563256 }
32573257 return ':B:' . $salt . ':' . md5( $salt . '-' . md5( $password ) );
32583258 } else {
3259 - return ':A:' . md5( $password);
 3259+ return ':A:' . md5( $password );
32603260 }
32613261 }
32623262
@@ -3286,7 +3286,7 @@
32873287
32883288 /**
32893289 * Add a newuser log entry for this user
3290 - * @param bool $byEmail, account made by email?
 3290+ * @param $byEmail Boolean: account made by email?
32913291 */
32923292 public function addNewUserLogEntry( $byEmail = false ) {
32933293 global $wgUser, $wgContLang, $wgNewUserLog;
Index: trunk/phase3/includes/Article.php
@@ -175,9 +175,9 @@
176176 }
177177
178178 /**
179 - * Clear the object
180 - * @private
181 - */
 179+ * Clear the object
 180+ * @private
 181+ */
182182 public function clear() {
183183 $this->mDataLoaded = false;
184184 $this->mContentLoaded = false;
@@ -306,8 +306,8 @@
307307
308308 /**
309309 * Fetch a page record with the given conditions
310 - * @param Database $dbr
311 - * @param array $conditions
 310+ * @param $dbr Database object
 311+ * @param $conditions Array
312312 */
313313 protected function pageData( $dbr, $conditions ) {
314314 $fields = array(
@@ -335,8 +335,8 @@
336336 }
337337
338338 /**
339 - * @param Database $dbr
340 - * @param Title $title
 339+ * @param $dbr Database object
 340+ * @param $title Title object
341341 */
342342 public function pageDataFromTitle( $dbr, $title ) {
343343 return $this->pageData( $dbr, array(
@@ -345,8 +345,8 @@
346346 }
347347
348348 /**
349 - * @param Database $dbr
350 - * @param int $id
 349+ * @param $dbr Database
 350+ * @param $id Integer
351351 */
352352 protected function pageDataFromId( $dbr, $id ) {
353353 return $this->pageData( $dbr, array( 'page_id' => $id ) );
@@ -356,7 +356,7 @@
357357 * Set the general counter, title etc data loaded from
358358 * some source.
359359 *
360 - * @param object $data
 360+ * @param $data Database row object or "fromdb"
361361 */
362362 public function loadPageData( $data = 'fromdb' ) {
363363 if( $data === 'fromdb' ) {
@@ -390,7 +390,7 @@
391391 /**
392392 * Get text of an article from database
393393 * Does *NOT* follow redirects.
394 - * @param int $oldid 0 for whatever the latest revision is
 394+ * @param $oldid Int: 0 for whatever the latest revision is
395395 * @return string
396396 */
397397 function fetchContent( $oldid = 0 ) {
@@ -972,9 +972,9 @@
973973
974974 /**
975975 * View redirect
976 - * @param Title $target Title of destination to redirect
977 - * @param Bool $appendSubtitle [optional]
978 - * @param Bool $forceKnown Should the image be shown as a bluelink regardless of existence?
 976+ * @param $target Title object of destination to redirect
 977+ * @param $appendSubtitle Boolean [optional]
 978+ * @param $forceKnown Boolean: should the image be shown as a bluelink regardless of existence?
979979 */
980980 public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
981981 global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser;
@@ -1110,8 +1110,8 @@
11111111 * or else the record will be left in a funky state.
11121112 * Best if all done inside a transaction.
11131113 *
1114 - * @param Database $dbw
1115 - * @return int The newly created page_id key, or false if the title already existed
 1114+ * @param $dbw Database
 1115+ * @return int The newly created page_id key, or false if the title already existed
11161116 * @private
11171117 */
11181118 public function insertOn( $dbw ) {
@@ -1144,15 +1144,15 @@
11451145 /**
11461146 * Update the page record to point to a newly saved revision.
11471147 *
1148 - * @param Database $dbw
1149 - * @param Revision $revision For ID number, and text used to set
1150 - length and redirect status fields
1151 - * @param int $lastRevision If given, will not overwrite the page field
1152 - * when different from the currently set value.
1153 - * Giving 0 indicates the new page flag should
1154 - * be set on.
1155 - * @param bool $lastRevIsRedirect If given, will optimize adding and
1156 - * removing rows in redirect table.
 1148+ * @param $dbw Database object
 1149+ * @param $revision Revision: For ID number, and text used to set
 1150+ length and redirect status fields
 1151+ * @param $lastRevision Integer: if given, will not overwrite the page field
 1152+ * when different from the currently set value.
 1153+ * Giving 0 indicates the new page flag should be set
 1154+ * on.
 1155+ * @param $lastRevIsRedirect Boolean: if given, will optimize adding and
 1156+ * removing rows in redirect table.
11571157 * @return bool true on success, false on failure
11581158 * @private
11591159 */
@@ -1191,11 +1191,11 @@
11921192 /**
11931193 * Add row to the redirect table if this is a redirect, remove otherwise.
11941194 *
1195 - * @param Database $dbw
 1195+ * @param $dbw Database
11961196 * @param $redirectTitle a title object pointing to the redirect target,
1197 - * or NULL if this is not a redirect
1198 - * @param bool $lastRevIsRedirect If given, will optimize adding and
1199 - * removing rows in redirect table.
 1197+ * or NULL if this is not a redirect
 1198+ * @param $lastRevIsRedirect If given, will optimize adding and
 1199+ * removing rows in redirect table.
12001200 * @return bool true on success, false on failure
12011201 * @private
12021202 */
@@ -1232,8 +1232,8 @@
12331233 * If the given revision is newer than the currently set page_latest,
12341234 * update the page record. Otherwise, do nothing.
12351235 *
1236 - * @param Database $dbw
1237 - * @param Revision $revision
 1236+ * @param $dbw Database object
 1237+ * @param $revision Revision object
12381238 */
12391239 public function updateIfNewerOn( &$dbw, $revision ) {
12401240 wfProfileIn( __METHOD__ );
@@ -1376,9 +1376,9 @@
13771377 *
13781378 * $wgUser must be set before calling this function.
13791379 *
1380 - * @param string $text New text
1381 - * @param string $summary Edit summary
1382 - * @param integer $flags bitfield:
 1380+ * @param $text String: new text
 1381+ * @param $summary String: edit summary
 1382+ * @param $flags Integer bitfield:
13831383 * EDIT_NEW
13841384 * Article is known or assumed to be non-existent, create a new one
13851385 * EDIT_UPDATE
@@ -1400,7 +1400,8 @@
14011401 * edit-already-exists error will be returned. These two conditions are also possible with
14021402 * auto-detection due to MediaWiki's performance-optimised locking strategy.
14031403 *
1404 - * @param $baseRevId, the revision ID this edit was based off, if any
 1404+ * @param $baseRevId the revision ID this edit was based off, if any
 1405+ * @param $user Optional user object, $wgUser will be used if not passed
14051406 *
14061407 * @return Status object. Possible errors:
14071408 * edit-hook-aborted: The ArticleSave hook aborted the edit but didn't set the fatal flag of $status
@@ -1665,9 +1666,9 @@
16661667 * Output a redirect back to the article.
16671668 * This is typically used after an edit.
16681669 *
1669 - * @param boolean $noRedir Add redirect=no
1670 - * @param string $sectionAnchor section to redirect to, including "#"
1671 - * @param string $extraQuery, extra query params
 1670+ * @param $noRedir Boolean: add redirect=no
 1671+ * @param $sectionAnchor String: section to redirect to, including "#"
 1672+ * @param $extraQuery String: extra query params
16721673 */
16731674 public function doRedirect( $noRedir = false, $sectionAnchor = '', $extraQuery = '' ) {
16741675 global $wgOut;
@@ -1824,8 +1825,10 @@
18251826 /**
18261827 * Update the article's restriction field, and leave a log entry.
18271828 *
1828 - * @param array $limit set of restriction keys
1829 - * @param string $reason
 1829+ * @param $limit Array: set of restriction keys
 1830+ * @param $reason String
 1831+ * @param $cascade Integer
 1832+ * @param $expiry Array: per restriction type expiration
18301833 * @return bool true on success
18311834 */
18321835 public function updateRestrictions( $limit = array(), $reason = '', $cascade = 0, $expiry = array() ) {
@@ -1965,8 +1968,8 @@
19661969 /**
19671970 * Take an array of page restrictions and flatten it to a string
19681971 * suitable for insertion into the page_restrictions field.
1969 - * @param array $limit
1970 - * @return string
 1972+ * @param $limit Array
 1973+ * @return String
19711974 */
19721975 protected static function flattenRestrictions( $limit ) {
19731976 if( !is_array( $limit ) ) {
@@ -1984,7 +1987,7 @@
19851988
19861989 /**
19871990 * Auto-generates a deletion reason
1988 - * @param bool &$hasHistory Whether the page has a history
 1991+ * @param &$hasHistory Boolean: whether the page has a history
19891992 */
19901993 public function generateReason( &$hasHistory ) {
19911994 global $wgContLang;
@@ -2171,8 +2174,8 @@
21722175
21732176 /**
21742177 * Get the last N authors
2175 - * @param int $num Number of revisions to get
2176 - * @param string $revLatest The latest rev_id, selected from the master (optional)
 2178+ * @param $num Integer: number of revisions to get
 2179+ * @param $revLatest String: the latest rev_id, selected from the master (optional)
21772180 * @return array Array of authors, duplicates not removed
21782181 */
21792182 public function getLastNAuthors( $num, $revLatest = 0 ) {
@@ -2216,7 +2219,7 @@
22172220
22182221 /**
22192222 * Output deletion confirmation dialog
2220 - * @param $reason string Prefilled reason
 2223+ * @param $reason String: prefilled reason
22212224 */
22222225 public function confirmDelete( $reason ) {
22232226 global $wgOut, $wgUser;
@@ -2466,12 +2469,12 @@
24672470 * performs permissions checks on $wgUser, then calls commitRollback()
24682471 * to do the dirty work
24692472 *
2470 - * @param string $fromP - Name of the user whose edits to rollback.
2471 - * @param string $summary - Custom summary. Set to default summary if empty.
2472 - * @param string $token - Rollback token.
2473 - * @param bool $bot - If true, mark all reverted edits as bot.
 2473+ * @param $fromP String: Name of the user whose edits to rollback.
 2474+ * @param $summary String: Custom summary. Set to default summary if empty.
 2475+ * @param $token String: Rollback token.
 2476+ * @param $bot Boolean: If true, mark all reverted edits as bot.
24742477 *
2475 - * @param array $resultDetails contains result-specific array of additional values
 2478+ * @param $resultDetails Array: contains result-specific array of additional values
24762479 * 'alreadyrolled' : 'current' (rev)
24772480 * success : 'summary' (str), 'current' (rev), 'target' (rev)
24782481 *
@@ -2831,7 +2834,7 @@
28322835 /**
28332836 * Perform article updates on a special page creation.
28342837 *
2835 - * @param Revision $rev
 2838+ * @param $rev Revision object
28362839 *
28372840 * @todo This is a shitty interface function. Kill it and replace the
28382841 * other shitty functions like editUpdates and such so it's not needed
@@ -2850,7 +2853,7 @@
28512854 * Revision as of \<date\>; view current revision
28522855 * \<- Previous version | Next Version -\>
28532856 *
2854 - * @param string $oldid Revision ID of this article revision
 2857+ * @param $oldid String: revision ID of this article revision
28552858 */
28562859 public function setOldSubtitle( $oldid=0 ) {
28572860 global $wgLang, $wgOut, $wgUser;
@@ -2924,7 +2927,7 @@
29252928 * This function is called right before saving the wikitext,
29262929 * so we can do things like signatures and links-in-context.
29272930 *
2928 - * @param string $text
 2931+ * @param $text String
29292932 */
29302933 public function preSaveTransform( $text ) {
29312934 global $wgParser, $wgUser;
@@ -3033,9 +3036,9 @@
30343037 * The article must already exist; link tables etc
30353038 * are not updated, caches are not flushed.
30363039 *
3037 - * @param string $text text submitted
3038 - * @param string $comment comment submitted
3039 - * @param bool $minor whereas it's a minor modification
 3040+ * @param $text String: text submitted
 3041+ * @param $comment String: comment submitted
 3042+ * @param $minor Boolean: whereas it's a minor modification
30403043 */
30413044 public function quickEdit( $text, $comment = '', $minor = 0 ) {
30423045 wfProfileIn( __METHOD__ );
@@ -3058,7 +3061,7 @@
30593062 /**
30603063 * Used to increment the view counter
30613064 *
3062 - * @param integer $id article id
 3065+ * @param $id Integer: article id
30633066 */
30643067 public static function incViewCount( $id ) {
30653068 $id = intval( $id );
@@ -3125,8 +3128,8 @@
31263129 * This is a good place to put code to clear caches, for instance.
31273130 *
31283131 * This is called on page move and undelete, as well as edit
3129 - * @static
3130 - * @param $title_obj a title object
 3132+ *
 3133+ * @param $title a title object
31313134 */
31323135
31333136 public static function onArticleCreate( $title ) {
@@ -3217,8 +3220,6 @@
32183221 /**
32193222 * Info about this page
32203223 * Called for ?action=info when $wgAllowPageInfo is on.
3221 - *
3222 - * @public
32233224 */
32243225 public function info() {
32253226 global $wgLang, $wgOut, $wgAllowPageInfo, $wgUser;
@@ -3279,7 +3280,7 @@
32803281 * Return the total number of edits and number of unique editors
32813282 * on a given page. If page does not exist, returns false.
32823283 *
3283 - * @param Title $title
 3284+ * @param $title Title object
32843285 * @return array
32853286 */
32863287 protected function pageCountInfo( $title ) {
@@ -3310,7 +3311,7 @@
33113312 * Return a list of templates used by this article.
33123313 * Uses the templatelinks table
33133314 *
3314 - * @return array Array of Title objects
 3315+ * @return Array of Title objects
33153316 */
33163317 public function getUsedTemplates() {
33173318 $result = array();
@@ -3336,7 +3337,7 @@
33373338 * Returns a list of hidden categories this page is a member of.
33383339 * Uses the page_props and categorylinks tables.
33393340 *
3340 - * @return array Array of Title objects
 3341+ * @return Array of Title objects
33413342 */
33423343 public function getHiddenCategories() {
33433344 $result = array();
@@ -3361,9 +3362,9 @@
33623363
33633364 /**
33643365 * Return an applicable autosummary if one exists for the given edit.
3365 - * @param string $oldtext The previous text of the page.
3366 - * @param string $newtext The submitted text of the page.
3367 - * @param bitmask $flags A bitmask of flags submitted for the edit.
 3366+ * @param $oldtext String: the previous text of the page.
 3367+ * @param $newtext String: The submitted text of the page.
 3368+ * @param $flags Bitmask: a bitmask of flags submitted for the edit.
33683369 * @return string An appropriate autosummary, or an empty string.
33693370 */
33703371 public static function getAutosummary( $oldtext, $newtext, $flags ) {
@@ -3411,8 +3412,8 @@
34123413 * Saves the text into the parser cache if possible.
34133414 * Updates templatelinks if it is out of date.
34143415 *
3415 - * @param string $text
3416 - * @param bool $cache
 3416+ * @param $text String
 3417+ * @param $cache Boolean
34173418 */
34183419 public function outputWikiText( $text, $cache = true ) {
34193420 global $wgParser, $wgUser, $wgOut, $wgEnableParserCache, $wgUseFileCache;

Status & tagging log