r63762 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63761‎ | r63762 | r63763 >
Date:01:08, 15 March 2010
Author:lhridley
Status:ok
Tags:
Comment:
Documentation through ~line 2150
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -508,7 +508,7 @@
509509 * Read/write accessor to select FOR UPDATE
510510 *
511511 * @param $x Mixed: FIXME
512 - * @return
 512+ * @return mixed value of $x, or value stored in Article::mForUpdate
513513 */
514514 public function forUpdate( $x = null ) {
515515 return wfSetVar( $this->mForUpdate, $x );
@@ -611,7 +611,7 @@
612612 /**
613613 * Tests if the article text represents a redirect
614614 *
615 - * @param $text String: FIXME
 615+ * @param $text mixed string containing article contents, or boolean
616616 * @return bool
617617 */
618618 public function isRedirect( $text = false ) {
@@ -663,6 +663,10 @@
664664 $this->mRevIdFetched = $this->mLastRevision->getId();
665665 }
666666 }
 667+
 668+ /**
 669+ * @return string GMT timestamp of last article revision
 670+ **/
667671
668672 public function getTimestamp() {
669673 // Check if the field has been filled by ParserCache::get()
@@ -672,27 +676,45 @@
673677 return wfTimestamp( TS_MW, $this->mTimestamp );
674678 }
675679
 680+ /**
 681+ * @return int user ID for the user that made the last article revision
 682+ */
676683 public function getUser() {
677684 $this->loadLastEdit();
678685 return $this->mUser;
679686 }
680687
 688+ /**
 689+ * @return string username of the user that made the last article revision
 690+ */
681691 public function getUserText() {
682692 $this->loadLastEdit();
683693 return $this->mUserText;
684694 }
685695
 696+ /**
 697+ * @return string Comment stored for the last article revision
 698+ */
686699 public function getComment() {
687700 $this->loadLastEdit();
688701 return $this->mComment;
689702 }
690703
 704+ /**
 705+ * Returns true if last revision was marked as "minor edit"
 706+ *
 707+ * @return boolean Minor edit indicator for the last article revision.
 708+ */
691709 public function getMinorEdit() {
692710 $this->loadLastEdit();
693711 return $this->mMinorEdit;
694712 }
695713
696 - /* Use this to fetch the rev ID used on page views */
 714+ /**
 715+ * Use this to fetch the rev ID used on page views
 716+ *
 717+ * @return int revision ID of last article revision
 718+ */
697719 public function getRevIdFetched() {
698720 $this->loadLastEdit();
699721 return $this->mRevIdFetched;
@@ -701,6 +723,7 @@
702724 /**
703725 * @param $limit Integer: default 0.
704726 * @param $offset Integer: default 0.
 727+ * @return UserArrayFromResult object with User objects of article contributors for requested range
705728 */
706729 public function getContributors( $limit = 0, $offset = 0 ) {
707730 # XXX: this is expensive; cache this info somewhere.
@@ -1099,6 +1122,8 @@
11001123 * If this request is a redirect view, send "redirected from" subtitle to
11011124 * $wgOut. Returns true if the header was needed, false if this is not a
11021125 * redirect view. Handles both local and remote redirects.
 1126+ *
 1127+ * @return boolean
11031128 */
11041129 public function showRedirectedFromHeader() {
11051130 global $wgOut, $wgUser, $wgRequest, $wgRedirectSources;
@@ -1285,7 +1310,8 @@
12861311 /**
12871312 * If the revision requested for view is deleted, check permissions.
12881313 * Send either an error message or a warning header to $wgOut.
1289 - * Returns true if the view is allowed, false if not.
 1314+ *
 1315+ * @return boolean true if the view is allowed, false if not.
12901316 */
12911317 public function showDeletedRevisionHeader() {
12921318 global $wgOut, $wgRequest;
@@ -1317,9 +1343,11 @@
13181344 }
13191345 }
13201346
1321 - /*
1322 - * Should the parser cache be used?
1323 - */
 1347+ /**
 1348+ * Should the parser cache be used?
 1349+ *
 1350+ * @return boolean
 1351+ */
13241352 public function useParserCache( $oldid ) {
13251353 global $wgUser, $wgEnableParserCache;
13261354
@@ -1352,6 +1380,8 @@
13531381 * output it and return true. If it is not present, output nothing and
13541382 * return false. This is used as a callback function for
13551383 * PoolCounter::executeProtected().
 1384+ *
 1385+ * @return boolean
13561386 */
13571387 public function tryDirtyCache() {
13581388 global $wgOut;
@@ -1392,9 +1422,11 @@
13931423
13941424 /**
13951425 * View redirect
 1426+ *
13961427 * @param $target Title object or Array of destination(s) to redirect
13971428 * @param $appendSubtitle Boolean [optional]
13981429 * @param $forceKnown Boolean: should the image be shown as a bluelink regardless of existence?
 1430+ * @return string containing HMTL with redirect link
13991431 */
14001432 public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
14011433 global $wgOut, $wgContLang, $wgStylePath, $wgUser;
@@ -1445,6 +1477,9 @@
14461478
14471479 }
14481480
 1481+ /**
 1482+ * Builds trackback links for article display if $wgUseTrackbacks is set to true
 1483+ */
14491484 public function addTrackbacks() {
14501485 global $wgOut, $wgUser;
14511486 $dbr = wfGetDB( DB_SLAVE );
@@ -1474,6 +1509,9 @@
14751510 $this->mTitle->invalidateCache();
14761511 }
14771512
 1513+ /**
 1514+ * Removes trackback record for current article from trackbacks table
 1515+ */
14781516 public function deletetrackback() {
14791517 global $wgUser, $wgRequest, $wgOut;
14801518 if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) {
@@ -1493,6 +1531,10 @@
14941532 $wgOut->addWikiMsg( 'trackbackdeleteok' );
14951533 $this->mTitle->invalidateCache();
14961534 }
 1535+
 1536+ /**
 1537+ * Handle action=render
 1538+ */
14971539
14981540 public function render() {
14991541 global $wgOut;
@@ -1683,6 +1725,7 @@
16841726 *
16851727 * @param $dbw Database object
16861728 * @param $revision Revision object
 1729+ * @return mixed
16871730 */
16881731 public function updateIfNewerOn( &$dbw, $revision ) {
16891732 wfProfileIn( __METHOD__ );

Status & tagging log