From: Sam Reed Date: Wed, 30 Mar 2011 19:00:11 +0000 (+0000) Subject: Fixup/add documentation X-Git-Tag: 1.31.0-rc.0~31117 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=commitdiff_plain;h=b88afb0daa43dcbe2619d6bef7cf86a3b7fdecaf;p=lhc%2Fweb%2Fwiklou.git Fixup/add documentation Remove some unused variables --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 75d983c5f0..c238b9c12e 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -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 ) { diff --git a/maintenance/archives/upgradeLogging.php b/maintenance/archives/upgradeLogging.php index 2ceb6c4f4e..d920639577 100644 --- a/maintenance/archives/upgradeLogging.php +++ b/maintenance/archives/upgradeLogging.php @@ -24,6 +24,10 @@ require( dirname( __FILE__ ) . '/../commandLine.inc' ); class UpdateLogging { + + /** + * @var DatabaseBase + */ var $dbw; var $batchSize = 1000; var $minTs = false; diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index e972d1fa12..c322320b01 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -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 ) ) diff --git a/maintenance/fetchText.php b/maintenance/fetchText.php index ea56535def..198081f595 100644 --- a/maintenance/fetchText.php +++ b/maintenance/fetchText.php @@ -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 */ diff --git a/maintenance/importUseModWikipedia.php b/maintenance/importUseModWikipedia.php index a14c4f4925..6092f34d75 100644 --- a/maintenance/importUseModWikipedia.php +++ b/maintenance/importUseModWikipedia.php @@ -377,7 +377,6 @@ EOT } function revisionCallback( $params ) { - $origTitle = $params['title']; $title = $params['rctitle']; $editTime = $params['timestamp']; diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index f18afdea16..1e4b94a2f6 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -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( diff --git a/maintenance/language/generateCollationData.php b/maintenance/language/generateCollationData.php index 6b0bd51e6b..f1a58e6f70 100644 --- a/maintenance/language/generateCollationData.php +++ b/maintenance/language/generateCollationData.php @@ -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]] ) ) { diff --git a/maintenance/language/languages.inc b/maintenance/language/languages.inc index a5552dcd4c..eb30864367 100644 --- a/maintenance/language/languages.inc +++ b/maintenance/language/languages.inc @@ -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 ); diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php index e9fc0d4490..9b3a4b9d7f 100644 --- a/maintenance/language/rebuildLanguage.php +++ b/maintenance/language/rebuildLanguage.php @@ -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 ) ) { diff --git a/maintenance/orphans.php b/maintenance/orphans.php index dbbddb9c46..1986ff350e 100644 --- a/maintenance/orphans.php +++ b/maintenance/orphans.php @@ -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 ) { diff --git a/maintenance/reassignEdits.php b/maintenance/reassignEdits.php index 039422b327..bb34e51c7b 100644 --- a/maintenance/reassignEdits.php +++ b/maintenance/reassignEdits.php @@ -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 ) { diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 2a01da412b..01483a1e97 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -88,7 +88,6 @@ TEXT; } $count = 0; - $row = false; $batchConds = array(); do { $this->output( 'Processing next ' . self::BATCH_SIZE . ' rows... ');