Fixup/add documentation
authorSam Reed <reedy@users.mediawiki.org>
Wed, 30 Mar 2011 19:00:11 +0000 (19:00 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 30 Mar 2011 19:00:11 +0000 (19:00 +0000)
Remove some unused variables

12 files changed:
maintenance/Maintenance.php
maintenance/archives/upgradeLogging.php
maintenance/deleteOrphanedRevisions.php
maintenance/fetchText.php
maintenance/importUseModWikipedia.php
maintenance/language/checkLanguage.inc
maintenance/language/generateCollationData.php
maintenance/language/languages.inc
maintenance/language/rebuildLanguage.php
maintenance/orphans.php
maintenance/reassignEdits.php
maintenance/updateCollation.php

index 75d983c..c238b9c 100644 (file)
@@ -92,8 +92,12 @@ abstract class Maintenance {
        // Have we already loaded our user input?
        protected $mInputLoaded = false;
 
-       // Batch size. If a script supports this, they should set
-       // a default with setBatchSize()
+       /**
+        * Batch size. If a script supports this, they should set
+        * a default with setBatchSize()
+        *
+        * @var int
+        */
        protected $mBatchSize = null;
 
        // Generic options added by addDefaultParams()
@@ -1072,7 +1076,7 @@ abstract class Maintenance {
         * Perform a search index update with locking
         * @param $maxLockTime Integer: the maximum time to keep the search index locked.
         * @param $callback callback String: the function that will update the function.
-        * @param $dbw Database object
+        * @param $dbw DatabaseBase object
         * @param $results
         */
        public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
index 2ceb6c4..d920639 100644 (file)
 require( dirname( __FILE__ ) . '/../commandLine.inc' );
 
 class UpdateLogging {
+
+       /**
+        * @var DatabaseBase
+        */
        var $dbw;
        var $batchSize = 1000;
        var $minTs = false;
index e972d1f..c322320 100644 (file)
@@ -75,7 +75,7 @@ class DeleteOrphanedRevisions extends Maintenance {
         * Do this inside a transaction
         *
         * @param $id Array of revision id values
-        * @param $dbw Database class (needs to be a master)
+        * @param $dbw DatabaseBase class (needs to be a master)
         */
        private function deleteRevs( $id, &$dbw ) {
                if ( !is_array( $id ) )
index ea56535..198081f 100644 (file)
@@ -62,7 +62,7 @@ class FetchText extends Maintenance {
 
        /**
         * May throw a database error if, say, the server dies during query.
-        * @param $db Database object
+        * @param $db DatabaseBase object
         * @param $id int The old_id
         * @return String
         */
index a14c4f4..6092f34 100644 (file)
@@ -377,7 +377,6 @@ EOT
        }
 
        function revisionCallback( $params ) {
-               $origTitle = $params['title'];
                $title = $params['rctitle'];
                $editTime = $params['timestamp'];
 
index f18afde..1e4b94a 100644 (file)
@@ -118,7 +118,7 @@ class CheckLanguageCLI {
 
        /**
         * Get the checks that can easily be treated by non-speakers of the language.
-        * @return A list of the easy checks.
+        * @return Array A list of the easy checks.
         */
        protected function easyChecks() {
                return array(
index 6b0bd51..f1a58e6 100644 (file)
@@ -193,7 +193,7 @@ class GenerateCollationData extends Maintenance {
                // portion equal to the first character, then remove the second 
                // character. This avoids having characters like U+A732 (double A)
                // polluting the basic latin sort area.
-               $prevWeights = array();
+
                foreach ( $this->groups as $weight => $group ) {
                        if ( preg_match( '/(\.[0-9A-F]*)\./', $weight, $m ) ) {
                                if ( isset( $this->groups[$m[1]] ) ) {
index a5552dc..eb30864 100644 (file)
@@ -205,7 +205,7 @@ class languages {
         *
         * @param $code The language code.
         *
-        * @return The messages in this language.
+        * @return string The messages in this language.
         */
        public function getMessages( $code ) {
                $this->loadMessages( $code );
index e9fc0d4..9b3a4b9 100644 (file)
@@ -29,11 +29,12 @@ require_once( 'writeMessagesArray.inc' );
 /**
  * Rewrite a messages array.
  *
+ * @param $languages
  * @param $code The language code.
- * @param $write Write to the messages file?
- * @param $listUnknown List the unknown messages?
- * @param $removeUnknown Remove the unknown messages?
- * @param $removeDupes Remove the duplicated messages?
+ * @param bool $write Write to the messages file?
+ * @param bool $listUnknown List the unknown messages?
+ * @param bool $removeUnknown Remove the unknown messages?
+ * @param bool $removeDupes Remove the duplicated messages?
  * @param $dupeMsgSource The source file intended to remove from the array.
  */
 function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) {
@@ -50,7 +51,7 @@ function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknow
  *
  * @param $oldMsgArray The input message array.
  * @param $dupeMsgSource The source file path for duplicates.
- * @return $newMsgArray The output message array, with duplicates removed.
+ * @return Array $newMsgArray The output message array, with duplicates removed.
  */
 function removeDupes( $oldMsgArray, $dupeMsgSource ) {
        if ( file_exists( $dupeMsgSource ) ) {
index dbbddb9..1986ff3 100644 (file)
@@ -50,7 +50,7 @@ class Orphans extends Maintenance {
 
        /**
         * Lock the appropriate tables for the script
-        * @param $db Database object
+        * @param $db DatabaseBase object
         * @param $extraTable String The name of any extra tables to lock (eg: text)
         */
        private function lockTables( &$db, $extraTable = null ) {
index 039422b..bb34e51 100644 (file)
@@ -126,8 +126,8 @@ class ReassignEdits extends Maintenance {
         * i.e. a user => id mapping, or a user_text => text mapping
         *
         * @param $user User for the condition
-        * @param $idfield Field name containing the identifier
-        * @param $utfield Field name containing the user text
+        * @param $idfield string Field name containing the identifier
+        * @param $utfield string Field name containing the user text
         * @return array
         */
        private function userConditions( &$user, $idfield, $utfield ) {
index 2a01da4..01483a1 100644 (file)
@@ -88,7 +88,6 @@ TEXT;
                }
 
                $count = 0;
-               $row = false;
                $batchConds = array();
                do {
                        $this->output( 'Processing next ' . self::BATCH_SIZE . ' rows... ');