r75096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75095‎ | r75096 | r75097 >
Date:18:50, 20 October 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fix some method documentation

Fix some typos

Some explicit class members
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/api/ApiDelete.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRecentChanges.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRecentChanges.php
@@ -91,7 +91,7 @@
9292
9393 /**
9494 * Sets internal state to include the desired properties in the output.
95 - * @param $prop associative array of properties, only keys are used here
 95+ * @param $prop Array associative array of properties, only keys are used here
9696 */
9797 public function initProperties( $prop ) {
9898 $this->fld_comment = isset( $prop['comment'] );
Index: trunk/phase3/includes/api/ApiParse.php
@@ -34,6 +34,8 @@
3535 */
3636 class ApiParse extends ApiBase {
3737
 38+ private $section;
 39+
3840 public function __construct( $main, $action ) {
3941 parent::__construct( $main, $action );
4042 }
Index: trunk/phase3/includes/api/ApiDelete.php
@@ -30,7 +30,7 @@
3131 }
3232
3333 /**
34 - * API module that facilitates deleting pages. The API eqivalent of action=delete.
 34+ * API module that facilitates deleting pages. The API equivalent of action=delete.
3535 * Requires API write mode to be enabled.
3636 *
3737 * @ingroup API
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -301,9 +301,9 @@
302302
303303 /**
304304 * Create instances of all modules requested by the client
305 - * @param $modules array to append instatiated modules to
 305+ * @param $modules Array to append instantiated modules to
306306 * @param $param string Parameter name to read modules from
307 - * @param $moduleList array(modulename => classname)
 307+ * @param $moduleList Array array(modulename => classname)
308308 */
309309 private function instantiateModules( &$modules, $param, $moduleList ) {
310310 $list = @$this->params[$param];
@@ -576,15 +576,15 @@
577577 $this->mPageSet = null;
578578 $this->mAllowedGenerators = array(); // Will be repopulated
579579
580 - $astriks = str_repeat( '--- ', 8 );
581 - $astriks2 = str_repeat( '*** ', 10 );
582 - $msg .= "\n$astriks Query: Prop $astriks\n\n";
 580+ $asterisk = str_repeat( '--- ', 8 );
 581+ $asterisk2 = str_repeat( '*** ', 10 );
 582+ $msg .= "\n$asterisk Query: Prop $asterisk\n\n";
583583 $msg .= $this->makeHelpMsgHelper( $this->mQueryPropModules, 'prop' );
584 - $msg .= "\n$astriks Query: List $astriks\n\n";
 584+ $msg .= "\n$asterisk Query: List $asterisk\n\n";
585585 $msg .= $this->makeHelpMsgHelper( $this->mQueryListModules, 'list' );
586 - $msg .= "\n$astriks Query: Meta $astriks\n\n";
 586+ $msg .= "\n$asterisk Query: Meta $asterisk\n\n";
587587 $msg .= $this->makeHelpMsgHelper( $this->mQueryMetaModules, 'meta' );
588 - $msg .= "\n\n$astriks2 Modules: continuation $astriks2\n\n";
 588+ $msg .= "\n\n$asterisk2 Modules: continuation $asterisk2\n\n";
589589
590590 // Perform the base call last because the $this->mAllowedGenerators
591591 // will be updated inside makeHelpMsgHelper()
@@ -596,7 +596,7 @@
597597
598598 /**
599599 * For all modules in $moduleList, generate help messages and join them together
600 - * @param $moduleList array(modulename => classname)
 600+ * @param $moduleList Array array(modulename => classname)
601601 * @param $paramName string Parameter name
602602 * @return string
603603 */
Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -347,7 +347,7 @@
348348 /**
349349 * Populate this PageSet from a rowset returned from the database
350350 * @param $db Database object
351 - * @param $queryResult Query result object
 351+ * @param $queryResult ResultWrapper Query result object
352352 */
353353 public function populateFromQueryResult( $db, $queryResult ) {
354354 $this->profileIn();
@@ -468,7 +468,7 @@
469469 * Iterate through the result of the query on 'page' table,
470470 * and for each row create and store title object and save any extra fields requested.
471471 * @param $db Database
472 - * @param $res DB Query result
 472+ * @param $res ResultWrapper DB Query result
473473 * @param $remaining array of either pageID or ns/title elements (optional).
474474 * If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
475475 * @param $processTitles bool Must be provided together with $remaining.
Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -46,6 +46,8 @@
4747 $fld_comment = false, $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
4848 $fld_content = false, $fld_tags = false;
4949
 50+ private $tokenFunctions;
 51+
5052 protected function getTokenFunctions() {
5153 // tokenname => function
5254 // function prototype is func($pageid, $title, $rev)
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -40,7 +40,7 @@
4141 parent::__construct( $query, $moduleName, 'uc' );
4242 }
4343
44 - private $params, $prefixMode, $userprefix, $multiUserMode;
 44+ private $params, $prefixMode, $userprefix, $multiUserMode, $usernames;
4545 private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
4646 $fld_comment = false, $fld_parsedcomment = false, $fld_flags = false,
4747 $fld_patrolled = false, $fld_tags = false, $fld_size = false;
Index: trunk/phase3/includes/Title.php
@@ -2740,7 +2740,7 @@
27412741 /**
27422742 * Get a Title object associated with the talk page of this article
27432743 *
2744 - * @return \type{Title} the object for the talk page
 2744+ * @return Title the object for the talk page
27452745 */
27462746 public function getTalkPage() {
27472747 return Title::makeTitle( MWNamespace::getTalk( $this->getNamespace() ), $this->getDBkey() );
@@ -2750,7 +2750,7 @@
27512751 * Get a title object associated with the subject page of this
27522752 * talk page
27532753 *
2754 - * @return \type{Title} the object for the subject page
 2754+ * @return Title the object for the subject page
27552755 */
27562756 public function getSubjectPage() {
27572757 // Is this the same title?

Follow-up revisions

RevisionCommit summaryAuthorDate
r75128Followup r75096 per Platonides, name the stuff better, rather than just fixin...reedy23:36, 20 October 2010

Comments

#Comment by Platonides (talk | contribs)   20:32, 20 October 2010

Any idea why a variable holding "" is called $asterisk? $dashes seems more appropiate.

Or better, call them module separator and query separator.

#Comment by Reedy (talk | contribs)   23:09, 20 October 2010

It'd probably make more sense.

I was just fixing the typo :D

Status & tagging log