r88920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88919‎ | r88920 | r88921 >
Date:19:52, 26 May 2011
Author:reedy
Status:ok
Tags:
Comment:
More documentation tweaks/additions
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/ExternalUser.php (modified) (history)
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_Hash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ExternalUser.php
@@ -98,7 +98,7 @@
9999 * This is a wrapper around newFromId().
100100 *
101101 * @param $user User
102 - * @return mixed ExternalUser or false
 102+ * @return ExternalUser|false
103103 */
104104 public static function newFromUser( $user ) {
105105 global $wgExternalAuthType;
Index: trunk/phase3/includes/parser/Preprocessor_Hash.php
@@ -24,10 +24,17 @@
2525 $this->parser = $parser;
2626 }
2727
 28+ /**
 29+ * @return PPFrame_Hash
 30+ */
2831 function newFrame() {
2932 return new PPFrame_Hash( $this );
3033 }
3134
 35+ /**
 36+ * @param $args
 37+ * @return PPCustomFrame_Hash
 38+ */
3239 function newCustomFrame( $args ) {
3340 return new PPCustomFrame_Hash( $this, $args );
3441 }
@@ -1231,6 +1238,13 @@
12321239 var $numberedArgs, $namedArgs, $parent;
12331240 var $numberedExpansionCache, $namedExpansionCache;
12341241
 1242+ /**
 1243+ * @param $preprocessor
 1244+ * @param $parent
 1245+ * @param $numberedArgs array
 1246+ * @param $namedArgs array
 1247+ * @param $title Title
 1248+ */
12351249 function __construct( $preprocessor, $parent = false, $numberedArgs = array(), $namedArgs = array(), $title = false ) {
12361250 parent::__construct( $preprocessor );
12371251
@@ -1267,11 +1281,16 @@
12681282 }
12691283 /**
12701284 * Returns true if there are no arguments in this frame
 1285+ *
 1286+ * @return bool
12711287 */
12721288 function isEmpty() {
12731289 return !count( $this->numberedArgs ) && !count( $this->namedArgs );
12741290 }
12751291
 1292+ /**
 1293+ * @return array
 1294+ */
12761295 function getArguments() {
12771296 $arguments = array();
12781297 foreach ( array_merge(
@@ -1282,6 +1301,9 @@
12831302 return $arguments;
12841303 }
12851304
 1305+ /**
 1306+ * @return array
 1307+ */
12861308 function getNumberedArguments() {
12871309 $arguments = array();
12881310 foreach ( array_keys($this->numberedArgs) as $key ) {
@@ -1290,6 +1312,9 @@
12911313 return $arguments;
12921314 }
12931315
 1316+ /**
 1317+ * @return array
 1318+ */
12941319 function getNamedArguments() {
12951320 $arguments = array();
12961321 foreach ( array_keys($this->namedArgs) as $key ) {
Index: trunk/phase3/includes/parser/Parser.php
@@ -109,7 +109,14 @@
110110 var $mImageParamsMagicArray = array();
111111 var $mMarkerIndex = 0;
112112 var $mFirstCall = true;
113 - var $mVariables, $mSubstWords; # Initialised by initialiseVariables()
 113+
 114+ # Initialised by initialiseVariables()
 115+ var $mVariables;
 116+
 117+ /**
 118+ * @var MagicWordArray
 119+ */
 120+ var $mSubstWords;
114121 var $mConf, $mPreprocessor, $mExtLinkBracketedRegex, $mUrlProtocols; # Initialised in constructor
115122
116123 # Cleared with clearState():
@@ -125,7 +132,12 @@
126133 var $mStripState;
127134
128135 var $mIncludeCount, $mArgStack, $mLastSection, $mInPre;
129 - var $mLinkHolders, $mLinkID;
 136+ /**
 137+ * @var LinkHolderArray
 138+ */
 139+ var $mLinkHolders;
 140+
 141+ var $mLinkID;
130142 var $mIncludeSizes, $mPPNodeCount, $mDefaultSort;
131143 var $mTplExpandCache; # empty-frame expansion cache
132144 var $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
@@ -3518,6 +3530,9 @@
35193531 /**
35203532 * Transclude an interwiki link.
35213533 *
 3534+ * @param $title Title
 3535+ * @param $action
 3536+ *
35223537 * @return string
35233538 */
35243539 function interwikiTransclude( $title, $action ) {
@@ -5010,6 +5025,11 @@
50115026 return $ret;
50125027 }
50135028
 5029+ /**
 5030+ * @param $caption
 5031+ * @param $holders LinkHolderArray
 5032+ * @return mixed|String
 5033+ */
50145034 protected function stripAltText( $caption, $holders ) {
50155035 # Strip bad stuff out of the title (tooltip). We can't just use
50165036 # replaceLinkHoldersText() here, because if this function is called
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -1157,6 +1157,8 @@
11581158 /**
11591159 * Makes an object that, when expand()ed, will be the same as one obtained
11601160 * with implode()
 1161+ *
 1162+ * @return array
11611163 */
11621164 function virtualImplode( $sep /*, ... */ ) {
11631165 $args = array_slice( func_get_args(), 1 );
@@ -1424,6 +1426,9 @@
14251427 $this->node = $node;
14261428 }
14271429
 1430+ /**
 1431+ * @return DOMXPath
 1432+ */
14281433 function getXPath() {
14291434 if ( $this->xpath === null ) {
14301435 $this->xpath = new DOMXPath( $this->node->ownerDocument );
@@ -1443,22 +1448,39 @@
14441449 return $s;
14451450 }
14461451
 1452+ /**
 1453+ * @return bool|PPNode_DOM
 1454+ */
14471455 function getChildren() {
14481456 return $this->node->childNodes ? new self( $this->node->childNodes ) : false;
14491457 }
14501458
 1459+ /**
 1460+ * @return bool|PPNode_DOM
 1461+ */
14511462 function getFirstChild() {
14521463 return $this->node->firstChild ? new self( $this->node->firstChild ) : false;
14531464 }
14541465
 1466+ /**
 1467+ * @return bool|PPNode_DOM
 1468+ */
14551469 function getNextSibling() {
14561470 return $this->node->nextSibling ? new self( $this->node->nextSibling ) : false;
14571471 }
14581472
 1473+ /**
 1474+ * @param $type
 1475+ *
 1476+ * @return bool|PPNode_DOM
 1477+ */
14591478 function getChildrenOfType( $type ) {
14601479 return new self( $this->getXPath()->query( $type, $this->node ) );
14611480 }
14621481
 1482+ /**
 1483+ * @return int
 1484+ */
14631485 function getLength() {
14641486 if ( $this->node instanceof DOMNodeList ) {
14651487 return $this->node->length;
@@ -1467,11 +1489,18 @@
14681490 }
14691491 }
14701492
 1493+ /**
 1494+ * @param $i
 1495+ * @return bool|PPNode_DOM
 1496+ */
14711497 function item( $i ) {
14721498 $item = $this->node->item( $i );
14731499 return $item ? new self( $item ) : false;
14741500 }
14751501
 1502+ /**
 1503+ * @return string
 1504+ */
14761505 function getName() {
14771506 if ( $this->node instanceof DOMNodeList ) {
14781507 return '#nodelist';
@@ -1485,6 +1514,8 @@
14861515 * name PPNode name
14871516 * index String index
14881517 * value PPNode value
 1518+ *
 1519+ * @return array
14891520 */
14901521 function splitArg() {
14911522 $xpath = $this->getXPath();
@@ -1504,6 +1535,8 @@
15051536 /**
15061537 * Split an <ext> node into an associative array containing name, attr, inner and close
15071538 * All values in the resulting array are PPNodes. Inner and close are optional.
 1539+ *
 1540+ * @return array
15081541 */
15091542 function splitExt() {
15101543 $xpath = $this->getXPath();
Index: trunk/phase3/includes/EditPage.php
@@ -74,7 +74,12 @@
7575 var $autoSumm = '';
7676 var $hookError = '';
7777 #var $mPreviewTemplates;
 78+
 79+ /**
 80+ * @var ParserOutput
 81+ */
7882 var $mParserOutput;
 83+
7984 var $mBaseRevision = false;
8085 var $mShowSummaryField = true;
8186
@@ -2046,10 +2051,15 @@
20472052 return $previewhead . $previewHTML . $this->previewTextAfterContent;
20482053 }
20492054
 2055+ /**
 2056+ * @return Array
 2057+ */
20502058 function getTemplates() {
20512059 if ( $this->preview || $this->section != '' ) {
20522060 $templates = array();
2053 - if ( !isset( $this->mParserOutput ) ) return $templates;
 2061+ if ( !isset( $this->mParserOutput ) ) {
 2062+ return $templates;
 2063+ }
20542064 foreach( $this->mParserOutput->getTemplates() as $ns => $template) {
20552065 foreach( array_keys( $template ) as $dbk ) {
20562066 $templates[] = Title::makeTitle($ns, $dbk);
@@ -2617,6 +2627,11 @@
26182628 : $text;
26192629 }
26202630
 2631+ /**
 2632+ * @param $request WebRequest
 2633+ * @param $text string
 2634+ * @return string
 2635+ */
26212636 function safeUnicodeText( $request, $text ) {
26222637 $text = rtrim( $text );
26232638 return $request->getBool( 'safemode' )
Index: trunk/phase3/includes/MagicWord.php
@@ -251,7 +251,7 @@
252252 /**
253253 * Get a MagicWordArray of double-underscore entities
254254 *
255 - * @return array
 255+ * @return MagicWordArray
256256 */
257257 static function getDoubleUnderscoreArray() {
258258 if ( is_null( self::$mDoubleUnderscoreArray ) ) {
Index: trunk/phase3/includes/SkinTemplate.php
@@ -1420,6 +1420,8 @@
14211421
14221422 /**
14231423 * @private
 1424+ *
 1425+ * @return bool
14241426 */
14251427 function haveMsg( $str ) {
14261428 $msg = $this->translator->translate( $str );

Status & tagging log