From f3f180850a7f16297c8558ab73521843f1a1a628 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 9 Feb 2012 21:08:06 +0000 Subject: [PATCH] Fixing up undefined types in maintenance documentation --- maintenance/Maintenance.php | 10 +++--- maintenance/backup.inc | 2 +- maintenance/dumpTextPass.php | 2 ++ maintenance/findHooks.php | 4 +-- maintenance/fuzz-tester.php | 2 +- maintenance/generateSitemap.php | 2 +- maintenance/importImages.inc | 8 ++--- maintenance/language/checkLanguage.inc | 38 ++++++++++----------- maintenance/language/languages.inc | 12 +++---- maintenance/language/rebuildLanguage.php | 8 ++--- maintenance/language/writeMessagesArray.inc | 3 +- maintenance/locking/LockServerDaemon.php | 4 +-- maintenance/reassignEdits.php | 6 ++-- maintenance/rebuildLocalisationCache.php | 2 +- maintenance/refreshLinks.php | 4 +-- maintenance/removeUnusedAccounts.php | 2 +- maintenance/upgrade1_5.php | 6 ++-- maintenance/userOptions.inc | 2 +- 18 files changed, 59 insertions(+), 58 deletions(-) diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 082cf8beed..8640ce411b 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -366,7 +366,7 @@ abstract class Maintenance { * same channel are concatenated, but any intervening messages in another * channel start a new line. * @param $msg String: the message without trailing newline - * @param $channel Channel identifier or null for no + * @param $channel string Channel identifier or null for no * channel. Channel comparison uses ===. */ public function outputChanneled( $msg, $channel = null ) { @@ -1080,7 +1080,7 @@ abstract class Maintenance { /** * Lock the search index - * @param &$db Database object + * @param &$db DatabaseBase object */ private function lockSearchindex( &$db ) { $write = array( 'searchindex' ); @@ -1090,7 +1090,7 @@ abstract class Maintenance { /** * Unlock the tables - * @param &$db Database object + * @param &$db DatabaseBase object */ private function unlockSearchindex( &$db ) { $db->unlockTables( __CLASS__ . '::' . __METHOD__ ); @@ -1099,7 +1099,7 @@ abstract class Maintenance { /** * Unlock and lock again * Since the lock is low-priority, queued reads will be able to complete - * @param &$db Database object + * @param &$db DatabaseBase object */ private function relockSearchindex( &$db ) { $this->unlockSearchindex( $db ); @@ -1147,7 +1147,7 @@ abstract class Maintenance { /** * Update the searchindex table for a given pageid - * @param $dbw Database: a database write handle + * @param $dbw DatabaseBase a database write handle * @param $pageId Integer: the page ID to update. * @return null|string */ diff --git a/maintenance/backup.inc b/maintenance/backup.inc index 814d0c09d0..ce8f6940ab 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -262,7 +262,7 @@ class BackupDumper { // Discourage the server from disconnecting us if it takes a long time // to read out the big ol' batch query. - $db->setTimeout( 3600 * 24 ); + $db->setSessionOptions( array( 'connTimeout' => 3600 * 24 ) ); return $db; } diff --git a/maintenance/dumpTextPass.php b/maintenance/dumpTextPass.php index 0fed29fce8..c03f3df893 100644 --- a/maintenance/dumpTextPass.php +++ b/maintenance/dumpTextPass.php @@ -387,6 +387,8 @@ class TextPassDumper extends BackupDumper { * may not survive a long-term server outage. * * FIXME: WTF? Why is it using a loop and then returning unconditionally? + * @param $id int + * @return bool|string */ private function getTextDbSafe( $id ) { while ( true ) { diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index cb58285715..64410a76dc 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -157,7 +157,7 @@ class FindHooks extends Maintenance { /** * Get hooks from a PHP file - * @param $file Full filename to the PHP file. + * @param $file string Full filename to the PHP file. * @return array of hooks found. */ private function getHooksFromFile( $file ) { @@ -188,7 +188,7 @@ class FindHooks extends Maintenance { /** * Get bad hooks (where the hook name could not be determined) from a PHP file - * @param $file Full filename to the PHP file. + * @param $file string Full filename to the PHP file. * @return array of bad wfRunHooks() lines */ private function getBadHooksFromFile( $file ) { diff --git a/maintenance/fuzz-tester.php b/maintenance/fuzz-tester.php index d87d628153..216af37531 100644 --- a/maintenance/fuzz-tester.php +++ b/maintenance/fuzz-tester.php @@ -817,7 +817,7 @@ class wikiFuzz { * Returns the matched character slash-escaped as in a C string * Helper for makeTitleSafe callback * @param $matches - * @return atring + * @return string */ static private function stringEscape( $matches ) { return sprintf( "\\x%02x", ord( $matches[1] ) ); diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index 80d31f970f..8f19ef5d65 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -264,7 +264,7 @@ class GenerateSitemap extends Maintenance { * @return String */ function guessPriority( $namespace ) { - return MWNamespace::isMain( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK]; + return MWNamespace::isSubject( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK]; } /** diff --git a/maintenance/importImages.inc b/maintenance/importImages.inc index 5d35e2c02d..5eb68f20b3 100644 --- a/maintenance/importImages.inc +++ b/maintenance/importImages.inc @@ -26,7 +26,7 @@ /** * Search a directory for files with one of a set of extensions * - * @param $dir Path to directory to search + * @param $dir string Path to directory to search * @param $exts Array of extensions to search for * @return mixed Array of filenames on success, or false on failure */ @@ -74,9 +74,9 @@ function splitFilename( $filename ) { * files for acme.foo.bar and the extension ".txt". With $maxStrip = 2, * acme.txt would also be acceptable. * - * @param $file base path - * @param $auxExtension the extension to be appended to the base path - * @param $maxStrip the maximum number of extensions to strip from the base path (default: 1) + * @param $file string base path + * @param $auxExtension string the extension to be appended to the base path + * @param $maxStrip int the maximum number of extensions to strip from the base path (default: 1) * @return string or false */ function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) { diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 8ab6125bd9..a8cb5af890 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -41,7 +41,7 @@ class CheckLanguageCLI { /** * Constructor. - * @param $options Options for script. + * @param $options array Options for script. */ public function __construct( Array $options ) { if ( isset( $options['help'] ) ) { @@ -94,7 +94,7 @@ class CheckLanguageCLI { /** * Get the default checks. - * @return A list of the default checks. + * @return array A list of the default checks. */ protected function defaultChecks() { return array( @@ -107,7 +107,7 @@ class CheckLanguageCLI { /** * Get the checks which check other things than messages. - * @return A list of the non-message checks. + * @return array A list of the non-message checks. */ protected function nonMessageChecks() { return array( @@ -129,7 +129,7 @@ class CheckLanguageCLI { /** * Get all checks. - * @return An array of all check names mapped to their function names. + * @return array An array of all check names mapped to their function names. */ protected function getChecks() { return array( @@ -157,7 +157,7 @@ class CheckLanguageCLI { /** * Get total count for each check non-messages check. - * @return An array of all check names mapped to a two-element array: + * @return array An array of all check names mapped to a two-element array: * function name to get the total count and language code or null * for checked code. */ @@ -176,7 +176,7 @@ class CheckLanguageCLI { /** * Get all check descriptions. - * @return An array of all check names mapped to their descriptions. + * @return array An array of all check names mapped to their descriptions. */ protected function getDescriptions() { return array( @@ -204,7 +204,7 @@ class CheckLanguageCLI { /** * Get help. - * @return The help string. + * @return string The help string. */ protected function help() { return <<doLinks ) { @@ -355,7 +355,6 @@ ENDS; /** * Output the checks results as plain text. - * @return The checks results as plain text. */ protected function outputText() { foreach ( $this->results as $code => $results ) { @@ -401,7 +400,6 @@ ENDS; /** * Output the checks results as wiki text. - * @return The checks results as wiki text. */ function outputWiki() { global $wgContLang; @@ -462,7 +460,7 @@ EOL; /** * Check if there are any results for the checks, in any language. - * @return True if there are any results, false if not. + * @return bool True if there are any results, false if not. */ protected function isEmpty() { foreach( $this->results as $results ) { @@ -484,8 +482,8 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Constructor. - * @param $options Options for script. - * @param $extension The extension name (or names). + * @param $options array Options for script. + * @param $extension string The extension name (or names). */ public function __construct( Array $options, $extension ) { if ( isset( $options['help'] ) ) { @@ -569,7 +567,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the default checks. - * @return A list of the default checks. + * @return array A list of the default checks. */ protected function defaultChecks() { return array( @@ -580,7 +578,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the checks which check other things than messages. - * @return A list of the non-message checks. + * @return array A list of the non-message checks. */ protected function nonMessageChecks() { return array(); @@ -588,7 +586,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get the checks that can easily be treated by non-speakers of the language. - * @return A list of the easy checks. + * @return arrayA list of the easy checks. */ protected function easyChecks() { return array( @@ -598,7 +596,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { /** * Get help. - * @return The help string. + * @return string The help string. */ protected function help() { return <<loadFile( $code ); @@ -256,7 +256,7 @@ class languages { * * @param $code string The language code. * - * @return Namespace aliases. + * @return array Namespace aliases. */ public function getNamespaceAliases( $code ) { $this->loadFile( $code ); @@ -268,7 +268,7 @@ class languages { * * @param $code string The language code. * - * @return Magic words. + * @return array Magic words. */ public function getMagicWords( $code ) { $this->loadFile( $code ); @@ -280,7 +280,7 @@ class languages { * * @param $code string The language code. * - * @return Special page aliases. + * @return array Special page aliases. */ public function getSpecialPageAliases( $code ) { $this->loadFile( $code ); @@ -734,7 +734,7 @@ class extensionLanguages extends languages { /** * Load the messages group. - * @param $group The messages group. + * @param $group MessageGroup The messages group. */ function __construct( MessageGroup $group ) { $this->mMessageGroup = $group; diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php index 9b3a4b9d7f..643fc5f107 100644 --- a/maintenance/language/rebuildLanguage.php +++ b/maintenance/language/rebuildLanguage.php @@ -30,12 +30,12 @@ require_once( 'writeMessagesArray.inc' ); * Rewrite a messages array. * * @param $languages - * @param $code The language code. + * @param $code string The language code. * @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. + * @param $dupeMsgSource string The source file intended to remove from the array. */ function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) { $messages = $languages->getMessages( $code ); @@ -49,8 +49,8 @@ function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknow /** * Remove duplicates from a message array. * - * @param $oldMsgArray The input message array. - * @param $dupeMsgSource The source file path for duplicates. + * @param $oldMsgArray array The input message array. + * @param $dupeMsgSource string The source file path for duplicates. * @return Array $newMsgArray The output message array, with duplicates removed. */ function removeDupes( $oldMsgArray, $dupeMsgSource ) { diff --git a/maintenance/language/writeMessagesArray.inc b/maintenance/language/writeMessagesArray.inc index 524c2ba6fb..c5d13c9e87 100644 --- a/maintenance/language/writeMessagesArray.inc +++ b/maintenance/language/writeMessagesArray.inc @@ -156,6 +156,7 @@ class MessageWriter { * @param $messages Array: key of messages. * @param $ignored Array: list of ingored message keys. * @param $optional Array: list of optional message keys. + * @return array */ public static function makeComments( $messages, $ignored, $optional ) { # Comment collector @@ -181,7 +182,7 @@ class MessageWriter { * @param $messageComments Array: optional comments for messages in this block. * @param $prefix String: prefix for every line, for indenting purposes. * - * @return The block, formatted in PHP. + * @return string The block, formatted in PHP. */ public static function writeMessagesBlock( $blockComment, $messages, $messageComments = array(), $prefix = '' ) { diff --git a/maintenance/locking/LockServerDaemon.php b/maintenance/locking/LockServerDaemon.php index 1a4a928ea3..50b939cd11 100644 --- a/maintenance/locking/LockServerDaemon.php +++ b/maintenance/locking/LockServerDaemon.php @@ -258,7 +258,7 @@ class LockServerDaemon { * store it in the dead session tracking if it still has locks. * * @param $socket resource - * @return book + * @return bool */ protected function recordDeadSocket( $socket ) { $session = array_search( $socket, $this->sessions ); @@ -382,7 +382,7 @@ class SocketArray { /** * @param $sock resource - * @return string|false + * @return string|bool */ public function readRcvBuffer( $sock ) { $key = array_search( $sock, $this->clients ); diff --git a/maintenance/reassignEdits.php b/maintenance/reassignEdits.php index 3830fe382e..132d326d0d 100644 --- a/maintenance/reassignEdits.php +++ b/maintenance/reassignEdits.php @@ -62,8 +62,8 @@ class ReassignEdits extends Maintenance { * * @param $from User to take edits from * @param $to User to assign edits to - * @param $rc Update the recent changes table - * @param $report Don't change things; just echo numbers + * @param $rc bool Update the recent changes table + * @param $report bool Don't change things; just echo numbers * @return integer Number of entries changed, or that would be changed */ private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) { @@ -150,7 +150,7 @@ class ReassignEdits extends Maintenance { /** * Initialise the user object * - * @param $username Username or IP address + * @param $username string Username or IP address * @return User */ private function initialiseUser( $username ) { diff --git a/maintenance/rebuildLocalisationCache.php b/maintenance/rebuildLocalisationCache.php index 831d808ae6..ee3be9d16e 100644 --- a/maintenance/rebuildLocalisationCache.php +++ b/maintenance/rebuildLocalisationCache.php @@ -111,7 +111,7 @@ class RebuildLocalisationCache extends Maintenance { /** * Helper function to rebuild list of languages codes. Prints the code * for each language which is rebuilt. - * @param $codes list List of language codes to rebuild. + * @param $codes array List of language codes to rebuild. * @param $lc LocalisationCache Instance of LocalisationCache_BulkLoad (?) * @param $force bool Rebuild up-to-date languages * @return int Number of rebuilt languages diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index c16b6963be..41967d1ffd 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -230,8 +230,8 @@ class RefreshLinks extends Maintenance { * Removes non-existing links from pages from pagelinks, imagelinks, * categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables. * - * @param $maxLag - * @param $batchSize The size of deletion batches + * @param $maxLag int + * @param $batchSize int The size of deletion batches * * @author Merlijn van Deen */ diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index ba25efdd51..9c832e359a 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -86,7 +86,7 @@ class RemoveUnusedAccounts extends Maintenance { * (No edits, no deleted edits, no log entries, no current/old uploads) * * @param $id User's ID - * @param $master Perform checking on the master + * @param $master bool Perform checking on the master * @return bool */ private function isInactiveAccount( $id, $master = false ) { diff --git a/maintenance/upgrade1_5.php b/maintenance/upgrade1_5.php index 1577c23792..f0807b6df7 100644 --- a/maintenance/upgrade1_5.php +++ b/maintenance/upgrade1_5.php @@ -116,7 +116,7 @@ class FiveUpgrade extends Maintenance { /** * Open a connection to the master server with the admin rights. - * @return Database + * @return DatabaseBase * @access private */ function newConnection() { @@ -141,7 +141,7 @@ class FiveUpgrade extends Maintenance { * Open a second connection to the master server, with buffering off. * This will let us stream large datasets in and write in chunks on the * other end. - * @return Database + * @return DatabaseBase * @access private */ function streamConnection() { @@ -342,7 +342,7 @@ class FiveUpgrade extends Maintenance { * MW_UPGRADE_COPY - straight copy * MW_UPGRADE_ENCODE - for old Latin1 wikis, conv to UTF-8 * MW_UPGRADE_NULL - just put NULL - * @param callable $callback An optional callback to modify the data + * @param $callback callback An optional callback to modify the data * or perform other processing. Func should be * ( object $row, array $copy ) and return $copy * @access private diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index a6659fe754..5e3574798b 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -76,7 +76,7 @@ class userOptions { * @param $opts array * @param $args array * - * @return true + * @return bool */ private function initializeOpts( $opts, $args ) { -- 2.20.1