r82494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82493‎ | r82494 | r82495 >
Date:22:18, 19 February 2011
Author:reedy
Status:ok
Tags:
Comment:
And some more function level documentation
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMostlinkedcategories.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMovepage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -27,6 +27,10 @@
2828 * @ingroup SpecialPage
2929 */
3030 class PageArchive {
 31+
 32+ /**
 33+ * @var Title
 34+ */
3135 protected $title;
3236 var $fileStatus;
3337
@@ -555,6 +559,9 @@
556560 return $restored;
557561 }
558562
 563+ /**
 564+ * @return Status
 565+ */
559566 function getFileStatus() { return $this->fileStatus; }
560567 }
561568
@@ -920,6 +927,11 @@
921928 );
922929 }
923930
 931+ /**
 932+ * @param $rev Revision
 933+ * @param $prefix
 934+ * @return string
 935+ */
924936 private function diffHeader( $rev, $prefix ) {
925937 global $wgUser, $wgLang;
926938 $sk = $wgUser->getSkin();
@@ -1301,6 +1313,9 @@
13021314
13031315 /**
13041316 * Fetch revision text link if it's available to all users
 1317+ *
 1318+ * @param $rev Revision
 1319+ * @param $sk Skin
13051320 * @return string
13061321 */
13071322 function getPageLink( $rev, $titleObj, $ts, $sk ) {
@@ -1329,6 +1344,8 @@
13301345 /**
13311346 * Fetch image view link if it's available to all users
13321347 *
 1348+ * @param $file File
 1349+ * @param $sk Skin
13331350 * @return String: HTML fragment
13341351 */
13351352 function getFileLink( $file, $titleObj, $ts, $key, $sk ) {
@@ -1356,6 +1373,8 @@
13571374 /**
13581375 * Fetch file's user id if it's available to this user
13591376 *
 1377+ * @param $file File
 1378+ * @param $sk Skin
13601379 * @return String: HTML fragment
13611380 */
13621381 function getFileUser( $file, $sk ) {
@@ -1373,6 +1392,8 @@
13741393 /**
13751394 * Fetch file upload comment if it's available to this user
13761395 *
 1396+ * @param $file File
 1397+ * @param $sk Skin
13771398 * @return String: HTML fragment
13781399 */
13791400 function getFileComment( $file, $sk ) {
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -425,6 +425,8 @@
426426
427427 /**
428428 * Callback function to output a block
 429+ *
 430+ * @param $block Block
429431 */
430432 function formatRow( $block ) {
431433 global $wgUser, $wgLang, $wgBlockAllowsUTEdit;
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -70,6 +70,9 @@
7171 parent::__construct();
7272 }
7373
 74+ /**
 75+ * @return Array
 76+ */
7477 function getFieldNames() {
7578 if ( !$this->mFieldNames ) {
7679 global $wgMiserMode;
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -588,6 +588,9 @@
589589 /**
590590 * Attempt to automatically create a user on login. Only succeeds if there
591591 * is an external authentication method which allows it.
 592+ *
 593+ * @param $user User
 594+ *
592595 * @return integer Status code
593596 */
594597 function attemptAutoCreate( $user ) {
@@ -1070,14 +1073,18 @@
10711074
10721075 /**
10731076 * @private
 1077+ *
 1078+ * @param $user User
 1079+ *
 1080+ * @return Boolean
10741081 */
10751082 function showCreateOrLoginLink( &$user ) {
10761083 if( $this->mType == 'signup' ) {
1077 - return( true );
 1084+ return true;
10781085 } elseif( $user->isAllowed( 'createaccount' ) ) {
1079 - return( true );
 1086+ return true;
10801087 } else {
1081 - return( false );
 1088+ return false;
10821089 }
10831090 }
10841091
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -480,10 +480,18 @@
481481 }
482482 }
483483
 484+ /**
 485+ * @param $revision Revision
 486+ * @return string
 487+ */
484488 protected function feedItemAuthor( $revision ) {
485489 return $revision->getUserText();
486490 }
487491
 492+ /**
 493+ * @param $revision Revision
 494+ * @return string
 495+ */
488496 protected function feedItemDesc( $revision ) {
489497 if( $revision ) {
490498 return '<p>' . htmlspecialchars( $revision->getUserText() ) . wfMsgForContent( 'colon-separator' ) .
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -46,6 +46,10 @@
4747 public $mRequest; // The WebRequest or FauxRequest this form is supposed to handle
4848 public $mSourceType;
4949 public $mUpload;
 50+
 51+ /**
 52+ * @var LocalFile
 53+ */
5054 public $mLocalFile;
5155 public $mUploadClicked;
5256
Index: trunk/phase3/includes/specials/SpecialMovepage.php
@@ -27,6 +27,10 @@
2828 * @ingroup SpecialPage
2929 */
3030 class MovePageForm extends UnlistedSpecialPage {
 31+
 32+ /**
 33+ * @var Title
 34+ */
3135 var $oldTitle, $newTitle; # Objects
3236 var $reason; # Text input
3337 var $moveTalk, $deleteAndMove, $moveSubpages, $fixRedirects, $leaveRedirect, $moveOverShared; # Checks
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -518,7 +518,6 @@
519519
520520 $section = '';
521521
522 -
523522 if( !is_null($sectionTitle) ) {
524523 if( $sectionText == '' )
525524 $sectionText = null;
Index: trunk/phase3/includes/specials/SpecialMostlinkedcategories.php
@@ -52,6 +52,8 @@
5353
5454 /**
5555 * Fetch user page links and cache their existence
 56+ *
 57+ * @param $db DatabaseBase
5658 */
5759 function preprocessResults( $db, $res ) {
5860 $batch = new LinkBatch;
@@ -67,6 +69,11 @@
6870 }
6971 }
7072
 73+ /**
 74+ * @param $skin Skin
 75+ * @param $result
 76+ * @return string
 77+ */
7178 function formatResult( $skin, $result ) {
7279 global $wgLang, $wgContLang;
7380

Status & tagging log