Fixing up undefined types in maintenance documentation
authorSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:08:06 +0000 (21:08 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 9 Feb 2012 21:08:06 +0000 (21:08 +0000)
18 files changed:
maintenance/Maintenance.php
maintenance/backup.inc
maintenance/dumpTextPass.php
maintenance/findHooks.php
maintenance/fuzz-tester.php
maintenance/generateSitemap.php
maintenance/importImages.inc
maintenance/language/checkLanguage.inc
maintenance/language/languages.inc
maintenance/language/rebuildLanguage.php
maintenance/language/writeMessagesArray.inc
maintenance/locking/LockServerDaemon.php
maintenance/reassignEdits.php
maintenance/rebuildLocalisationCache.php
maintenance/refreshLinks.php
maintenance/removeUnusedAccounts.php
maintenance/upgrade1_5.php
maintenance/userOptions.inc

index 082cf8b..8640ce4 100644 (file)
@@ -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
         */
index 814d0c0..ce8f694 100644 (file)
@@ -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;
        }
index 0fed29f..c03f3df 100644 (file)
@@ -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 ) {
index cb58285..64410a7 100644 (file)
@@ -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 ) {
index d87d628..216af37 100644 (file)
@@ -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] ) );
index 80d31f9..8f19ef5 100644 (file)
@@ -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];
        }
 
        /**
index 5d35e2c..5eb68f2 100644 (file)
@@ -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 ) {
index 8ab6125..a8cb5af 100644 (file)
@@ -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 <<<ENDS
@@ -295,7 +295,7 @@ ENDS;
 
        /**
         * Get the check blacklist.
-        * @return The list of checks which should not be executed.
+        * @return array The list of checks which should not be executed.
         */
        protected function getCheckBlacklist() {
                global $checkBlacklist;
@@ -336,9 +336,9 @@ ENDS;
 
        /**
         * Format a message key.
-        * @param $key The message key.
-        * @param $code The language code.
-        * @return The formatted message key.
+        * @param $key string The message key.
+        * @param $code string The language code.
+        * @return string The formatted message key.
         */
        protected function formatKey( $key, $code ) {
                if ( $this->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 <<<ENDS
index 06102ac..2b5c449 100644 (file)
@@ -43,7 +43,7 @@ class languages {
         * Load the list of languages: all the Messages*.php
         * files in the languages directory.
         *
-        * @param $exif Treat the EXIF messages?
+        * @param $exif bool Treat the EXIF messages?
         */
        function __construct( $exif = true ) {
                require( dirname(__FILE__) . '/messageTypes.inc' );
@@ -244,7 +244,7 @@ class languages {
         *
         * @param $code string The language code.
         *
-        * @return Namespace names.
+        * @return array Namespace names.
         */
        public function getNamespaceNames( $code ) {
                $this->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;
index 9b3a4b9..643fc5f 100644 (file)
@@ -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 ) {
index 524c2ba..c5d13c9 100644 (file)
@@ -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 = '' ) {
index 1a4a928..50b939c 100644 (file)
@@ -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 );
index 3830fe3..132d326 100644 (file)
@@ -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 ) {
index 831d808..ee3be9d 100644 (file)
@@ -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
index c16b696..41967d1 100644 (file)
@@ -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 <valhallasw@arctus.nl>
         */
index ba25efd..9c832e3 100644 (file)
@@ -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 ) {
index 1577c23..f0807b6 100644 (file)
@@ -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
index a6659fe..5e35747 100644 (file)
@@ -76,7 +76,7 @@ class userOptions {
         * @param $opts array
         * @param $args array
         *
-        * @return true
+        * @return bool
         */
        private function initializeOpts( $opts, $args ) {