r24754 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24753‎ | r24754 | r24755 >
Date:18:18, 13 August 2007
Author:robchurch
Status:old
Tags:
Comment:
Better variable and method naming
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -39,7 +39,7 @@
4040 parent :: __construct($query, $moduleName, 'uc');
4141 }
4242
43 - private $params, $userTitle;
 43+ private $params, $username;
4444 private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
4545 $fld_comment = false, $fld_flags = false;
4646
@@ -60,7 +60,7 @@
6161 $db = $this->getDB();
6262
6363 // Prepare query
64 - $this->getUserTitle();
 64+ $this->prepareUsername();
6565 $this->prepareQuery();
6666
6767 //Do the actual query.
@@ -96,7 +96,7 @@
9797 * Validate the 'user' parameter and set the value to compare
9898 * against `revision`.`rev_user_text`
9999 */
100 - private function getUserTitle() {
 100+ private function prepareUsername() {
101101 $user = $this->params['user'];
102102 if( $user ) {
103103 $name = User::isIP( $user )
@@ -105,7 +105,7 @@
106106 if( $name === false ) {
107107 $this->dieUsage( "User name {$user} is not valid", 'param_user' );
108108 } else {
109 - $this->userTitle = $name;
 109+ $this->username = $name;
110110 }
111111 } else {
112112 $this->dieUsage( 'User parameter may not be empty', 'param_user' );
@@ -125,7 +125,7 @@
126126 $this->addWhereFld('rev_deleted', 0);
127127
128128 // We only want pages by the specified user.
129 - $this->addWhereFld( 'rev_user_text', $this->userTitle );
 129+ $this->addWhereFld( 'rev_user_text', $this->username );
130130
131131 // ... and in the specified timeframe.
132132 $this->addWhereRange('rev_timestamp',

Follow-up revisions

RevisionCommit summaryAuthorDate
r24755Merged revisions 24694-24754 via svnmerge from...david19:48, 13 August 2007

Status & tagging log