r85035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85034‎ | r85035 | r85036 >
Date:19:00, 30 March 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Fixup/add documentation

Remove some unused variables
Modified paths:
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/archives/upgradeLogging.php (modified) (history)
  • /trunk/phase3/maintenance/deleteOrphanedRevisions.php (modified) (history)
  • /trunk/phase3/maintenance/fetchText.php (modified) (history)
  • /trunk/phase3/maintenance/importUseModWikipedia.php (modified) (history)
  • /trunk/phase3/maintenance/language/checkLanguage.inc (modified) (history)
  • /trunk/phase3/maintenance/language/generateCollationData.php (modified) (history)
  • /trunk/phase3/maintenance/language/languages.inc (modified) (history)
  • /trunk/phase3/maintenance/language/rebuildLanguage.php (modified) (history)
  • /trunk/phase3/maintenance/orphans.php (modified) (history)
  • /trunk/phase3/maintenance/reassignEdits.php (modified) (history)
  • /trunk/phase3/maintenance/updateCollation.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/upgradeLogging.php
@@ -24,6 +24,10 @@
2525 require( dirname( __FILE__ ) . '/../commandLine.inc' );
2626
2727 class UpdateLogging {
 28+
 29+ /**
 30+ * @var DatabaseBase
 31+ */
2832 var $dbw;
2933 var $batchSize = 1000;
3034 var $minTs = false;
Index: trunk/phase3/maintenance/updateCollation.php
@@ -88,7 +88,6 @@
8989 }
9090
9191 $count = 0;
92 - $row = false;
9392 $batchConds = array();
9493 do {
9594 $this->output( 'Processing next ' . self::BATCH_SIZE . ' rows... ');
Index: trunk/phase3/maintenance/importUseModWikipedia.php
@@ -377,7 +377,6 @@
378378 }
379379
380380 function revisionCallback( $params ) {
381 - $origTitle = $params['title'];
382381 $title = $params['rctitle'];
383382 $editTime = $params['timestamp'];
384383
Index: trunk/phase3/maintenance/Maintenance.php
@@ -92,8 +92,12 @@
9393 // Have we already loaded our user input?
9494 protected $mInputLoaded = false;
9595
96 - // Batch size. If a script supports this, they should set
97 - // a default with setBatchSize()
 96+ /**
 97+ * Batch size. If a script supports this, they should set
 98+ * a default with setBatchSize()
 99+ *
 100+ * @var int
 101+ */
98102 protected $mBatchSize = null;
99103
100104 // Generic options added by addDefaultParams()
@@ -1072,7 +1076,7 @@
10731077 * Perform a search index update with locking
10741078 * @param $maxLockTime Integer: the maximum time to keep the search index locked.
10751079 * @param $callback callback String: the function that will update the function.
1076 - * @param $dbw Database object
 1080+ * @param $dbw DatabaseBase object
10771081 * @param $results
10781082 */
10791083 public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
Index: trunk/phase3/maintenance/reassignEdits.php
@@ -126,8 +126,8 @@
127127 * i.e. a user => id mapping, or a user_text => text mapping
128128 *
129129 * @param $user User for the condition
130 - * @param $idfield Field name containing the identifier
131 - * @param $utfield Field name containing the user text
 130+ * @param $idfield string Field name containing the identifier
 131+ * @param $utfield string Field name containing the user text
132132 * @return array
133133 */
134134 private function userConditions( &$user, $idfield, $utfield ) {
Index: trunk/phase3/maintenance/orphans.php
@@ -50,7 +50,7 @@
5151
5252 /**
5353 * Lock the appropriate tables for the script
54 - * @param $db Database object
 54+ * @param $db DatabaseBase object
5555 * @param $extraTable String The name of any extra tables to lock (eg: text)
5656 */
5757 private function lockTables( &$db, $extraTable = null ) {
Index: trunk/phase3/maintenance/language/generateCollationData.php
@@ -193,7 +193,7 @@
194194 // portion equal to the first character, then remove the second
195195 // character. This avoids having characters like U+A732 (double A)
196196 // polluting the basic latin sort area.
197 - $prevWeights = array();
 197+
198198 foreach ( $this->groups as $weight => $group ) {
199199 if ( preg_match( '/(\.[0-9A-F]*)\./', $weight, $m ) ) {
200200 if ( isset( $this->groups[$m[1]] ) ) {
Index: trunk/phase3/maintenance/language/rebuildLanguage.php
@@ -29,11 +29,12 @@
3030 /**
3131 * Rewrite a messages array.
3232 *
 33+ * @param $languages
3334 * @param $code The language code.
34 - * @param $write Write to the messages file?
35 - * @param $listUnknown List the unknown messages?
36 - * @param $removeUnknown Remove the unknown messages?
37 - * @param $removeDupes Remove the duplicated messages?
 35+ * @param bool $write Write to the messages file?
 36+ * @param bool $listUnknown List the unknown messages?
 37+ * @param bool $removeUnknown Remove the unknown messages?
 38+ * @param bool $removeDupes Remove the duplicated messages?
3839 * @param $dupeMsgSource The source file intended to remove from the array.
3940 */
4041 function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) {
@@ -50,7 +51,7 @@
5152 *
5253 * @param $oldMsgArray The input message array.
5354 * @param $dupeMsgSource The source file path for duplicates.
54 - * @return $newMsgArray The output message array, with duplicates removed.
 55+ * @return Array $newMsgArray The output message array, with duplicates removed.
5556 */
5657 function removeDupes( $oldMsgArray, $dupeMsgSource ) {
5758 if ( file_exists( $dupeMsgSource ) ) {
Index: trunk/phase3/maintenance/language/checkLanguage.inc
@@ -118,7 +118,7 @@
119119
120120 /**
121121 * Get the checks that can easily be treated by non-speakers of the language.
122 - * @return A list of the easy checks.
 122+ * @return Array A list of the easy checks.
123123 */
124124 protected function easyChecks() {
125125 return array(
Index: trunk/phase3/maintenance/language/languages.inc
@@ -205,7 +205,7 @@
206206 *
207207 * @param $code The language code.
208208 *
209 - * @return The messages in this language.
 209+ * @return string The messages in this language.
210210 */
211211 public function getMessages( $code ) {
212212 $this->loadMessages( $code );
Index: trunk/phase3/maintenance/deleteOrphanedRevisions.php
@@ -75,7 +75,7 @@
7676 * Do this inside a transaction
7777 *
7878 * @param $id Array of revision id values
79 - * @param $dbw Database class (needs to be a master)
 79+ * @param $dbw DatabaseBase class (needs to be a master)
8080 */
8181 private function deleteRevs( $id, &$dbw ) {
8282 if ( !is_array( $id ) )
Index: trunk/phase3/maintenance/fetchText.php
@@ -62,7 +62,7 @@
6363
6464 /**
6565 * May throw a database error if, say, the server dies during query.
66 - * @param $db Database object
 66+ * @param $db DatabaseBase object
6767 * @param $id int The old_id
6868 * @return String
6969 */

Comments

#Comment by IAlex (talk | contribs)   16:23, 31 March 2011

As stated on r84741, could you please use @param $varname type and not @param type $varname pending resolution of https://bugzilla.gnome.org/show_bug.cgi?id=613185 ? (That's for maintenance/language/rebuildLanguage.php)

Status & tagging log