Merge "Fixed some @params documentation (includes/[Article|Pref|Skin].php)"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 23 Apr 2014 10:00:14 +0000 (10:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 23 Apr 2014 10:00:14 +0000 (10:00 +0000)
34 files changed:
includes/GlobalFunctions.php
includes/Title.php
includes/User.php
languages/i18n/en.json
maintenance/compareParsers.php
maintenance/convertLinks.php
maintenance/createAndPromote.php
maintenance/deleteArchivedRevisions.php
maintenance/deleteBatch.php
maintenance/deleteImageMemcached.php
maintenance/deleteOrphanedRevisions.php
maintenance/deleteRevision.php
maintenance/doMaintenance.php
maintenance/dumpIterator.php
maintenance/findHooks.php
maintenance/fixDoubleRedirects.php
maintenance/fixExtLinksProtocolRelative.php
maintenance/fixSlaveDesync.php
maintenance/fixTimestamps.php
maintenance/fixUserRegistration.php
maintenance/generateSitemap.php
maintenance/getText.php
maintenance/importDump.php
maintenance/importImages.inc
maintenance/importImages.php
maintenance/initSiteStats.php
maintenance/install.php
maintenance/lag.php
maintenance/mergeMessageFileList.php
maintenance/moveBatch.php
maintenance/orphans.php
maintenance/parse.php
maintenance/patchSql.php
maintenance/populateCategory.php

index b132826..d94d2f1 100644 (file)
@@ -108,8 +108,8 @@ if ( !function_exists( 'gzdecode' ) ) {
 
 /**
  * Like array_diff( $a, $b ) except that it works with two-dimensional arrays.
- * @param $a array
- * @param $b array
+ * @param array $a
+ * @param array $b
  * @return array
  */
 function wfArrayDiff2( $a, $b ) {
@@ -117,8 +117,8 @@ function wfArrayDiff2( $a, $b ) {
 }
 
 /**
- * @param $a array|string
- * @param $b array|string
+ * @param array|string $a
+ * @param array|string $b
  * @return int
  */
 function wfArrayDiff2_cmp( $a, $b ) {
@@ -145,8 +145,8 @@ function wfArrayDiff2_cmp( $a, $b ) {
  * values in array $a with the corresponding keys
  *
  * @deprecated since 1.22; use array_intersect_key()
- * @param $a Array
- * @param $b Array
+ * @param array $a
+ * @param array $b
  * @return array
  */
 function wfArrayLookup( $a, $b ) {
@@ -157,10 +157,10 @@ function wfArrayLookup( $a, $b ) {
 /**
  * Appends to second array if $value differs from that in $default
  *
- * @param $key String|Int
- * @param $value Mixed
- * @param $default Mixed
- * @param array $changed to alter
+ * @param string|int $key
+ * @param mixed $value
+ * @param mixed $default
+ * @param array $changed Array to alter
  * @throws MWException
  */
 function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
@@ -231,8 +231,8 @@ function wfMergeErrorArrays( /*...*/ ) {
  *
  * @param array $array The array.
  * @param array $insert The array to insert.
- * @param $after Mixed: The key to insert after
- * @return Array
+ * @param mixed $after The key to insert after
+ * @return array
  */
 function wfArrayInsertAfter( array $array, array $insert, $after ) {
        // Find the offset of the element to insert after.
@@ -253,9 +253,9 @@ function wfArrayInsertAfter( array $array, array $insert, $after ) {
 /**
  * Recursively converts the parameter (an object) to an array with the same data
  *
- * @param $objOrArray Object|Array
- * @param $recursive Bool
- * @return Array
+ * @param object|array $objOrArray
+ * @param bool $recursive
+ * @return array
  */
 function wfObjectToArray( $objOrArray, $recursive = true ) {
        $array = array();
@@ -296,7 +296,7 @@ function wfRandom() {
  *       of token please use MWCryptRand instead.
  *
  * @param int $length The length of the string to generate
- * @return String
+ * @return string
  * @since 1.20
  */
 function wfRandomString( $length = 32 ) {
@@ -326,7 +326,7 @@ function wfRandomString( $length = 32 ) {
  *
  * %2F in the page titles seems to fatally break for some reason.
  *
- * @param $s String:
+ * @param string $s
  * @return string
  */
 function wfUrlencode( $s ) {
@@ -363,8 +363,8 @@ function wfUrlencode( $s ) {
  *
  * @param array $array1 ( String|Array )
  * @param array $array2 ( String|Array )
- * @param $prefix String
- * @return String
+ * @param string $prefix
+ * @return string
  */
 function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
        if ( !is_null( $array2 ) ) {
@@ -408,7 +408,7 @@ function wfArrayToCgi( $array1, $array2 = null, $prefix = '' ) {
  * with legacy functions that accept raw query strings instead of nice
  * arrays.  Of course, keys and values are urldecode()d.
  *
- * @param string $query query string
+ * @param string $query Query string
  * @return string[] Array version of input
  */
 function wfCgiToArray( $query ) {
@@ -490,8 +490,8 @@ function wfAppendQuery( $url, $query ) {
  * @todo this won't work with current-path-relative URLs
  * like "subdir/foo.html", etc.
  *
- * @param string $url either fully-qualified or a local path + query
- * @param $defaultProto Mixed: one of the PROTO_* constants. Determines the
+ * @param string $url Either fully-qualified or a local path + query
+ * @param string $defaultProto One of the PROTO_* constants. Determines the
  *    protocol to use if $url or $wgServer is protocol-relative
  * @return string Fully-qualified URL, current-path-relative URL or false if
  *    no valid URL can be constructed
@@ -692,7 +692,7 @@ function wfRemoveDotSegments( $urlPath ) {
  *
  * @param bool $includeProtocolRelative If false, remove '//' from the returned protocol list.
  *        DO NOT USE this directly, use wfUrlProtocolsWithoutProtRel() instead
- * @return String
+ * @return string
  */
 function wfUrlProtocols( $includeProtocolRelative = true ) {
        global $wgUrlProtocols;
@@ -737,7 +737,7 @@ function wfUrlProtocols( $includeProtocolRelative = true ) {
  * Like wfUrlProtocols(), but excludes '//' from the protocol list. Use this if
  * you need a regex that matches all URL protocols but does not match protocol-
  * relative URLs
- * @return String
+ * @return string
  */
 function wfUrlProtocolsWithoutProtRel() {
        return wfUrlProtocols( false );
@@ -751,7 +751,7 @@ function wfUrlProtocolsWithoutProtRel() {
  *    protocol-relative URLs) correctly.
  * 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2)).
  *
- * @param string $url a URL to parse
+ * @param string $url A URL to parse
  * @return string[] Bits of the URL in an associative array, per PHP docs
  */
 function wfParseUrl( $url ) {
@@ -821,7 +821,7 @@ function wfParseUrl( $url ) {
  *
  * @todo handle punycode domains too
  *
- * @param $url string
+ * @param string $url
  * @return string
  */
 function wfExpandIRI( $url ) {
@@ -844,7 +844,7 @@ function wfExpandIRI_callback( $matches ) {
 /**
  * Make URL indexes, appropriate for the el_index field of externallinks.
  *
- * @param $url String
+ * @param string $url
  * @return array
  */
 function wfMakeUrlIndexes( $url ) {
@@ -924,7 +924,7 @@ function wfMatchesDomainList( $url, $domains ) {
  * $wgDebugRawPage - if false, 'action=raw' hits will not result in debug output.
  * $wgDebugComments - if on, some debug items may appear in comments in the HTML output.
  *
- * @param $text String
+ * @param string $text
  * @param string|bool $dest Destination of the message:
  *     - 'all': both to the log and HTML (debug toolbar or HTML comments)
  *     - 'log': only to the log and not in HTML
@@ -1007,7 +1007,7 @@ function wfDebugTimer() {
 /**
  * Send a line giving PHP memory usage.
  *
- * @param bool $exact print exact values instead of kilobytes (default: false)
+ * @param bool $exact Print exact values instead of kilobytes (default: false)
  */
 function wfDebugMem( $exact = false ) {
        $mem = memory_get_usage();
@@ -1084,7 +1084,7 @@ function wfDebugLog( $logGroup, $text, $dest = 'all' ) {
 /**
  * Log for database errors
  *
- * @param string $text database error message.
+ * @param string $text Database error message.
  */
 function wfLogDBError( $text ) {
        global $wgDBerrorLog, $wgDBerrorLogTZ;
@@ -1116,11 +1116,11 @@ function wfLogDBError( $text ) {
 /**
  * Throws a warning that $function is deprecated
  *
- * @param $function String
+ * @param string $function
  * @param string|bool $version Version of MediaWiki that the function
  *    was deprecated in (Added in 1.19).
  * @param string|bool $component Added in 1.19.
- * @param $callerOffset integer: How far up the call stack is the original
+ * @param int $callerOffset How far up the call stack is the original
  *    caller. 2 = function that called the function that called
  *    wfDeprecated (Added in 1.20)
  *
@@ -1135,9 +1135,9 @@ function wfDeprecated( $function, $version = false, $component = false, $callerO
  * $wgDevelopmentWarnings. To log warnings in production, use wfLogWarning() instead.
  *
  * @param string $msg message to send
- * @param $callerOffset Integer: number of items to go back in the backtrace to
+ * @param int $callerOffset Number of items to go back in the backtrace to
  *        find the correct caller (1 = function calling wfWarn, ...)
- * @param $level Integer: PHP error level; defaults to E_USER_NOTICE;
+ * @param int $level PHP error level; defaults to E_USER_NOTICE;
  *        only used when $wgDevelopmentWarnings is true
  */
 function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
@@ -1148,10 +1148,10 @@ function wfWarn( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
  * Send a warning as a PHP error and the debug log. This is intended for logging
  * warnings in production. For logging development warnings, use WfWarn instead.
  *
- * @param $msg String: message to send
- * @param $callerOffset Integer: number of items to go back in the backtrace to
+ * @param string $msg Message to send
+ * @param int $callerOffset Number of items to go back in the backtrace to
  *        find the correct caller (1 = function calling wfLogWarning, ...)
- * @param $level Integer: PHP error level; defaults to E_USER_WARNING
+ * @param int $level PHP error level; defaults to E_USER_WARNING
  */
 function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) {
        MWDebug::warning( $msg, $callerOffset + 1, $level, 'production' );
@@ -1163,8 +1163,8 @@ function wfLogWarning( $msg, $callerOffset = 1, $level = E_USER_WARNING ) {
  * Can also log to TCP or UDP with the syntax udp://host:port/prefix. This will
  * send lines to the specified port, prefixed by the specified prefix and a space.
  *
- * @param $text String
- * @param string $file filename
+ * @param string $text
+ * @param string $file Filename
  * @throws MWException
  */
 function wfErrorLog( $text, $file ) {
@@ -1299,8 +1299,8 @@ function wfLogProfilingData() {
 /**
  * Increment a statistics counter
  *
- * @param $key String
- * @param $count Int
+ * @param string $key
+ * @param int $count
  * @return void
  */
 function wfIncrStats( $key, $count = 1 ) {
@@ -1319,7 +1319,7 @@ function wfReadOnly() {
 /**
  * Get the value of $wgReadOnly or the contents of $wgReadOnlyFile.
  *
- * @return string|bool: String when in read-only mode; false otherwise
+ * @return string|bool String when in read-only mode; false otherwise
  */
 function wfReadOnlyReason() {
        global $wgReadOnly, $wgReadOnlyFile;
@@ -1339,7 +1339,7 @@ function wfReadOnlyReason() {
 /**
  * Return a Language object from $langcode
  *
- * @param $langcode Mixed: either:
+ * @param Language|string|bool $langcode Either:
  *                  - a Language object
  *                  - code of the language to get the message for, if it is
  *                    a valid code create a language for that language, if
@@ -1349,7 +1349,7 @@ function wfReadOnlyReason() {
  *                    the current user's language (as a fallback for the old parameter
  *                    functionality), or if it is true then use global object
  *                    for the wiki's content language.
- * @return Language object
+ * @return Language
  */
 function wfGetLangObj( $langcode = false ) {
        # Identify which language to get or create a language object for.
@@ -1443,7 +1443,7 @@ function wfMessageFallback( /*...*/ ) {
  * - As an array in the second parameter
  * These are not shown in the function definition.
  *
- * @return String
+ * @return string
  */
 function wfMsg( $key ) {
        wfDeprecated( __METHOD__, '1.21' );
@@ -1458,8 +1458,8 @@ function wfMsg( $key ) {
  *
  * @deprecated since 1.18
  *
- * @param $key String
- * @return String
+ * @param string $key
+ * @return string
  */
 function wfMsgNoTrans( $key ) {
        wfDeprecated( __METHOD__, '1.21' );
@@ -1490,9 +1490,9 @@ function wfMsgNoTrans( $key ) {
  *
  * @deprecated since 1.18
  *
- * @param string $key lookup key for the message, usually
+ * @param string $key Lookup key for the message, usually
  *     defined in languages/Language.php
- * @return String
+ * @return string
  */
 function wfMsgForContent( $key ) {
        wfDeprecated( __METHOD__, '1.21' );
@@ -1514,8 +1514,8 @@ function wfMsgForContent( $key ) {
  *
  * @deprecated since 1.18
  *
- * @param $key String
- * @return String
+ * @param string $key
+ * @return string
  */
 function wfMsgForContentNoTrans( $key ) {
        wfDeprecated( __METHOD__, '1.21' );
@@ -1537,7 +1537,7 @@ function wfMsgForContentNoTrans( $key ) {
  *
  * @deprecated since 1.18
  *
- * @param string $key key to get.
+ * @param string $key Key to get.
  * @param array $args
  * @param bool $useDB
  * @param string|bool $forContent Language code, or false for user lang, true for content lang.
@@ -1562,7 +1562,7 @@ function wfMsgReal( $key, $args, $useDB = true, $forContent = false, $transform
  * @param string $key
  * @param bool $useDB
  * @param string|bool $langCode Code of the language to get the message for, or
- *                  behaves as a content language switch if it is a boolean.
+ *   behaves as a content language switch if it is a boolean.
  * @param bool $transform Whether to parse magic words, etc.
  * @return string
  */
@@ -1659,8 +1659,8 @@ function wfMsgWikiHtml( $key ) {
  *
  * @deprecated since 1.18
  *
- * @param string $key key of the message
- * @param array $options processing rules.
+ * @param string $key Key of the message
+ * @param array $options Processing rules.
  *   Can take the following options:
  *     parse: parses wikitext to HTML
  *     parseinline: parses wikitext to HTML and removes the surrounding
@@ -1675,7 +1675,7 @@ function wfMsgWikiHtml( $key ) {
  *       (overridden by content).
  * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
  *
- * @return String
+ * @return string
  */
 function wfMsgExt( $key, $options ) {
        wfDeprecated( __METHOD__, '1.21' );
@@ -1770,7 +1770,7 @@ function wfEmptyMsg( $key ) {
  * but now throws an exception instead, with similar results.
  *
  * @deprecated since 1.22; just throw an MWException yourself
- * @param string $msg message shown when dying.
+ * @param string $msg Message shown when dying.
  * @throws MWException
  */
 function wfDebugDieBacktrace( $msg = '' ) {
@@ -1849,7 +1849,7 @@ function wfReportTime() {
  *
  * @param int $limit This parameter can be used to limit the number of stack frames returned
  *
- * @return array of backtrace information
+ * @return array Array of backtrace information
  */
 function wfDebugBacktrace( $limit = 0 ) {
        static $disabled = null;
@@ -1937,7 +1937,7 @@ function wfBacktrace() {
  * wfGetCaller( 2 ) [default] is the caller of the function running wfGetCaller()
  * wfGetCaller( 3 ) is the parent of that.
  *
- * @param $level Int
+ * @param int $level
  * @return string
  */
 function wfGetCaller( $level = 2 ) {
@@ -1953,9 +1953,8 @@ function wfGetCaller( $level = 2 ) {
  * Return a string consisting of callers in the stack. Useful sometimes
  * for profiling specific points.
  *
- * @param int $limit The maximum depth of the stack frame to return, or false for
- *               the entire stack.
- * @return String
+ * @param int $limit The maximum depth of the stack frame to return, or false for the entire stack.
+ * @return string
  */
 function wfGetAllCallers( $limit = 3 ) {
        $trace = array_reverse( wfDebugBacktrace() );
@@ -1969,7 +1968,7 @@ function wfGetAllCallers( $limit = 3 ) {
 /**
  * Return a string representation of frame
  *
- * @param $frame Array
+ * @param array $frame
  * @return string
  */
 function wfFormatStackFrame( $frame ) {
@@ -1997,8 +1996,8 @@ function wfShowingResults( $offset, $limit ) {
  * @param string $offset
  * @param int $limit
  * @param string $link
- * @param string $query optional URL query parameter string
- * @param bool $atend optional param for specified if this is the last page
+ * @param string $query Optional URL query parameter string
+ * @param bool $atend Optional param for specified if this is the last page
  * @return string
  * @deprecated since 1.19; use Language::viewPrevNext() instead
  */
@@ -2057,10 +2056,9 @@ function wfClientAcceptsGzip( $force = false ) {
  * Obtain the offset and limit values from the request string;
  * used in special pages
  *
- * @param int $deflimit default limit if none supplied
+ * @param int $deflimit Default limit if none supplied
  * @param string $optionname Name of a user preference to check against
  * @return array
- *
  */
 function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) {
        global $wgRequest;
@@ -2073,8 +2071,8 @@ function wfCheckLimits( $deflimit = 50, $optionname = 'rclimit' ) {
  * is achieved by substituting certain characters with HTML entities.
  * As required by the callers, "<nowiki>" is not used.
  *
- * @param string $text text to be escaped
- * @return String
+ * @param string $text Text to be escaped
+ * @return string
  */
 function wfEscapeWikiText( $text ) {
        static $repl = null, $repl2 = null;
@@ -2121,7 +2119,7 @@ function wfEscapeWikiText( $text ) {
 /**
  * Get the current unix timestamp with microseconds.  Useful for profiling
  * @deprecated since 1.22; call microtime() directly
- * @return Float
+ * @return float
  */
 function wfTime() {
        wfDeprecated( __FUNCTION__, '1.22' );
@@ -2133,10 +2131,10 @@ function wfTime() {
  * If source is NULL, it just returns the value, it doesn't set the variable
  * If force is true, it will set the value even if source is NULL
  *
- * @param $dest Mixed
- * @param $source Mixed
- * @param $force Bool
- * @return Mixed
+ * @param mixed $dest
+ * @param mixed $source
+ * @param bool $force
+ * @return mixed
  */
 function wfSetVar( &$dest, $source, $force = false ) {
        $temp = $dest;
@@ -2149,9 +2147,9 @@ function wfSetVar( &$dest, $source, $force = false ) {
 /**
  * As for wfSetVar except setting a bit
  *
- * @param $dest Int
- * @param $bit Int
- * @param $state Bool
+ * @param int $dest
+ * @param int $bit
+ * @param bool $state
  *
  * @return bool
  */
@@ -2171,7 +2169,7 @@ function wfSetBit( &$dest, $bit, $state = true ) {
  * A wrapper around the PHP function var_export().
  * Either print it or add it to the regular output ($wgOut).
  *
- * @param $var mixed A PHP variable to dump.
+ * @param mixed $var A PHP variable to dump.
  */
 function wfVarDump( $var ) {
        global $wgOut;
@@ -2186,9 +2184,9 @@ function wfVarDump( $var ) {
 /**
  * Provide a simple HTTP error.
  *
- * @param $code Int|String
- * @param $label String
- * @param $desc String
+ * @param int|string $code
+ * @param string $label
+ * @param string $desc
  */
 function wfHttpError( $code, $label, $desc ) {
        global $wgOut;
@@ -2223,7 +2221,7 @@ function wfHttpError( $code, $label, $desc ) {
  * Note that some PHP configuration options may add output buffer
  * layers which cannot be removed; these are left in place.
  *
- * @param $resetGzipEncoding Bool
+ * @param bool $resetGzipEncoding
  */
 function wfResetOutputBuffers( $resetGzipEncoding = true ) {
        if ( $resetGzipEncoding ) {
@@ -2338,8 +2336,8 @@ function mimeTypeMatch( $type, $avail ) {
  * array of type to preference (preference is a float between 0.0 and 1.0).
  * Wildcards in the types are acceptable.
  *
- * @param array $cprefs client's acceptable type list
- * @param array $sprefs server's offered types
+ * @param array $cprefs Client's acceptable type list
+ * @param array $sprefs Server's offered types
  * @return string
  *
  * @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
@@ -2384,7 +2382,7 @@ function wfNegotiateType( $cprefs, $sprefs ) {
 /**
  * Reference-counted warning suppression
  *
- * @param $end Bool
+ * @param bool $end
  */
 function wfSuppressWarnings( $end = false ) {
        static $suppressCount = 0;
@@ -2476,11 +2474,10 @@ define( 'TS_ISO_8601_BASIC', 9 );
 /**
  * Get a timestamp string in one of various formats
  *
- * @param $outputtype Mixed: A timestamp in one of the supported formats, the
- *                    function will autodetect which format is supplied and act
- *                    accordingly.
- * @param $ts Mixed: optional timestamp to convert, default 0 for the current time
- * @return Mixed: String / false The same date in the format specified in $outputtype or false
+ * @param mixed $outputtype A timestamp in one of the supported formats, the
+ *   function will autodetect which format is supplied and act accordingly.
+ * @param mixed $ts Optional timestamp to convert, default 0 for the current time
+ * @return string|bool String / false The same date in the format specified in $outputtype or false
  */
 function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) {
        try {
@@ -2583,9 +2580,9 @@ function wfTempDir() {
 /**
  * Make directory, and make all parent directories if they don't exist
  *
- * @param string $dir full path to directory to create
+ * @param string $dir Full path to directory to create
  * @param int $mode Chmod value to use, default is $wgDirectoryMode
- * @param string $caller optional caller param for debugging.
+ * @param string $caller Optional caller param for debugging.
  * @throws MWException
  * @return bool
  */
@@ -2630,6 +2627,7 @@ function wfMkdirParents( $dir, $mode = null, $caller = null ) {
 /**
  * Remove a directory and all its content.
  * Does not hide error.
+ * @param string $dir
  */
 function wfRecursiveRemoveDir( $dir ) {
        wfDebug( __FUNCTION__ . "( $dir )\n" );
@@ -2651,7 +2649,7 @@ function wfRecursiveRemoveDir( $dir ) {
 }
 
 /**
- * @param number $nr The number to format
+ * @param int $nr The number to format
  * @param int $acc The number of digits after the decimal point, default 2
  * @param bool $round Whether or not to round the value, default true
  * @return string
@@ -2790,18 +2788,18 @@ function wfShellExecDisabled() {
  * configuration if supported.
  *
  * @param string $cmd Command line, properly escaped for shell.
- * @param &$retval null|Mixed optional, will receive the program's exit code.
- *                 (non-zero is usually failure). If there is an error from
- *                 read, select, or proc_open(), this will be set to -1.
- * @param array $environ optional environment variables which should be
- *                 added to the executed command environment.
- * @param array $limits optional array with limits(filesize, memory, time, walltime)
- *                 this overwrites the global wgMaxShell* limits.
+ * @param null|mixed &$retval Optional, will receive the program's exit code.
+ *   (non-zero is usually failure). If there is an error from
+ *   read, select, or proc_open(), this will be set to -1.
+ * @param array $environ Optional environment variables which should be
+ *   added to the executed command environment.
+ * @param array $limits Optional array with limits(filesize, memory, time, walltime)
+ *   this overwrites the global wgMaxShell* limits.
  * @param array $options Array of options:
- *    - duplicateStderr: Set this to true to duplicate stderr to stdout,
- *      including errors from limit.sh
+ *   - duplicateStderr: Set this to true to duplicate stderr to stdout,
+ *     including errors from limit.sh
  *
- * @return string collected stdout as a string
+ * @return string Collected stdout as a string
  */
 function wfShellExec( $cmd, &$retval = null, $environ = array(),
        $limits = array(), $options = array()
@@ -3011,13 +3009,13 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(),
  *
  * @note This also includes errors from limit.sh, e.g. if $wgMaxShellFileSize is exceeded.
  * @param string $cmd Command line, properly escaped for shell.
- * @param &$retval null|Mixed optional, will receive the program's exit code.
- *                 (non-zero is usually failure)
+ * @param null|mixed &$retval Optional, will receive the program's exit code.
+ *   (non-zero is usually failure)
  * @param array $environ optional environment variables which should be
- *                 added to the executed command environment.
- * @param array $limits optional array with limits(filesize, memory, time, walltime)
- *                 this overwrites the global wgShellMax* limits.
- * @return string collected stdout and stderr as a string
+ *   added to the executed command environment.
+ * @param array $limits Optional array with limits(filesize, memory, time, walltime)
+ *   this overwrites the global wgShellMax* limits.
+ * @return string Collected stdout and stderr as a string
  */
 function wfShellExecWithStderr( $cmd, &$retval = null, $environ = array(), $limits = array() ) {
        return wfShellExec( $cmd, $retval, $environ, $limits, array( 'duplicateStderr' => true ) );
@@ -3158,9 +3156,9 @@ function wfMerge( $old, $mine, $yours, &$result ) {
  * Returns unified plain-text diff of two texts.
  * Useful for machine processing of diffs.
  *
- * @param string $before the text before the changes.
- * @param string $after the text after the changes.
- * @param string $params command-line options for the diff command.
+ * @param string $before The text before the changes.
+ * @param string $after The text after the changes.
+ * @param string $params Command-line options for the diff command.
  * @return string Unified diff of $before and $after
  */
 function wfDiff( $before, $after, $params = '-u' ) {
@@ -3238,8 +3236,7 @@ function wfDiff( $before, $after, $params = '-u' ) {
  *
  * @see perldoc -f use
  *
- * @param string|number $req_ver The version to check, can be a string, an integer, or
- *                 a float
+ * @param string|int|float $req_ver The version to check, can be a string, an integer, or a float
  * @throws MWException
  */
 function wfUsePHP( $req_ver ) {
@@ -3268,8 +3265,7 @@ function wfUsePHP( $req_ver ) {
  *
  * @see perldoc -f use
  *
- * @param string|number $req_ver The version to check, can be a string, an integer, or
- *                 a float
+ * @param string|int|float $req_ver The version to check, can be a string, an integer, or a float
  * @throws MWException
  */
 function wfUseMW( $req_ver ) {
@@ -3289,7 +3285,7 @@ function wfUseMW( $req_ver ) {
  * We'll consider it so always, as we don't want '\s' in our Unix paths either.
  *
  * @param string $path
- * @param string $suffix to remove if present
+ * @param string $suffix String to remove if present
  * @return string
  */
 function wfBaseName( $path, $suffix = '' ) {
@@ -3312,7 +3308,7 @@ function wfBaseName( $path, $suffix = '' ) {
  * May explode on non-matching case-insensitive paths,
  * funky symlinks, etc.
  *
- * @param string $path absolute destination path including target filename
+ * @param string $path Absolute destination path including target filename
  * @param string $from Absolute source path, directory only
  * @return string
  */
@@ -3690,7 +3686,7 @@ function &wfGetLBFactory() {
  *
  *     bypassCache:    If true, do not use the process-local cache of File objects
  *
- * @return File, or false if the file does not exist
+ * @return File|bool File, or false if the file does not exist
  */
 function wfFindFile( $title, $options = array() ) {
        return RepoGroup::singleton()->findFile( $title, $options );
@@ -3726,7 +3722,7 @@ function wfQueriesMustScale() {
  * extensions; this is a wrapper around $wgScriptExtension etc.
  * except for 'index' and 'load' which use $wgScript/$wgLoadScript
  *
- * @param string $script script filename, sans extension
+ * @param string $script Script filename, sans extension
  * @return string
  */
 function wfScript( $script = 'index' ) {
@@ -3944,7 +3940,7 @@ function wfBCP47( $code ) {
 /**
  * Get a cache object.
  *
- * @param $inputType integer Cache type, one the the CACHE_* constants.
+ * @param int $inputType Cache type, one the the CACHE_* constants.
  * @return BagOStuff
  */
 function wfGetCache( $inputType ) {
@@ -3994,9 +3990,9 @@ function wfGetLangConverterCacheStorage() {
 /**
  * Call hook functions defined in $wgHooks
  *
- * @param string $event event name
- * @param array $args parameters passed to hook functions
- * @param string|null $deprecatedVersion optionally mark hook as deprecated with version number
+ * @param string $event Event name
+ * @param array $args Parameters passed to hook functions
+ * @param string|null $deprecatedVersion Optionally mark hook as deprecated with version number
  *
  * @return bool True if no handler aborted the hook
  */
@@ -4049,9 +4045,9 @@ function wfUnpack( $format, $data, $length = false ) {
  *    * Any subsequent links on the same line are considered to be exceptions,
  *      i.e. articles where the image may occur inline.
  *
- * @param string $name the image name to check
+ * @param string $name The image name to check
  * @param Title|bool $contextTitle The page on which the image occurs, if known
- * @param string $blacklist wikitext of a file blacklist
+ * @param string $blacklist Wikitext of a file blacklist
  * @return bool
  */
 function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
@@ -4126,7 +4122,7 @@ function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
  * access the wiki via HTTPS.
  *
  * @param string $ip The IPv4/6 address in the normal human-readable form
- * @return boolean
+ * @return bool
  */
 function wfCanIPUseHTTPS( $ip ) {
        $canDo = true;
index 54a0839..c7069ad 100644 (file)
@@ -144,10 +144,10 @@ class Title {
        /**
         * Create a new Title from a prefixed DB key
         *
-        * @param string $key the database key, which has underscores
+        * @param string $key The database key, which has underscores
         *      instead of spaces, possibly including namespace and
         *      interwiki prefixes
-        * @return Title, or NULL on an error
+        * @return Title|null Title, or NULL on an error
         */
        public static function newFromDBkey( $key ) {
                $t = new Title();
@@ -162,7 +162,7 @@ class Title {
        /**
         * Create a new Title from a TitleValue
         *
-        * @param TitleValue $titleValue, assumed to be safe.
+        * @param TitleValue $titleValue Assumed to be safe.
         *
         * @return Title
         */
@@ -177,14 +177,14 @@ class Title {
         * Create a new Title from text, such as what one would find in a link. De-
         * codes any HTML entities in the text.
         *
-        * @param string $text the link text; spaces, prefixes, and an
+        * @param string $text The link text; spaces, prefixes, and an
         *   initial ':' indicating the main namespace are accepted.
-        * @param int $defaultNamespace the namespace to use if none is specified
+        * @param int $defaultNamespace The namespace to use if none is specified
         *   by a prefix.  If you want to force a specific namespace even if
         *   $text might begin with a namespace prefix, use makeTitle() or
         *   makeTitleSafe().
         * @throws MWException
-        * @return Title|null Title or null on an error.
+        * @return Title|null Title or null on an error.
         */
        public static function newFromText( $text, $defaultNamespace = NS_MAIN ) {
                if ( is_object( $text ) ) {
@@ -235,8 +235,8 @@ class Title {
         * Create a new Title from URL-encoded text. Ensures that
         * the given title's length does not exceed the maximum.
         *
-        * @param string $url the title, as might be taken from a URL
-        * @return Title the new object, or NULL on an error
+        * @param string $url The title, as might be taken from a URL
+        * @return Title|null The new object, or null on an error
         */
        public static function newFromURL( $url ) {
                $t = new Title();
@@ -290,9 +290,9 @@ class Title {
        /**
         * Create a new Title from an article ID
         *
-        * @param int $id the page_id corresponding to the Title to create
-        * @param int $flags use Title::GAID_FOR_UPDATE to use master
-        * @return Title|null the new object, or NULL on an error
+        * @param int $id The page_id corresponding to the Title to create
+        * @param int $flags Use Title::GAID_FOR_UPDATE to use master
+        * @return Title|null The new object, or NULL on an error
         */
        public static function newFromID( $id, $flags = 0 ) {
                $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
@@ -313,8 +313,8 @@ class Title {
        /**
         * Make an array of titles from an array of IDs
         *
-        * @param array $ids of Int Array of IDs
-        * @return Array of Titles
+        * @param array $ids Array of IDs
+        * @return array Array of Titles
         */
        public static function newFromIDs( $ids ) {
                if ( !count( $ids ) ) {
@@ -340,7 +340,7 @@ class Title {
         * Make a Title object from a DB row
         *
         * @param stdClass $row Object database row (needs at least page_title,page_namespace)
-        * @return Title corresponding Title
+        * @return Title Corresponding Title
         */
        public static function newFromRow( $row ) {
                $t = self::makeTitle( $row->page_namespace, $row->page_title );
@@ -352,7 +352,7 @@ class Title {
         * Load Title object fields from a DB row.
         * If false is given, the title will be treated as non-existing.
         *
-        * @param $row stdClass|bool database row
+        * @param stdClass|bool $row Database row
         */
        public function loadFromRow( $row ) {
                if ( $row ) { // page found
@@ -389,11 +389,11 @@ class Title {
         * For convenience, spaces are converted to underscores so that
         * eg user_text fields can be used directly.
         *
-        * @param int $ns the namespace of the article
-        * @param string $title the unprefixed database key form
-        * @param string $fragment the link fragment (after the "#")
-        * @param string $interwiki the interwiki prefix
-        * @return Title the new object
+        * @param int $ns The namespace of the article
+        * @param string $title The unprefixed database key form
+        * @param string $fragment The link fragment (after the "#")
+        * @param string $interwiki The interwiki prefix
+        * @return Title The new object
         */
        public static function &makeTitle( $ns, $title, $fragment = '', $interwiki = '' ) {
                $t = new Title();
@@ -413,11 +413,11 @@ class Title {
         * The parameters will be checked for validity, which is a bit slower
         * than makeTitle() but safer for user-provided data.
         *
-        * @param int $ns the namespace of the article
-        * @param string $title database key form
-        * @param string $fragment the link fragment (after the "#")
-        * @param string $interwiki interwiki prefix
-        * @return Title the new object, or NULL on an error
+        * @param int $ns The namespace of the article
+        * @param string $title Database key form
+        * @param string $fragment The link fragment (after the "#")
+        * @param string $interwiki Interwiki prefix
+        * @return Title The new object, or NULL on an error
         */
        public static function makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' ) {
                if ( !MWNamespace::exists( $ns ) ) {
@@ -436,7 +436,7 @@ class Title {
        /**
         * Create a new Title for the Main Page
         *
-        * @return Title the new object
+        * @return Title The new object
         */
        public static function newMainPage() {
                $title = Title::newFromText( wfMessage( 'mainpage' )->inContentLanguage()->text() );
@@ -454,7 +454,7 @@ class Title {
         * the redirect table and other checks that don't need full recursion
         *
         * @param string $text Text with possible redirect
-        * @return Title: The corresponding Title
+        * @return Title The corresponding Title
         * @deprecated since 1.21, use Content::getRedirectTarget instead.
         */
        public static function newFromRedirect( $text ) {
@@ -488,7 +488,7 @@ class Title {
         * have been resolved (up to $wgMaxRedirects times)
         *
         * @param string $text Text with possible redirect
-        * @return Array of Titles, with the destination last
+        * @return array Array of Titles, with the destination last
         * @deprecated since 1.21, use Content::getRedirectChain instead.
         */
        public static function newFromRedirectArray( $text ) {
@@ -501,8 +501,8 @@ class Title {
        /**
         * Get the prefixed DB key associated with an ID
         *
-        * @param int $id the page_id of the article
-        * @return Title an object representing the article, or NULL if no such article was found
+        * @param int $id The page_id of the article
+        * @return Title|null An object representing the article, or NULL if no such article was found
         */
        public static function nameOf( $id ) {
                $dbr = wfGetDB( DB_SLAVE );
@@ -524,7 +524,7 @@ class Title {
        /**
         * Get a regex character class describing the legal characters in a link
         *
-        * @return String the list of characters, not delimited
+        * @return string The list of characters, not delimited
         */
        public static function legalChars() {
                global $wgLegalTitleChars;
@@ -538,7 +538,7 @@ class Title {
         *
         * @todo: move this into MediaWikiTitleCodec
         *
-        * @return String regex string
+        * @return string Regex string
         */
        static function getTitleInvalidRegex() {
                static $rxTc = false;
@@ -665,11 +665,11 @@ class Title {
        /**
         * Make a prefixed DB key from a DB key and a namespace index
         *
-        * @param int $ns numerical representation of the namespace
-        * @param string $title the DB key form the title
+        * @param int $ns Numerical representation of the namespace
+        * @param string $title The DB key form the title
         * @param string $fragment The link fragment (after the "#")
         * @param string $interwiki The interwiki prefix
-        * @return String the prefixed form of the title
+        * @return string The prefixed form of the title
         */
        public static function makeName( $ns, $title, $fragment = '', $interwiki = '' ) {
                global $wgContLang;
@@ -688,8 +688,8 @@ class Title {
        /**
         * Escape a text fragment, say from a link, for a URL
         *
-        * @param string $fragment containing a URL or link fragment (after the "#")
-        * @return String: escaped string
+        * @param string $fragment Containing a URL or link fragment (after the "#")
+        * @return string Escaped string
         */
        static function escapeFragmentForURL( $fragment ) {
                # Note that we don't urlencode the fragment.  urlencoded Unicode
@@ -702,10 +702,10 @@ class Title {
        /**
         * Callback for usort() to do title sorts by (namespace, title)
         *
-        * @param $a Title
-        * @param $b Title
+        * @param Title $a
+        * @param Title $b
         *
-        * @return Integer: result of string comparison, or namespace comparison
+        * @return int Result of string comparison, or namespace comparison
         */
        public static function compare( $a, $b ) {
                if ( $a->getNamespace() == $b->getNamespace() ) {
@@ -719,7 +719,7 @@ class Title {
         * Determine whether the object refers to a page within
         * this project.
         *
-        * @return Bool TRUE if this is an in-project interwiki link or a wikilink, FALSE otherwise
+        * @return bool True if this is an in-project interwiki link or a wikilink, false otherwise
         */
        public function isLocal() {
                if ( $this->isExternal() ) {
@@ -734,7 +734,7 @@ class Title {
        /**
         * Is this Title interwiki?
         *
-        * @return Bool
+        * @return bool
         */
        public function isExternal() {
                return $this->mInterwiki !== '';
@@ -745,7 +745,7 @@ class Title {
         *
         * Use Title::isExternal to check if a interwiki is set
         *
-        * @return String Interwiki prefix
+        * @return string Interwiki prefix
         */
        public function getInterwiki() {
                return $this->mInterwiki;
@@ -755,7 +755,7 @@ class Title {
         * Determine whether the object refers to a page within
         * this project and is transcludable.
         *
-        * @return Bool TRUE if this is transcludable
+        * @return bool TRUE if this is transcludable
         */
        public function isTrans() {
                if ( !$this->isExternal() ) {
@@ -768,7 +768,7 @@ class Title {
        /**
         * Returns the DB name of the distant wiki which owns the object.
         *
-        * @return String the DB name
+        * @return string The DB name
         */
        public function getTransWikiID() {
                if ( !$this->isExternal() ) {
@@ -806,7 +806,7 @@ class Title {
        /**
         * Get the text form (spaces not underscores) of the main part
         *
-        * @return String Main part of the title
+        * @return string Main part of the title
         */
        public function getText() {
                return $this->mTextform;
@@ -815,7 +815,7 @@ class Title {
        /**
         * Get the URL-encoded form of the main part
         *
-        * @return String Main part of the title, URL-encoded
+        * @return string Main part of the title, URL-encoded
         */
        public function getPartialURL() {
                return $this->mUrlform;
@@ -824,7 +824,7 @@ class Title {
        /**
         * Get the main part with underscores
         *
-        * @return String: Main part of the title, with underscores
+        * @return string Main part of the title, with underscores
         */
        public function getDBkey() {
                return $this->mDbkeyform;
@@ -833,7 +833,7 @@ class Title {
        /**
         * Get the DB key with the initial letter case as specified by the user
         *
-        * @return String DB key
+        * @return string DB key
         */
        function getUserCaseDBKey() {
                if ( !is_null( $this->mUserCaseDBKey ) ) {
@@ -847,7 +847,7 @@ class Title {
        /**
         * Get the namespace index, i.e. one of the NS_xxxx constants.
         *
-        * @return Integer: Namespace index
+        * @return int Namespace index
         */
        public function getNamespace() {
                return $this->mNamespace;
@@ -857,7 +857,7 @@ class Title {
         * Get the page's content model id, see the CONTENT_MODEL_XXX constants.
         *
         * @throws MWException
-        * @return String: Content model id
+        * @return string Content model id
         */
        public function getContentModel() {
                if ( !$this->mContentModel ) {
@@ -880,7 +880,7 @@ class Title {
         * Convenience method for checking a title's content model name
         *
         * @param string $id The content model ID (use the CONTENT_MODEL_XXX constants).
-        * @return Boolean true if $this->getContentModel() == $id
+        * @return bool True if $this->getContentModel() == $id
         */
        public function hasContentModel( $id ) {
                return $this->getContentModel() == $id;
@@ -889,7 +889,7 @@ class Title {
        /**
         * Get the namespace text
         *
-        * @return String: Namespace text
+        * @return string Namespace text
         */
        public function getNsText() {
                if ( $this->isExternal() ) {
@@ -916,7 +916,7 @@ class Title {
        /**
         * Get the namespace text of the subject (rather than talk) page
         *
-        * @return String Namespace text
+        * @return string Namespace text
         */
        public function getSubjectNsText() {
                global $wgContLang;
@@ -926,7 +926,7 @@ class Title {
        /**
         * Get the namespace text of the talk page
         *
-        * @return String Namespace text
+        * @return string Namespace text
         */
        public function getTalkNsText() {
                global $wgContLang;
@@ -936,7 +936,7 @@ class Title {
        /**
         * Could this title have a corresponding talk page?
         *
-        * @return Bool TRUE or FALSE
+        * @return bool
         */
        public function canTalk() {
                return MWNamespace::canTalk( $this->mNamespace );
@@ -945,7 +945,7 @@ class Title {
        /**
         * Is this in a namespace that allows actual pages?
         *
-        * @return Bool
+        * @return bool
         * @internal note -- uses hardcoded namespace index instead of constants
         */
        public function canExist() {
@@ -955,7 +955,7 @@ class Title {
        /**
         * Can this title be added to a user's watchlist?
         *
-        * @return Bool TRUE or FALSE
+        * @return bool
         */
        public function isWatchable() {
                return !$this->isExternal() && MWNamespace::isWatchable( $this->getNamespace() );
@@ -964,7 +964,7 @@ class Title {
        /**
         * Returns true if this is a special page.
         *
-        * @return boolean
+        * @return bool
         */
        public function isSpecialPage() {
                return $this->getNamespace() == NS_SPECIAL;
@@ -974,7 +974,7 @@ class Title {
         * Returns true if this title resolves to the named special page
         *
         * @param string $name The special page name
-        * @return boolean
+        * @return bool
         */
        public function isSpecial( $name ) {
                if ( $this->isSpecialPage() ) {
@@ -1051,7 +1051,7 @@ class Title {
         * This is MUCH simpler than individually testing for equivalence
         * against both NS_USER and NS_USER_TALK, and is also forward compatible.
         * @since 1.19
-        * @param $ns int
+        * @param int $ns
         * @return bool
         */
        public function hasSubjectNamespace( $ns ) {
@@ -1063,7 +1063,7 @@ class Title {
         * In other words, is this a content page, for the purposes of calculating
         * statistics, etc?
         *
-        * @return Boolean
+        * @return bool
         */
        public function isContentPage() {
                return MWNamespace::isContent( $this->getNamespace() );
@@ -1073,7 +1073,7 @@ class Title {
         * Would anybody with sufficient privileges be able to move this page?
         * Some pages just aren't movable.
         *
-        * @return Bool TRUE or FALSE
+        * @return bool
         */
        public function isMovable() {
                if ( !MWNamespace::isMovable( $this->getNamespace() ) || $this->isExternal() ) {
@@ -1094,7 +1094,7 @@ class Title {
         * ends up reporting something differently than $title->isMainPage();
         *
         * @since 1.18
-        * @return Bool
+        * @return bool
         */
        public function isMainPage() {
                return $this->equals( Title::newMainPage() );
@@ -1103,7 +1103,7 @@ class Title {
        /**
         * Is this a subpage?
         *
-        * @return Bool
+        * @return bool
         */
        public function isSubpage() {
                return MWNamespace::hasSubpages( $this->mNamespace )
@@ -1114,7 +1114,7 @@ class Title {
        /**
         * Is this a conversion table for the LanguageConverter?
         *
-        * @return Bool
+        * @return bool
         */
        public function isConversionTable() {
                // @todo ConversionTable should become a separate content model.
@@ -1126,7 +1126,7 @@ class Title {
        /**
         * Does that page contain wikitext, or it is JS, CSS or whatever?
         *
-        * @return Bool
+        * @return bool
         */
        public function isWikitextPage() {
                return $this->hasContentModel( CONTENT_MODEL_WIKITEXT );
@@ -1141,7 +1141,7 @@ class Title {
         *
         * Note that this method should not return true for pages that contain and show "inactive" CSS or JS.
         *
-        * @return Bool
+        * @return bool
         */
        public function isCssOrJsPage() {
                $isCssOrJsPage = NS_MEDIAWIKI == $this->mNamespace
@@ -1158,7 +1158,7 @@ class Title {
 
        /**
         * Is this a .css or .js subpage of a user page?
-        * @return Bool
+        * @return bool
         */
        public function isCssJsSubpage() {
                return ( NS_USER == $this->mNamespace && $this->isSubpage()
@@ -1169,7 +1169,7 @@ class Title {
        /**
         * Trim down a .css or .js subpage title to get the corresponding skin name
         *
-        * @return string containing skin name from .css or .js subpage title
+        * @return string Containing skin name from .css or .js subpage title
         */
        public function getSkinFromCssJsSubpage() {
                $subpage = explode( '/', $this->mTextform );
@@ -1184,7 +1184,7 @@ class Title {
        /**
         * Is this a .css subpage of a user page?
         *
-        * @return Bool
+        * @return bool
         */
        public function isCssSubpage() {
                return ( NS_USER == $this->mNamespace && $this->isSubpage()
@@ -1194,7 +1194,7 @@ class Title {
        /**
         * Is this a .js subpage of a user page?
         *
-        * @return Bool
+        * @return bool
         */
        public function isJsSubpage() {
                return ( NS_USER == $this->mNamespace && $this->isSubpage()
@@ -1204,7 +1204,7 @@ class Title {
        /**
         * Is this a talk page of some sort?
         *
-        * @return Bool
+        * @return bool
         */
        public function isTalkPage() {
                return MWNamespace::isTalk( $this->getNamespace() );
@@ -1213,7 +1213,7 @@ class Title {
        /**
         * Get a Title object associated with the talk page of this article
         *
-        * @return Title the object for the talk page
+        * @return Title The object for the talk page
         */
        public function getTalkPage() {
                return Title::makeTitle( MWNamespace::getTalk( $this->getNamespace() ), $this->getDBkey() );
@@ -1223,7 +1223,7 @@ class Title {
         * Get a title object associated with the subject page of this
         * talk page
         *
-        * @return Title the object for the subject page
+        * @return Title The object for the subject page
         */
        public function getSubjectPage() {
                // Is this the same title?
@@ -1237,7 +1237,7 @@ class Title {
        /**
         * Get the default namespace index, for when there is no namespace
         *
-        * @return Int Default namespace index
+        * @return int Default namespace index
         */
        public function getDefaultNamespace() {
                return $this->mDefaultNamespace;
@@ -1248,7 +1248,7 @@ class Title {
         *
         * Use Title::hasFragment to check for a fragment
         *
-        * @return String Title fragment
+        * @return string Title fragment
         */
        public function getFragment() {
                return $this->mFragment;
@@ -1266,7 +1266,7 @@ class Title {
 
        /**
         * Get the fragment in URL form, including the "#" character if there is one
-        * @return String Fragment in URL form
+        * @return string Fragment in URL form
         */
        public function getFragmentForURL() {
                if ( !$this->hasFragment() ) {
@@ -1284,7 +1284,7 @@ class Title {
         * Deprecated for public use, use Title::makeTitle() with fragment parameter.
         * Still in active use privately.
         *
-        * @param string $fragment text
+        * @param string $fragment Text
         */
        public function setFragment( $fragment ) {
                $this->mFragment = str_replace( '_', ' ', substr( $fragment, 1 ) );
@@ -1294,8 +1294,8 @@ class Title {
         * Prefix some arbitrary text with the namespace or interwiki prefix
         * of this object
         *
-        * @param string $name the text
-        * @return String the prefixed text
+        * @param string $name The text
+        * @return string The prefixed text
         * @private
         */
        private function prefix( $name ) {
@@ -1313,7 +1313,7 @@ class Title {
        /**
         * Get the prefixed database key form
         *
-        * @return String the prefixed title, with underscores and
+        * @return string The prefixed title, with underscores and
         *  any interwiki and namespace prefixes
         */
        public function getPrefixedDBkey() {
@@ -1326,7 +1326,7 @@ class Title {
         * Get the prefixed title with spaces.
         * This is the form usually used for display
         *
-        * @return String the prefixed title, with spaces
+        * @return string The prefixed title, with spaces
         */
        public function getPrefixedText() {
                if ( $this->mPrefixedText === null ) {
@@ -1340,7 +1340,7 @@ class Title {
        /**
         * Return a string representation of this title
         *
-        * @return String representation of this title
+        * @return string Representation of this title
         */
        public function __toString() {
                return $this->getPrefixedText();
@@ -1350,7 +1350,7 @@ class Title {
         * Get the prefixed title with spaces, plus any fragment
         * (part beginning with '#')
         *
-        * @return String the prefixed title, with spaces and the fragment, including '#'
+        * @return string The prefixed title, with spaces and the fragment, including '#'
         */
        public function getFullText() {
                $text = $this->getPrefixedText();
@@ -1369,7 +1369,7 @@ class Title {
         * # returns: 'Foo'
         * @endcode
         *
-        * @return String Root name
+        * @return string Root name
         * @since 1.20
         */
        public function getRootText() {
@@ -1405,7 +1405,7 @@ class Title {
         * # returns: 'Foo/Bar'
         * @endcode
         *
-        * @return String Base name
+        * @return string Base name
         */
        public function getBaseText() {
                if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
@@ -1445,7 +1445,7 @@ class Title {
         * # returns: "Baz"
         * @endcode
         *
-        * @return String Subpage name
+        * @return string Subpage name
         */
        public function getSubpageText() {
                if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
@@ -1476,7 +1476,7 @@ class Title {
         * Get the HTML-escaped displayable text form.
         * Used for the title field in <a> tags.
         *
-        * @return String the text, including any prefixes
+        * @return string The text, including any prefixes
         * @deprecated since 1.19
         */
        public function getEscapedText() {
@@ -1487,7 +1487,7 @@ class Title {
        /**
         * Get a URL-encoded form of the subpage text
         *
-        * @return String URL-encoded subpage name
+        * @return string URL-encoded subpage name
         */
        public function getSubpageUrlForm() {
                $text = $this->getSubpageText();
@@ -1498,7 +1498,7 @@ class Title {
        /**
         * Get a URL-encoded title (not an actual URL) including interwiki
         *
-        * @return String the URL-encoded form
+        * @return string The URL-encoded form
         */
        public function getPrefixedURL() {
                $s = $this->prefix( $this->mDbkeyform );
@@ -1515,9 +1515,9 @@ class Title {
         * and the wfArrayToCgi moved to getLocalURL();
         *
         * @since 1.19 (r105919)
-        * @param $query
-        * @param $query2 bool
-        * @return String
+        * @param array|string $query
+        * @param bool $query2
+        * @return string
         */
        private static function fixUrlQueryArgs( $query, $query2 = false ) {
                if ( $query2 !== false ) {
@@ -1552,10 +1552,10 @@ class Title {
         *
         * @see self::getLocalURL for the arguments.
         * @see wfExpandUrl
-        * @param $query
-        * @param $query2 bool
-        * @param $proto Protocol type to use in URL
-        * @return String the URL
+        * @param array|string $query
+        * @param bool $query2
+        * @param string $proto Protocol type to use in URL
+        * @return string The URL
         */
        public function getFullURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
                $query = self::fixUrlQueryArgs( $query, $query2 );
@@ -1587,14 +1587,14 @@ class Title {
         *   not used for interwiki links. Can be specified as an associative array as well,
         *   e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
         *   Some query patterns will trigger various shorturl path replacements.
-        * @param $query2 Mixed: An optional secondary query array. This one MUST
+        * @param array $query2 An optional secondary query array. This one MUST
         *   be an array. If a string is passed it will be interpreted as a deprecated
         *   variant argument and urlencoded into a variant= argument.
         *   This second query argument will be added to the $query
         *   The second parameter is deprecated since 1.19. Pass it as a key,value
         *   pair in the first parameter array instead.
         *
-        * @return String of the URL.
+        * @return string String of the URL.
         */
        public function getLocalURL( $query = '', $query2 = false ) {
                global $wgArticlePath, $wgScript, $wgServer, $wgRequest;
@@ -1682,11 +1682,11 @@ class Title {
         * The result obviously should not be URL-escaped, but does need to be
         * HTML-escaped if it's being output in HTML.
         *
-        * @param $query
-        * @param $query2 bool
-        * @param $proto Protocol to use; setting this will cause a full URL to be used
+        * @param array $query
+        * @param bool $query2
+        * @param string $proto Protocol to use; setting this will cause a full URL to be used
         * @see self::getLocalURL for the arguments.
-        * @return String the URL
+        * @return string The URL
         */
        public function getLinkURL( $query = '', $query2 = false, $proto = PROTO_RELATIVE ) {
                wfProfileIn( __METHOD__ );
@@ -1706,9 +1706,9 @@ class Title {
         * using in a link, without a server name or fragment
         *
         * @see self::getLocalURL for the arguments.
-        * @param $query string
-        * @param $query2 bool|string
-        * @return String the URL
+        * @param string $query
+        * @param bool|string $query2
+        * @return string The URL
         * @deprecated since 1.19
         */
        public function escapeLocalURL( $query = '', $query2 = false ) {
@@ -1721,7 +1721,7 @@ class Title {
         * using in a link, including the server name and fragment
         *
         * @see self::getLocalURL for the arguments.
-        * @return String the URL
+        * @return string The URL
         * @deprecated since 1.19
         */
        public function escapeFullURL( $query = '', $query2 = false ) {
@@ -1739,7 +1739,7 @@ class Title {
         * protocol-relative, the URL will be expanded to http://
         *
         * @see self::getLocalURL for the arguments.
-        * @return String the URL
+        * @return string The URL
         */
        public function getInternalURL( $query = '', $query2 = false ) {
                global $wgInternalServer, $wgServer;
@@ -1784,8 +1784,7 @@ class Title {
        /**
         * Get the edit URL for this Title
         *
-        * @return String the URL, or a null string if this is an
-        *  interwiki link
+        * @return string The URL, or a null string if this is an interwiki link
         */
        public function getEditURL() {
                if ( $this->isExternal() ) {
@@ -1800,7 +1799,7 @@ class Title {
         * Is $wgUser watching this page?
         *
         * @deprecated since 1.20; use User::isWatched() instead.
-        * @return Bool
+        * @return bool
         */
        public function userIsWatching() {
                global $wgUser;
@@ -1819,7 +1818,7 @@ class Title {
         * Can $wgUser read this page?
         *
         * @deprecated since 1.19; use userCan(), quickUserCan() or getUserPermissionsErrors() instead
-        * @return Bool
+        * @return bool
         */
        public function userCanRead() {
                wfDeprecated( __METHOD__, '1.19' );
@@ -1836,10 +1835,9 @@ class Title {
         *
         * May provide false positives, but should never provide a false negative.
         *
-        * @param string $action action that permission needs to be checked for
-        * @param $user User to check (since 1.19); $wgUser will be used if not
-        *              provided.
-        * @return Bool
+        * @param string $action Action that permission needs to be checked for
+        * @param User $user User to check (since 1.19); $wgUser will be used if not provided.
+        * @return bool
         */
        public function quickUserCan( $action, $user = null ) {
                return $this->userCan( $action, $user, false );
@@ -1848,12 +1846,12 @@ class Title {
        /**
         * Can $user perform $action on this page?
         *
-        * @param string $action action that permission needs to be checked for
-        * @param $user User to check (since 1.19); $wgUser will be used if not
+        * @param string $action Action that permission needs to be checked for
+        * @param User $user User to check (since 1.19); $wgUser will be used if not
         *   provided.
         * @param bool $doExpensiveQueries Set this to false to avoid doing
         *   unnecessary queries.
-        * @return Bool
+        * @return bool
         */
        public function userCan( $action, $user = null, $doExpensiveQueries = true ) {
                if ( !$user instanceof User ) {
@@ -1869,12 +1867,12 @@ class Title {
         * @todo FIXME: This *does not* check throttles (User::pingLimiter()).
         *
         * @param string $action action that permission needs to be checked for
-        * @param $user User to check
+        * @param User $user User to check
         * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary
         *   queries by skipping checks for cascading protections and user blocks.
         * @param array $ignoreErrors of Strings Set this to a list of message keys
         *   whose corresponding errors may be ignored.
-        * @return Array of arguments to wfMessage to explain permissions problems.
+        * @return array Array of arguments to wfMessage to explain permissions problems.
         */
        public function getUserPermissionsErrors( $action, $user, $doExpensiveQueries = true, $ignoreErrors = array() ) {
                $errors = $this->getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries );
@@ -1895,12 +1893,12 @@ class Title {
         * Permissions checks that fail most often, and which are easiest to test.
         *
         * @param string $action the action to check
-        * @param $user User user to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkQuickPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                if ( !wfRunHooks( 'TitleQuickPermissions', array( $this, $user, $action, &$errors, $doExpensiveQueries, $short ) ) ) {
@@ -1956,10 +1954,10 @@ class Title {
        /**
         * Add the resulting error code to the errors array
         *
-        * @param array $errors list of current errors
-        * @param $result Mixed result of errors
+        * @param array $errors List of current errors
+        * @param array $result Result of errors
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function resultToError( $errors, $result ) {
                if ( is_array( $result ) && count( $result ) && !is_array( $result[0] ) ) {
@@ -1981,13 +1979,13 @@ class Title {
        /**
         * Check various permission hooks
         *
-        * @param string $action the action to check
-        * @param $user User user to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkPermissionHooks( $action, $user, $errors, $doExpensiveQueries, $short ) {
                // Use getUserPermissionsErrors instead
@@ -2014,13 +2012,13 @@ class Title {
        /**
         * Check permissions on special pages & namespaces
         *
-        * @param string $action the action to check
-        * @param $user User user to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkSpecialsAndNSPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                # Only 'createaccount' can be performed on special pages,
@@ -2043,13 +2041,13 @@ class Title {
        /**
         * Check CSS/JS sub-page permissions
         *
-        * @param string $action the action to check
-        * @param $user User user to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkCSSandJSPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                # Protect css/js subpages of user pages
@@ -2079,13 +2077,13 @@ class Title {
         * page. The user must possess all required rights for this
         * action.
         *
-        * @param string $action the action to check
-        * @param $user User user to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkPageRestrictions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                foreach ( $this->getRestrictions( $action ) as $right ) {
@@ -2113,13 +2111,13 @@ class Title {
        /**
         * Check restrictions on cascading pages.
         *
-        * @param string $action the action to check
-        * @param $user User to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkCascadingSourcesRestrictions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                if ( $doExpensiveQueries && !$this->isCssJsSubpage() ) {
@@ -2160,13 +2158,13 @@ class Title {
        /**
         * Check action permissions not already checked in checkQuickPermissions
         *
-        * @param string $action the action to check
-        * @param $user User to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkActionPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                global $wgDeleteRevisionsLimit, $wgLang;
@@ -2219,13 +2217,13 @@ class Title {
        /**
         * Check that the user isn't blocked from editing.
         *
-        * @param string $action the action to check
-        * @param $user User to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkUserBlock( $action, $user, $errors, $doExpensiveQueries, $short ) {
                // Account creation blocks handled at userlogin.
@@ -2254,13 +2252,13 @@ class Title {
        /**
         * Check that the user is allowed to read this page.
         *
-        * @param string $action the action to check
-        * @param $user User to check
-        * @param array $errors list of current errors
-        * @param $doExpensiveQueries Boolean whether or not to perform expensive queries
-        * @param $short Boolean short circuit on first error
+        * @param string $action The action to check
+        * @param User $user User to check
+        * @param array $errors List of current errors
+        * @param bool $doExpensiveQueries Whether or not to perform expensive queries
+        * @param bool $short Short circuit on first error
         *
-        * @return Array list of errors
+        * @return array List of errors
         */
        private function checkReadPermissions( $action, $user, $errors, $doExpensiveQueries, $short ) {
                global $wgWhitelistRead, $wgWhitelistReadRegexp;
@@ -2333,9 +2331,9 @@ class Title {
         * Get a description array when the user doesn't have the right to perform
         * $action (i.e. when User::isAllowed() returns false)
         *
-        * @param string $action the action to check
-        * @param $short Boolean short circuit on first error
-        * @return Array list of errors
+        * @param string $action The action to check
+        * @param bool $short Short circuit on first error
+        * @return array List of errors
         */
        private function missingPermissionError( $action, $short ) {
                // We avoid expensive display logic for quickUserCan's and such
@@ -2363,11 +2361,11 @@ class Title {
         * which checks ONLY that previously checked by userCan (i.e. it leaves out
         * checks on wfReadOnly() and blocks)
         *
-        * @param string $action action that permission needs to be checked for
-        * @param $user User to check
+        * @param string $action Action that permission needs to be checked for
+        * @param User $user User to check
         * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary queries.
         * @param bool $short Set this to true to stop after the first permission error.
-        * @return Array of arrays of the arguments to wfMessage to explain permissions problems.
+        * @return array Array of arrays of the arguments to wfMessage to explain permissions problems.
         */
        protected function getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries = true, $short = false ) {
                wfProfileIn( __METHOD__ );
@@ -2425,7 +2423,7 @@ class Title {
        /**
         * Returns restriction types for the current Title
         *
-        * @return array applicable restriction types
+        * @return array Applicable restriction types
         */
        public function getRestrictionTypes() {
                if ( $this->isSpecialPage() ) {
@@ -2451,7 +2449,7 @@ class Title {
         * Is this title subject to title protection?
         * Title protection is the one applied against creation of such title.
         *
-        * @return Mixed An associative array representing any existent title
+        * @return array|bool An associative array representing any existent title
         *   protection, or false if there's none.
         */
        private function getTitleProtection() {
@@ -2484,10 +2482,10 @@ class Title {
         * Update the title protection status
         *
         * @deprecated since 1.19; use WikiPage::doUpdateRestrictions() instead.
-        * @param $create_perm String Permission required for creation
+        * @param string $create_perm Permission required for creation
         * @param string $reason Reason for protection
         * @param string $expiry Expiry timestamp
-        * @return boolean true
+        * @return bool
         */
        public function updateTitleProtection( $create_perm, $reason, $expiry ) {
                wfDeprecated( __METHOD__, '1.19' );
@@ -2523,7 +2521,7 @@ class Title {
         * in $wgSemiprotectedRestrictionLevels?
         *
         * @param string $action Action to check (default: edit)
-        * @return Bool
+        * @return bool
         */
        public function isSemiProtected( $action = 'edit' ) {
                global $wgSemiprotectedRestrictionLevels;
@@ -2551,7 +2549,7 @@ class Title {
         *
         * @param string $action the action the page is protected from,
         * by default checks all actions.
-        * @return Bool
+        * @return bool
         */
        public function isProtected( $action = '' ) {
                global $wgRestrictionLevels;
@@ -2582,8 +2580,8 @@ class Title {
         * Determines if $user is unable to edit this page because it has been protected
         * by $wgNamespaceProtection.
         *
-        * @param $user User object to check permissions
-        * @return Bool
+        * @param User $user User object to check permissions
+        * @return bool
         */
        public function isNamespaceProtected( User $user ) {
                global $wgNamespaceProtection;
@@ -2601,7 +2599,7 @@ class Title {
        /**
         * Cascading protection: Return true if cascading restrictions apply to this page, false if not.
         *
-        * @return Bool If the page is subject to cascading restrictions.
+        * @return bool If the page is subject to cascading restrictions.
         */
        public function isCascadeProtected() {
                list( $sources, /* $restrictions */ ) = $this->getCascadeProtectionSources( false );
@@ -2626,7 +2624,7 @@ class Title {
         *
         * @param bool $getPages Whether or not to retrieve the actual pages
         *        that the restrictions have come from.
-        * @return Mixed Array of Title objects of the pages from which cascading restrictions
+        * @return array|bool Array of Title objects of the pages from which cascading restrictions
         *     have come, false for none, or true if such restrictions exist, but $getPages
         *     was not set.  The restriction array is an array of each type, each of which
         *     contains a array of unique groups.
@@ -2735,8 +2733,8 @@ class Title {
        /**
         * Accessor/initialisation for mRestrictions
         *
-        * @param string $action action that permission needs to be checked for
-        * @return Array of Strings the array of groups allowed to edit this article
+        * @param string $action Action that permission needs to be checked for
+        * @return array Array of Strings the array of groups allowed to edit this article
         */
        public function getRestrictions( $action ) {
                if ( !$this->mRestrictionsLoaded ) {
@@ -2750,7 +2748,7 @@ class Title {
        /**
         * Accessor/initialisation for mRestrictions
         *
-        * @return Array of Arrays of Strings the first level indexed by
+        * @return array Array of Arrays of Strings the first level indexed by
         * action, the second level containing the names of the groups
         * allowed to perform each action
         * @since 1.23
@@ -2765,8 +2763,8 @@ class Title {
        /**
         * Get the expiry time for the restriction against a given action
         *
-        * @param $action
-        * @return String|Bool 14-char timestamp, or 'infinity' if the page is protected forever
+        * @param string $action
+        * @return string|bool 14-char timestamp, or 'infinity' if the page is protected forever
         *     or not protected at all, or false if the action is not recognised.
         */
        public function getRestrictionExpiry( $action ) {
@@ -2779,7 +2777,7 @@ class Title {
        /**
         * Returns cascading restrictions for the current article
         *
-        * @return Boolean
+        * @return bool
         */
        function areRestrictionsCascading() {
                if ( !$this->mRestrictionsLoaded ) {
@@ -2792,8 +2790,8 @@ class Title {
        /**
         * Loads a string into mRestrictions array
         *
-        * @param $res Resource restrictions as an SQL result.
-        * @param string $oldFashionedRestrictions comma-separated list of page
+        * @param ResultWrapper $res Resource restrictions as an SQL result.
+        * @param string $oldFashionedRestrictions Comma-separated list of page
         *        restrictions from page table (pre 1.10)
         */
        private function loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = null ) {
@@ -2811,9 +2809,9 @@ class Title {
         * and page_restrictions table for this existing page.
         * Public for usage by LiquidThreads.
         *
-        * @param array $rows of db result objects
-        * @param string $oldFashionedRestrictions comma-separated list of page
-        *        restrictions from page table (pre 1.10)
+        * @param array $rows Array of db result objects
+        * @param string $oldFashionedRestrictions Comma-separated list of page
+        *   restrictions from page table (pre 1.10)
         */
        public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = null ) {
                global $wgContLang;
@@ -2895,8 +2893,8 @@ class Title {
        /**
         * Load restrictions from the page_restrictions table
         *
-        * @param string $oldFashionedRestrictions comma-separated list of page
-        *        restrictions from page table (pre 1.10)
+        * @param string $oldFashionedRestrictions Comma-separated list of page
+        *   restrictions from page table (pre 1.10)
         */
        public function loadRestrictions( $oldFashionedRestrictions = null ) {
                global $wgContLang;
@@ -2971,7 +2969,7 @@ class Title {
        /**
         * Does this have subpages?  (Warning, usually requires an extra DB query.)
         *
-        * @return Bool
+        * @return bool
         */
        public function hasSubpages() {
                if ( !MWNamespace::hasSubpages( $this->mNamespace ) ) {
@@ -2997,8 +2995,8 @@ class Title {
        /**
         * Get all subpages of this page.
         *
-        * @param int $limit maximum number of subpages to fetch; -1 for no limit
-        * @return mixed TitleArray, or empty array if this page's namespace
+        * @param int $limit Maximum number of subpages to fetch; -1 for no limit
+        * @return TitleArray|array TitleArray, or empty array if this page's namespace
         *  doesn't allow subpages
         */
        public function getSubpages( $limit = -1 ) {
@@ -3027,7 +3025,7 @@ class Title {
        /**
         * Is there a version of this page in the deletion archive?
         *
-        * @return Int the number of archived revisions
+        * @return int The number of archived revisions
         */
        public function isDeleted() {
                if ( $this->getNamespace() < 0 ) {
@@ -3052,7 +3050,7 @@ class Title {
        /**
         * Is there a version of this page in the deletion archive?
         *
-        * @return Boolean
+        * @return bool
         */
        public function isDeletedQuick() {
                if ( $this->getNamespace() < 0 ) {
@@ -3076,9 +3074,9 @@ class Title {
         * Get the article ID for this Title from the link cache,
         * adding it if necessary
         *
-        * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select
+        * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to select
         *  for update
-        * @return Int the ID
+        * @return int The ID
         */
        public function getArticleID( $flags = 0 ) {
                if ( $this->getNamespace() < 0 ) {
@@ -3103,8 +3101,8 @@ class Title {
         * Is this an article that is a redirect page?
         * Uses link cache, adding it if necessary
         *
-        * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
-        * @return Bool
+        * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
+        * @return bool
         */
        public function isRedirect( $flags = 0 ) {
                if ( !is_null( $this->mRedirect ) ) {
@@ -3138,8 +3136,8 @@ class Title {
         * What is the length of this page?
         * Uses link cache, adding it if necessary
         *
-        * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
-        * @return Int
+        * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
+        * @return int
         */
        public function getLength( $flags = 0 ) {
                if ( $this->mLength != -1 ) {
@@ -3166,8 +3164,8 @@ class Title {
        /**
         * What is the page_latest field for this page?
         *
-        * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
-        * @return Int or 0 if the page doesn't exist
+        * @param int $flags A bit field; may be Title::GAID_FOR_UPDATE to select for update
+        * @return int Int or 0 if the page doesn't exist
         */
        public function getLatestRevID( $flags = 0 ) {
                if ( !( $flags & Title::GAID_FOR_UPDATE ) && $this->mLatestID !== false ) {
@@ -3200,7 +3198,7 @@ class Title {
         * loading of the new page_id. It's also called from
         * WikiPage::doDeleteArticleReal()
         *
-        * @param int $newid the new Article ID
+        * @param int $newid The new Article ID
         */
        public function resetArticleID( $newid ) {
                $linkCache = LinkCache::singleton();
@@ -3224,9 +3222,9 @@ class Title {
        /**
         * Capitalize a text string for a title if it belongs to a namespace that capitalizes
         *
-        * @param string $text containing title to capitalize
-        * @param int $ns namespace index, defaults to NS_MAIN
-        * @return String containing capitalized title
+        * @param string $text Containing title to capitalize
+        * @param int $ns Namespace index, defaults to NS_MAIN
+        * @return string Containing capitalized title
         */
        public static function capitalize( $text, $ns = NS_MAIN ) {
                global $wgContLang;
@@ -3247,7 +3245,7 @@ class Title {
         * namespace prefixes, sets the other forms, and canonicalizes
         * everything.
         *
-        * @return Bool true on success
+        * @return bool True on success
         */
        private function secureAndSplit() {
                # Initialisation
@@ -3292,10 +3290,10 @@ class Title {
         * WARNING: do not use this function on arbitrary user-supplied titles!
         * On heavily-used templates it will max out the memory.
         *
-        * @param array $options may be FOR UPDATE
-        * @param string $table table name
-        * @param string $prefix fields prefix
-        * @return Array of Title objects linking here
+        * @param array $options May be FOR UPDATE
+        * @param string $table Table name
+        * @param string $prefix Fields prefix
+        * @return array Array of Title objects linking here
         */
        public function getLinksTo( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
                if ( count( $options ) > 0 ) {
@@ -3336,8 +3334,8 @@ class Title {
         * WARNING: do not use this function on arbitrary user-supplied titles!
         * On heavily-used templates it will max out the memory.
         *
-        * @param array $options may be FOR UPDATE
-        * @return Array of Title the Title objects linking here
+        * @param array $options May be FOR UPDATE
+        * @return array Array of Title the Title objects linking here
         */
        public function getTemplateLinksTo( $options = array() ) {
                return $this->getLinksTo( $options, 'templatelinks', 'tl' );
@@ -3350,10 +3348,10 @@ class Title {
         * WARNING: do not use this function on arbitrary user-supplied titles!
         * On heavily-used templates it will max out the memory.
         *
-        * @param array $options may be FOR UPDATE
-        * @param string $table table name
-        * @param string $prefix fields prefix
-        * @return Array of Title objects linking here
+        * @param array $options May be FOR UPDATE
+        * @param string $table Table name
+        * @param string $prefix Fields prefix
+        * @return array Array of Title objects linking here
         */
        public function getLinksFrom( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
                global $wgContentHandlerUseDB;
@@ -3413,8 +3411,8 @@ class Title {
         * WARNING: do not use this function on arbitrary user-supplied titles!
         * On heavily-used templates it will max out the memory.
         *
-        * @param array $options may be FOR UPDATE
-        * @return Array of Title the Title objects used here
+        * @param array $options May be FOR UPDATE
+        * @return array Array of Title the Title objects used here
         */
        public function getTemplateLinksFrom( $options = array() ) {
                return $this->getLinksFrom( $options, 'templatelinks', 'tl' );
@@ -3424,7 +3422,7 @@ class Title {
         * Get an array of Title objects referring to non-existent articles linked from this page
         *
         * @todo check if needed (used only in SpecialBrokenRedirects.php, and should use redirect table in this case)
-        * @return Array of Title the Title objects
+        * @return array Array of Title the Title objects
         */
        public function getBrokenLinksFrom() {
                if ( $this->getArticleID() == 0 ) {
@@ -3460,7 +3458,7 @@ class Title {
         * Get a list of URLs to purge from the Squid cache when this
         * page changes
         *
-        * @return Array of String the URLs
+        * @return array Array of String the URLs
         */
        public function getSquidURLs() {
                $urls = array(
@@ -3502,8 +3500,8 @@ class Title {
        /**
         * Move this page without authentication
         *
-        * @param $nt Title the new page Title
-        * @return Mixed true on success, getUserPermissionsErrors()-like array on failure
+        * @param Title $nt The new page Title
+        * @return array|bool True on success, getUserPermissionsErrors()-like array on failure
         */
        public function moveNoAuth( &$nt ) {
                return $this->moveTo( $nt, false );
@@ -3513,11 +3511,11 @@ class Title {
         * Check whether a given move operation would be valid.
         * Returns true if ok, or a getUserPermissionsErrors()-like array otherwise
         *
-        * @param $nt Title the new title
-        * @param bool $auth indicates whether $wgUser's permissions
+        * @param Title $nt The new title
+        * @param bool $auth Indicates whether $wgUser's permissions
         *  should be checked
-        * @param string $reason is the log summary of the move, used for spam checking
-        * @return Mixed True on success, getUserPermissionsErrors()-like array on failure
+        * @param string $reason Is the log summary of the move, used for spam checking
+        * @return array|bool True on success, getUserPermissionsErrors()-like array on failure
         */
        public function isValidMoveOperation( &$nt, $auth = true, $reason = '' ) {
                global $wgUser, $wgContentHandlerUseDB;
@@ -3663,13 +3661,13 @@ class Title {
        /**
         * Move a title to a new location
         *
-        * @param $nt Title the new title
-        * @param bool $auth indicates whether $wgUser's permissions
+        * @param Title $nt The new title
+        * @param bool $auth Indicates whether $wgUser's permissions
         *  should be checked
-        * @param string $reason the reason for the move
+        * @param string $reason The reason for the move
         * @param bool $createRedirect Whether to create a redirect from the old title to the new title.
         *  Ignored if the user doesn't have the suppressredirect right.
-        * @return Mixed true on success, getUserPermissionsErrors()-like array on failure
+        * @return array|bool True on success, getUserPermissionsErrors()-like array on failure
         */
        public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true ) {
                global $wgUser;
@@ -3796,7 +3794,7 @@ class Title {
         * Move page to a title which is either a redirect to the
         * source page or nonexistent
         *
-        * @param $nt Title the page to move to, which should be a redirect or nonexistent
+        * @param Title $nt The page to move to, which should be a redirect or nonexistent
         * @param string $reason The reason for the move
         * @param bool $createRedirect Whether to leave a redirect at the old title. Does not check
         *   if the user has the suppressredirect right
@@ -3928,12 +3926,12 @@ class Title {
        /**
         * Move this page's subpages to be subpages of $nt
         *
-        * @param $nt Title Move target
+        * @param Title $nt Move target
         * @param bool $auth Whether $wgUser's permissions should be checked
         * @param string $reason The reason for the move
         * @param bool $createRedirect Whether to create redirects from the old subpages to
         *     the new ones Ignored if the user doesn't have the 'suppressredirect' right
-        * @return mixed array with old page titles as keys, and strings (new page titles) or
+        * @return array Array with old page titles as keys, and strings (new page titles) or
         *     arrays (errors) as values, or an error array with numeric indices if no pages
         *     were moved
         */
@@ -4002,7 +4000,7 @@ class Title {
         * Checks if this page is just a one-rev redirect.
         * Adds lock, so don't use just for light purposes.
         *
-        * @return Bool
+        * @return bool
         */
        public function isSingleRevRedirect() {
                global $wgContentHandlerUseDB;
@@ -4048,8 +4046,8 @@ class Title {
         * Checks if $this can be moved to a given Title
         * - Selects for update, so don't call it unless you mean business
         *
-        * @param $nt Title the new title to check
-        * @return Bool
+        * @param Title $nt The new title to check
+        * @return bool
         */
        public function isValidMoveTarget( $nt ) {
                # Is it an existing file?
@@ -4095,7 +4093,7 @@ class Title {
         * Get categories to which this Title belongs and return an array of
         * categories' names.
         *
-        * @return Array of parents in the form:
+        * @return array Array of parents in the form:
         *        $parent => $currentarticle
         */
        public function getParentCategories() {
@@ -4130,8 +4128,8 @@ class Title {
        /**
         * Get a tree of parent categories
         *
-        * @param array $children with the children in the keys, to check for circular refs
-        * @return Array Tree of parent categories
+        * @param array $children Array with the children in the keys, to check for circular refs
+        * @return array Tree of parent categories
         */
        public function getParentCategoryTree( $children = array() ) {
                $stack = array();
@@ -4158,7 +4156,7 @@ class Title {
         * Get an associative array for selecting this title from
         * the "page" table
         *
-        * @return Array suitable for the $where parameter of DB::select()
+        * @return array Array suitable for the $where parameter of DB::select()
         */
        public function pageCond() {
                if ( $this->mArticleID > 0 ) {
@@ -4174,7 +4172,7 @@ class Title {
         *
         * @param int $revId Revision ID. Get the revision that was before this one.
         * @param int $flags Title::GAID_FOR_UPDATE
-        * @return Int|Bool Old revision ID, or FALSE if none exists
+        * @return int|bool Old revision ID, or FALSE if none exists
         */
        public function getPreviousRevisionID( $revId, $flags = 0 ) {
                $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
@@ -4199,7 +4197,7 @@ class Title {
         *
         * @param int $revId Revision ID. Get the revision that was after this one.
         * @param int $flags Title::GAID_FOR_UPDATE
-        * @return Int|Bool Next revision ID, or FALSE if none exists
+        * @return int|bool Next revision ID, or FALSE if none exists
         */
        public function getNextRevisionID( $revId, $flags = 0 ) {
                $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
@@ -4223,7 +4221,7 @@ class Title {
         * Get the first revision of the page
         *
         * @param int $flags Title::GAID_FOR_UPDATE
-        * @return Revision|Null if page doesn't exist
+        * @return Revision|null If page doesn't exist
         */
        public function getFirstRevision( $flags = 0 ) {
                $pageId = $this->getArticleID( $flags );
@@ -4245,7 +4243,7 @@ class Title {
         * Get the oldest revision timestamp of this page
         *
         * @param int $flags Title::GAID_FOR_UPDATE
-        * @return String: MW timestamp
+        * @return string MW timestamp
         */
        public function getEarliestRevTime( $flags = 0 ) {
                $rev = $this->getFirstRevision( $flags );
@@ -4304,7 +4302,7 @@ class Title {
         * @param int|Revision $old Old revision or rev ID (first before range)
         * @param int|Revision $new New revision or rev ID (first after range)
         * @param int|null $max Limit of Revisions to count, will be incremented to detect truncations
-        * @return Int Number of revisions between these revisions.
+        * @return int Number of revisions between these revisions.
         */
        public function countRevisionsBetween( $old, $new, $max = null ) {
                if ( !( $old instanceof Revision ) ) {
@@ -4430,8 +4428,8 @@ class Title {
        /**
         * Compare with another title.
         *
-        * @param $title Title
-        * @return Bool
+        * @param Title $title
+        * @return bool
         */
        public function equals( Title $title ) {
                // Note: === is necessary for proper matching of number-like titles.
@@ -4443,8 +4441,8 @@ class Title {
        /**
         * Check if this title is a subpage of another title
         *
-        * @param $title Title
-        * @return Bool
+        * @param Title $title
+        * @return bool
         */
        public function isSubpageOf( Title $title ) {
                return $this->getInterwiki() === $title->getInterwiki()
@@ -4459,7 +4457,7 @@ class Title {
         * If you want to know if a title can be meaningfully viewed, you should
         * probably call the isKnown() method instead.
         *
-        * @return Bool
+        * @return bool
         */
        public function exists() {
                return $this->getArticleID() != 0;
@@ -4479,7 +4477,7 @@ class Title {
         * existing code, but we might want to add an optional parameter to skip
         * it and any other expensive checks.)
         *
-        * @return Bool
+        * @return bool
         */
        public function isAlwaysKnown() {
                $isKnown = null;
@@ -4492,7 +4490,7 @@ class Title {
                 * @since 1.20
                 *
                 * @param Title $title
-                * @param boolean|null $isKnown
+                * @param bool|null $isKnown
                 */
                wfRunHooks( 'TitleIsAlwaysKnown', array( $this, &$isKnown ) );
 
@@ -4532,7 +4530,7 @@ class Title {
         * since LinkHolderArray calls isAlwaysKnown() and does its own
         * page existence check.
         *
-        * @return Bool
+        * @return bool
         */
        public function isKnown() {
                return $this->isAlwaysKnown() || $this->exists();
@@ -4541,7 +4539,7 @@ class Title {
        /**
         * Does this page have source text?
         *
-        * @return Boolean
+        * @return bool
         */
        public function hasSourceText() {
                if ( $this->exists() ) {
@@ -4565,7 +4563,7 @@ class Title {
        /**
         * Get the default message text or false if the message doesn't exist
         *
-        * @return String or false
+        * @return string|bool
         */
        public function getDefaultMessageText() {
                global $wgContLang;
@@ -4587,7 +4585,7 @@ class Title {
        /**
         * Updates page_touched for this page; called from LinksUpdate.php
         *
-        * @return Bool true if the update succeeded
+        * @return bool True if the update succeeded
         */
        public function invalidateCache() {
                if ( wfReadOnly() ) {
@@ -4627,8 +4625,8 @@ class Title {
        /**
         * Get the last touched timestamp
         *
-        * @param $db DatabaseBase: optional db
-        * @return String last-touched timestamp
+        * @param DatabaseBase $db Optional db
+        * @return string Last-touched timestamp
         */
        public function getTouched( $db = null ) {
                $db = isset( $db ) ? $db : wfGetDB( DB_SLAVE );
@@ -4639,8 +4637,8 @@ class Title {
        /**
         * Get the timestamp when this page was updated since the user last saw it.
         *
-        * @param $user User
-        * @return String|Null
+        * @param User $user
+        * @return string|null
         */
        public function getNotificationTimestamp( $user = null ) {
                global $wgUser, $wgShowUpdatedMarker;
@@ -4678,8 +4676,8 @@ class Title {
        /**
         * Generate strings used for xml 'id' names in monobook tabs
         *
-        * @param string $prepend defaults to 'nstab-'
-        * @return String XML 'id' name
+        * @param string $prepend Defaults to 'nstab-'
+        * @return string XML 'id' name
         */
        public function getNamespaceKey( $prepend = 'nstab-' ) {
                global $wgContLang;
@@ -4709,7 +4707,7 @@ class Title {
        /**
         * Get all extant redirects to this Title
         *
-        * @param int|Null $ns Single namespace to consider; NULL to consider all namespaces
+        * @param int|null $ns Single namespace to consider; NULL to consider all namespaces
         * @return Title[] Array of Title redirects to this title
         */
        public function getRedirectsHere( $ns = null ) {
@@ -4746,7 +4744,7 @@ class Title {
        /**
         * Check if this Title is a valid redirect target
         *
-        * @return Bool
+        * @return bool
         */
        public function isValidRedirectTarget() {
                global $wgInvalidRedirectTargets;
@@ -4777,7 +4775,7 @@ class Title {
        /**
         * Whether the magic words __INDEX__ and __NOINDEX__ function for  this page.
         *
-        * @return Boolean
+        * @return bool
         */
        public function canUseNoindex() {
                global $wgContentNamespaces, $wgExemptFromUserRobotsControl;
@@ -4887,7 +4885,7 @@ class Title {
         *
         * @since 1.21
         * @param int $oldid Revision ID that's being edited
-        * @return Array
+        * @return array
         */
        public function getEditNotices( $oldid = 0 ) {
                $notices = array();
index 4aea69f..f5768af 100644 (file)
@@ -241,7 +241,7 @@ class User {
        private $mBlockedFromCreateAccount = false;
 
        /**
-        * @var Array
+        * @var array
         */
        private $mWatchedItems = array();
 
@@ -448,8 +448,8 @@ class User {
         * Create a new user object using data from session or cookies. If the
         * login credentials are invalid, the result is an anonymous user.
         *
-        * @param WebRequest $request Object to use; $wgRequest will be used if omitted.
-        * @return User object
+        * @param WebRequest|null $request Object to use; $wgRequest will be used if omitted.
+        * @return User
         */
        public static function newFromSession( WebRequest $request = null ) {
                $user = new User;
@@ -659,7 +659,7 @@ class User {
         * Additional blacklisting may be added here rather than in
         * isValidUserName() to avoid disrupting existing accounts.
         *
-        * @param string $name to match
+        * @param string $name String to match
         * @return bool
         */
        public static function isCreatableName( $name ) {
@@ -702,7 +702,7 @@ class User {
         * Given unvalidated password input, return error message on failure.
         *
         * @param string $password Desired password
-        * @return mixed: true on success, string or array of error message on failure
+        * @return bool|string|array true on success, string or array of error message on failure
         */
        public function getPasswordValidity( $password ) {
                $result = $this->checkPasswordValidity( $password );
@@ -776,7 +776,7 @@ class User {
        /**
         * Expire a user's password
         * @since 1.23
-        * @param $ts Mixed: optional timestamp to convert, default 0 for the current time
+        * @param int $ts Optional timestamp to convert, default 0 for the current time
         */
        public function expirePassword( $ts = 0 ) {
                $this->load();
@@ -788,7 +788,7 @@ class User {
        /**
         * Clear the password expiration for a user
         * @since 1.23
-        * @param bool $load ensure user object is loaded first
+        * @param bool $load Ensure user object is loaded first
         */
        public function resetPasswordExpiration( $load = true ) {
                global $wgPasswordExpirationDays;
@@ -833,7 +833,7 @@ class User {
         * the cached User object, we assume that whatever mechanism is setting
         * the expiration date is also expiring the User cache.
         * @since 1.23
-        * @return string|false the datestamp of the expiration, or null if not set
+        * @return string|bool The datestamp of the expiration, or null if not set
         */
        public function getPasswordExpireDate() {
                $this->load();
@@ -876,11 +876,11 @@ class User {
         * Given unvalidated user input, return a canonical username, or false if
         * the username is invalid.
         * @param string $name User input
-        * @param string|bool $validate type of validation to use:
-        *                - false        No validation
-        *                - 'valid'      Valid for batch processes
-        *                - 'usable'     Valid for batch processes and login
-        *                - 'creatable'  Valid for batch processes, login and account creation
+        * @param string|bool $validate Type of validation to use:
+        *   - false        No validation
+        *   - 'valid'      Valid for batch processes
+        *   - 'usable'     Valid for batch processes and login
+        *   - 'creatable'  Valid for batch processes, login and account creation
         *
         * @throws MWException
         * @return bool|string
@@ -970,7 +970,7 @@ class User {
         * @note This no longer clears uncached lazy-initialised properties;
         *       the constructor does that instead.
         *
-        * @param $name string|bool
+        * @param string|bool $name
         */
        public function loadDefaults( $name = false ) {
                wfProfileIn( __METHOD__ );
@@ -1008,14 +1008,14 @@ class User {
        /**
         * Return whether an item has been loaded.
         *
-        * @param string $item item to check. Current possibilities:
-        *              - id
-        *              - name
-        *              - realname
+        * @param string $item Item to check. Current possibilities:
+        *   - id
+        *   - name
+        *   - realname
         * @param string $all 'all' to check if the whole object has been loaded
-        *        or any other string to check if only the item is available (e.g.
-        *        for optimisation)
-        * @return boolean
+        *   or any other string to check if only the item is available (e.g.
+        *   for optimisation)
+        * @return bool
         */
        public function isItemLoaded( $item, $all = 'all' ) {
                return ( $this->mLoadedItems === true && $all === 'all' ) ||
@@ -1113,8 +1113,8 @@ class User {
 
        /**
         * A comparison of two strings, not vulnerable to timing attacks
-        * @param string $answer the secret string that you are comparing against.
-        * @param string $test compare this string to the $answer.
+        * @param string $answer The secret string that you are comparing against.
+        * @param string $test Compare this string to the $answer.
         * @return bool True if the strings are the same, false otherwise
         */
        protected function compareSecrets( $answer, $test ) {
@@ -1247,7 +1247,7 @@ class User {
        /**
         * Load the data for this user object from another user object.
         *
-        * @param $user User
+        * @param User $user
         */
        protected function loadFromUserObject( $user ) {
                $user->load();
@@ -1283,7 +1283,7 @@ class User {
         *   will not be re-added automatically. The user will also not lose the
         *   group if they no longer meet the criteria.
         *
-        * @param string $event key in $wgAutopromoteOnce (each one has groups/criteria)
+        * @param string $event Key in $wgAutopromoteOnce (each one has groups/criteria)
         *
         * @return array Array of groups the user has been promoted to.
         *
@@ -1327,8 +1327,7 @@ class User {
         * data (i.e. self::$mCacheVars) is not cleared unless $reloadFrom is given.
         *
         * @param bool|string $reloadFrom Reload user and user_groups table data from a
-        *   given source. May be "name", "id", "defaults", "session", or false for
-        *   no reload.
+        *   given source. May be "name", "id", "defaults", "session", or false for no reload.
         */
        public function clearInstanceCache( $reloadFrom = false ) {
                $this->mNewtalk = -1;
@@ -1353,7 +1352,7 @@ class User {
         * Combine the language default options with any site-specific options
         * and add the default language variants.
         *
-        * @return Array of String options
+        * @return array Array of String options
         */
        public static function getDefaultOptions() {
                global $wgNamespacesToBeSearchedDefault, $wgDefaultUserOptions, $wgContLang, $wgDefaultSkin;
@@ -1399,10 +1398,9 @@ class User {
 
        /**
         * Get blocking information
-        * @param bool $bFromSlave Whether to check the slave database first. To
-        *                    improve performance, non-critical checks are done
-        *                    against slaves. Check when actually saving should be
-        *                    done against master.
+        * @param bool $bFromSlave Whether to check the slave database first.
+        *   To improve performance, non-critical checks are done against slaves.
+        *   Check when actually saving should be done against master.
         */
        private function getBlockedStatus( $bFromSlave = true ) {
                global $wgProxyWhitelist, $wgUser, $wgApplyIpBlocksToXff;
@@ -1493,7 +1491,7 @@ class User {
         * Whether the given IP is in a DNS blacklist.
         *
         * @param string $ip IP to check
-        * @param bool $checkWhitelist whether to check the whitelist first
+        * @param bool $checkWhitelist Whether to check the whitelist first
         * @return bool True if blacklisted.
         */
        public function isDnsBlacklisted( $ip, $checkWhitelist = false ) {
@@ -1516,7 +1514,7 @@ class User {
         * Whether the given IP is in a given DNS blacklist.
         *
         * @param string $ip IP to check
-        * @param string|array $bases of Strings: URL of the DNS blacklist
+        * @param string|array $bases Array of Strings: URL of the DNS blacklist
         * @return bool True if blacklisted.
         */
        public function inDnsBlacklist( $ip, $bases ) {
@@ -1562,7 +1560,7 @@ class User {
        /**
         * Check if an IP address is in the local proxy list
         *
-        * @param $ip string
+        * @param string $ip
         *
         * @return bool
         */
@@ -1617,7 +1615,7 @@ class User {
         * last-hit counters will be shared across wikis.
         *
         * @param string $action Action to enforce; 'edit' if unspecified
-        * @param integer $incrBy Positive amount to increment counter by [defaults to 1]
+        * @param int $incrBy Positive amount to increment counter by [defaults to 1]
         * @return bool True if a rate limiter was tripped
         */
        public function pingLimiter( $action = 'edit', $incrBy = 1 ) {
@@ -1745,7 +1743,7 @@ class User {
         * Check if user is blocked from editing a particular article
         *
         * @param Title $title Title to check
-        * @param bool $bFromSlave whether to check the slave database instead of the master
+        * @param bool $bFromSlave Whether to check the slave database instead of the master
         * @return bool
         */
        public function isBlockedFrom( $title, $bFromSlave = false ) {
@@ -1971,7 +1969,7 @@ class User {
         * If there are no new messages, it returns an empty array.
         * @note This function was designed to accomodate multiple talk pages, but
         * currently only returns a single link and revision.
-        * @return Array
+        * @return array
         */
        public function getNewMessageLinks() {
                $talks = array();
@@ -2038,7 +2036,7 @@ class User {
         * Add or update the new messages flag
         * @param string $field 'user_ip' for anonymous users, 'user_id' otherwise
         * @param string|int $id User's IP address for anonymous users, User ID otherwise
-        * @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null.
+        * @param Revision|null $curRev New, as yet unseen revision of the user talk page. Ignored if null.
         * @return bool True if successful, false otherwise
         */
        protected function updateNewtalk( $field, $id, $curRev = null ) {
@@ -2083,7 +2081,7 @@ class User {
        /**
         * Update the 'You have new messages!' status.
         * @param bool $val Whether the user has new messages
-        * @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null or !$val.
+        * @param Revision $curRev New, as yet unseen revision of the user talk page. Ignored if null or !$val.
         */
        public function setNewtalk( $val, $curRev = null ) {
                if ( wfReadOnly() ) {
@@ -2190,7 +2188,7 @@ class User {
 
        /**
         * Get the user touched timestamp
-        * @return string timestamp
+        * @return string Timestamp
         */
        public function getTouched() {
                $this->load();
@@ -2296,7 +2294,7 @@ class User {
        /**
         * Set the password for a password reminder or new account email
         *
-        * @param $str New password to set or null to set an invalid
+        * @param string $str New password to set or null to set an invalid
         *  password hash meaning that the user will not be able to use it
         * @param bool $throttle If true, reset the throttle timestamp to the present
         */
@@ -2603,8 +2601,8 @@ class User {
         * See User::listOptionKinds for the list of valid option types that can be provided.
         *
         * @see User::listOptionKinds
-        * @param $context IContextSource
-        * @param array $options assoc. array with options keys to check as keys. Defaults to $this->mOptions.
+        * @param IContextSource $context
+        * @param array $options Assoc. array with options keys to check as keys. Defaults to $this->mOptions.
         * @return array the key => kind mapping data
         */
        public function getOptionKinds( IContextSource $context, $options = null ) {
@@ -2684,10 +2682,10 @@ class User {
         * Supported values are everything that can be reported by getOptionKinds()
         * and 'all', which forces a reset of *all* preferences and overrides everything else.
         *
-        * @param array|string $resetKinds which kinds of preferences to reset. Defaults to
+        * @param array|string $resetKinds Which kinds of preferences to reset. Defaults to
         *  array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' )
         *  for backwards-compatibility.
-        * @param $context IContextSource|null context source used when $resetKinds
+        * @param IContextSource|null $context Context source used when $resetKinds
         *  does not contain 'all', passed to getOptionKinds().
         *  Defaults to RequestContext::getMain() when null.
         */
@@ -2786,7 +2784,7 @@ class User {
 
        /**
         * Get the permissions this user has.
-        * @return Array of String permission names
+        * @return array Array of String permission names
         */
        public function getRights() {
                if ( is_null( $this->mRights ) ) {
@@ -2801,7 +2799,7 @@ class User {
        /**
         * Get the list of explicit group memberships this user has.
         * The implicit * and user groups are not included.
-        * @return Array of String internal group names
+        * @return array Array of String internal group names
         */
        public function getGroups() {
                $this->load();
@@ -2814,7 +2812,7 @@ class User {
         * This includes all explicit groups, plus 'user' if logged in,
         * '*' for all accounts, and autopromoted groups
         * @param bool $recache Whether to avoid the cache
-        * @return Array of String internal group names
+        * @return array Array of String internal group names
         */
        public function getEffectiveGroups( $recache = false ) {
                if ( $recache || is_null( $this->mEffectiveGroups ) ) {
@@ -2837,7 +2835,7 @@ class User {
         * This includes 'user' if logged in, '*' for all accounts,
         * and autopromoted groups
         * @param bool $recache Whether to avoid the cache
-        * @return Array of String internal group names
+        * @return array Array of String internal group names
         */
        public function getAutomaticGroups( $recache = false ) {
                if ( $recache || is_null( $this->mImplicitGroups ) ) {
@@ -2887,7 +2885,7 @@ class User {
 
        /**
         * Get the user's edit count.
-        * @return int, null for anonymous users
+        * @return int|null null for anonymous users
         */
        public function getEditCount() {
                if ( !$this->getId() ) {
@@ -3001,7 +2999,7 @@ class User {
         * Check if user is allowed to access a feature / make an action
         *
         * @internal param \String $varargs permissions to test
-        * @return boolean: True if user is allowed to perform *any* of the given actions
+        * @return bool True if user is allowed to perform *any* of the given actions
         *
         * @return bool
         */
@@ -3053,7 +3051,7 @@ class User {
 
        /**
         * Check whether to enable recent changes patrol features for this user
-        * @return boolean: True or false
+        * @return bool True or false
         */
        public function useRCPatrol() {
                global $wgUseRCPatrol;
@@ -3101,8 +3099,8 @@ class User {
         * Get a WatchedItem for this user and $title.
         *
         * @since 1.22 $checkRights parameter added
-        * @param $title Title
-        * @param $checkRights int Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
+        * @param Title $title
+        * @param int $checkRights Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
         *     Pass WatchedItem::CHECK_USER_RIGHTS or WatchedItem::IGNORE_USER_RIGHTS.
         * @return WatchedItem
         */
@@ -3124,8 +3122,8 @@ class User {
        /**
         * Check the watched status of an article.
         * @since 1.22 $checkRights parameter added
-        * @param $title Title of the article to look at
-        * @param $checkRights int Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
+        * @param Title $title Title of the article to look at
+        * @param int $checkRights Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
         *     Pass WatchedItem::CHECK_USER_RIGHTS or WatchedItem::IGNORE_USER_RIGHTS.
         * @return bool
         */
@@ -3136,8 +3134,8 @@ class User {
        /**
         * Watch an article.
         * @since 1.22 $checkRights parameter added
-        * @param $title Title of the article to look at
-        * @param $checkRights int Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
+        * @param Title $title Title of the article to look at
+        * @param int $checkRights Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
         *     Pass WatchedItem::CHECK_USER_RIGHTS or WatchedItem::IGNORE_USER_RIGHTS.
         */
        public function addWatch( $title, $checkRights = WatchedItem::CHECK_USER_RIGHTS ) {
@@ -3148,8 +3146,8 @@ class User {
        /**
         * Stop watching an article.
         * @since 1.22 $checkRights parameter added
-        * @param $title Title of the article to look at
-        * @param $checkRights int Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
+        * @param Title $title Title of the article to look at
+        * @param int $checkRights Whether to check 'viewmywatchlist'/'editmywatchlist' rights.
         *     Pass WatchedItem::CHECK_USER_RIGHTS or WatchedItem::IGNORE_USER_RIGHTS.
         */
        public function removeWatch( $title, $checkRights = WatchedItem::CHECK_USER_RIGHTS ) {
@@ -3162,7 +3160,7 @@ class User {
         * If e-notif e-mails are on, they will receive notification mails on
         * the next change of the page if it's watched etc.
         * @note If the user doesn't have 'editmywatchlist', this will do nothing.
-        * @param $title Title of the article to look at
+        * @param Title $title Title of the article to look at
         * @param int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.
         */
        public function clearNotification( &$title, $oldid = 0 ) {
@@ -3316,7 +3314,7 @@ class User {
        /**
         * Set the default cookies for this session on the user's client.
         *
-        * @param $request WebRequest object to use; $wgRequest will be used if null
+        * @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
         *        is passed.
         * @param bool $secure Whether to force secure/insecure cookies or use default
         * @param bool $rememberMe Whether to add a Token cookie for elongated sessions
@@ -3479,7 +3477,7 @@ class User {
         * Add a user to the database, return the user object
         *
         * @param string $name Username to add
-        * @param array $params of Strings Non-default parameters to save to the database as user_* fields:
+        * @param array $params Array of Strings Non-default parameters to save to the database as user_* fields:
         *   - password             The user's password hash. Password logins will be disabled if this is omitted.
         *   - newpassword          Hash for a temporary password that has been mailed to the user
         *   - email                The user's email address
@@ -3489,7 +3487,7 @@ class User {
         *   - token                Random authentication token. Do not set.
         *   - registration         Registration timestamp. Do not set.
         *
-        * @return User object, or null if the username already exists
+        * @return User|null User object, or null if the username already exists
         */
        public static function createNew( $name, $params = array() ) {
                $user = new User;
@@ -3685,7 +3683,7 @@ class User {
        /**
         * Get this user's personal page title.
         *
-        * @return Title: User's personal page title
+        * @return Title User's personal page title
         */
        public function getUserPage() {
                return Title::makeTitle( NS_USER, $this->getName() );
@@ -3694,7 +3692,7 @@ class User {
        /**
         * Get this user's talk page title.
         *
-        * @return Title: User's talk page title
+        * @return Title User's talk page title
         */
        public function getTalkPage() {
                $title = $this->getUserPage();
@@ -3713,7 +3711,7 @@ class User {
        /**
         * Check to see if the given clear-text password is one of the accepted passwords
         * @param string $password user password.
-        * @return boolean: True if the given password is correct, otherwise False.
+        * @return bool True if the given password is correct, otherwise False.
         */
        public function checkPassword( $password ) {
                global $wgAuth, $wgLegacyEncoding;
@@ -3751,9 +3749,9 @@ class User {
         * Check if the given clear-text password matches the temporary password
         * sent by e-mail for password reset operations.
         *
-        * @param $plaintext string
+        * @param string $plaintext
         *
-        * @return boolean: True if matches, false otherwise
+        * @return bool True if matches, false otherwise
         */
        public function checkTemporaryPassword( $plaintext ) {
                global $wgNewPasswordExpiry;
@@ -3775,7 +3773,7 @@ class User {
         * @deprecated since 1.19, use getEditToken instead.
         *
         * @param string|array $salt of Strings Optional function-specific data for hashing
-        * @param $request WebRequest object to use or null to use $wgRequest
+        * @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
         * @return string The new edit token
         */
        public function editToken( $salt = '', $request = null ) {
@@ -3792,7 +3790,7 @@ class User {
         * @since 1.19
         *
         * @param string|array $salt of Strings Optional function-specific data for hashing
-        * @param $request WebRequest object to use or null to use $wgRequest
+        * @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
         * @return string The new edit token
         */
        public function getEditToken( $salt = '', $request = null ) {
@@ -3833,8 +3831,8 @@ class User {
         *
         * @param string $val Input value to compare
         * @param string $salt Optional function-specific data for hashing
-        * @param WebRequest $request Object to use or null to use $wgRequest
-        * @return boolean: Whether the token matches
+        * @param WebRequest|null $request Object to use or null to use $wgRequest
+        * @return bool Whether the token matches
         */
        public function matchEditToken( $val, $salt = '', $request = null ) {
                $sessionToken = $this->getEditToken( $salt, $request );
@@ -3850,8 +3848,8 @@ class User {
         *
         * @param string $val Input value to compare
         * @param string $salt Optional function-specific data for hashing
-        * @param WebRequest $request object to use or null to use $wgRequest
-        * @return boolean: Whether the token matches
+        * @param WebRequest|null $request object to use or null to use $wgRequest
+        * @return bool Whether the token matches
         */
        public function matchEditTokenNoSuffix( $val, $salt = '', $request = null ) {
                $sessionToken = $this->getEditToken( $salt, $request );
@@ -3862,8 +3860,8 @@ class User {
         * Generate a new e-mail confirmation token and send a confirmation/invalidation
         * mail to the user's given address.
         *
-        * @param string $type message to send, either "created", "changed" or "set"
-        * @return Status object
+        * @param string $type Message to send, either "created", "changed" or "set"
+        * @return Status
         */
        public function sendConfirmationMail( $type = 'created' ) {
                global $wgLang;
@@ -3923,7 +3921,7 @@ class User {
         * @note Call saveSettings() after calling this function to commit
         * this change to the database.
         *
-        * @param &$expiration \mixed Accepts the expiration time
+        * @param string &$expiration Accepts the expiration time
         * @return string New token
         */
        protected function confirmationToken( &$expiration ) {
@@ -4126,8 +4124,8 @@ class User {
        /**
         * Get the permissions associated with a given list of groups
         *
-        * @param array $groups of Strings List of internal group names
-        * @return Array of Strings List of permission key names for given groups combined
+        * @param array $groups Array of Strings List of internal group names
+        * @return array Array of Strings List of permission key names for given groups combined
         */
        public static function getGroupPermissions( $groups ) {
                global $wgGroupPermissions, $wgRevokePermissions;
@@ -4154,7 +4152,7 @@ class User {
         * Get all the groups who have a given permission
         *
         * @param string $role Role to check
-        * @return Array of Strings List of internal group names with the given permission
+        * @return array Array of Strings List of internal group names with the given permission
         */
        public static function getGroupsWithPermission( $role ) {
                global $wgGroupPermissions;
@@ -4252,7 +4250,7 @@ class User {
         * Return the set of defined explicit groups.
         * The implicit groups (by default *, 'user' and 'autoconfirmed')
         * are not included, as they are defined automatically, not in the database.
-        * @return Array of internal group names
+        * @return array Array of internal group names
         */
        public static function getAllGroups() {
                global $wgGroupPermissions, $wgRevokePermissions;
@@ -4264,7 +4262,7 @@ class User {
 
        /**
         * Get a list of all available permissions.
-        * @return Array of permission names
+        * @return array Array of permission names
         */
        public static function getAllRights() {
                if ( self::$mAllRights === false ) {
@@ -4281,7 +4279,7 @@ class User {
 
        /**
         * Get a list of implicit groups
-        * @return Array of Strings Array of internal group names
+        * @return array Array of Strings Array of internal group names
         */
        public static function getImplicitGroups() {
                global $wgImplicitGroups;
@@ -4351,8 +4349,8 @@ class User {
        /**
         * Returns an array of the groups that a particular group can add/remove.
         *
-        * @param string $group the group to check for whether it can add/remove
-        * @return Array array( 'add' => array( addablegroups ),
+        * @param string $group The group to check for whether it can add/remove
+        * @return array array( 'add' => array( addablegroups ),
         *     'remove' => array( removablegroups ),
         *     'add-self' => array( addablegroups to self),
         *     'remove-self' => array( removable groups from self) )
@@ -4416,7 +4414,7 @@ class User {
 
        /**
         * Returns an array of groups that this user can add and remove
-        * @return Array array( 'add' => array( addablegroups ),
+        * @return array array( 'add' => array( addablegroups ),
         *  'remove' => array( removablegroups ),
         *  'add-self' => array( addablegroups to self),
         *  'remove-self' => array( removable groups from self) )
@@ -4495,8 +4493,8 @@ class User {
        /**
         * Initialize user_editcount from data out of the revision table
         *
-        * @param $add Integer Edits to add to the count from the revision table
-        * @return integer Number of edits
+        * @param int $add Edits to add to the count from the revision table
+        * @return int Number of edits
         */
        protected function initEditCount( $add = 0 ) {
                // Pull from a slave to be less cruel to servers
@@ -4583,7 +4581,7 @@ class User {
         * @param string $password Plain-text password to compare
         * @param string|bool $userId User ID for old-style password salt
         *
-        * @return boolean
+        * @return bool
         */
        public static function comparePasswords( $hash, $password, $userId = false ) {
                $type = substr( $hash, 0, 3 );
@@ -4610,7 +4608,7 @@ class User {
         * Add a newuser log entry for this user.
         * Before 1.19 the return value was always true.
         *
-        * @param string|bool $action account creation type.
+        * @param string|bool $action Account creation type.
         *   - String, one of the following values:
         *     - 'create' for an anonymous user creating an account for himself.
         *       This will force the action's performer to be the created user itself,
@@ -4623,7 +4621,7 @@ class User {
         *     - false will be converted to 'create' if this object is the same as
         *       $wgUser and to 'create2' otherwise
         *
-        * @param string $reason user supplied reason
+        * @param string $reason User supplied reason
         *
         * @return int|bool True if not $wgNewUserLog; otherwise ID of log item or 0 on failure
         */
index bbc2339..4c844c3 100644 (file)
     "watchlist-details": "{{PLURAL:$1|$1 page|$1 pages}} on your watchlist, not separately counting talk pages.",
     "wlheader-enotif": "Email notification is enabled.",
     "wlheader-showupdated": "Pages that have been changed since you last visited them are shown in <strong>bold</strong>.",
-    "watchmethod-recent": "checking recent edits for watched pages",
-    "watchmethod-list": "checking watched pages for recent edits",
-    "watchlistcontains": "Your watchlist contains $1 {{PLURAL:$1|page|pages}}.",
-    "iteminvalidname": "Problem with item \"$1\", invalid name...",
     "wlnote2": "Below are the changes in the last {{PLURAL:$1|hour|<strong>$1</strong> hours}}, as of $2, $3.",
     "wlshowlast": "Show last $1 hours $2 days $3",
     "watchlist-options": "Watchlist options",
     "lag-warn-normal": "Changes newer than $1 {{PLURAL:$1|second|seconds}} may not be shown in this list.",
     "lag-warn-high": "Due to high database server lag, changes newer than $1 {{PLURAL:$1|second|seconds}} may not be shown in this list.",
     "editwatchlist-summary": "",
-    "watchlistedit-numitems": "Your watchlist contains {{PLURAL:$1|1 title|$1 titles}}, excluding talk pages.",
-    "watchlistedit-noitems": "Your watchlist contains no titles.",
     "watchlistedit-normal-title": "Edit watchlist",
     "watchlistedit-normal-legend": "Remove titles from watchlist",
     "watchlistedit-normal-explain": "Titles on your watchlist are shown below.\nTo remove a title, check the box next to it, and click \"{{int:Watchlistedit-normal-submit}}\".\nYou can also [[Special:EditWatchlist/raw|edit the raw list]].",
index f33ff40..3929a5b 100644 (file)
@@ -47,11 +47,31 @@ class CompareParsers extends DumpIterator {
                $this->addOption( 'parser1', 'The first parser to compare.', true, true );
                $this->addOption( 'parser2', 'The second parser to compare.', true, true );
                $this->addOption( 'tidy', 'Run tidy on the articles.', false, false );
-               $this->addOption( 'save-failed', 'Folder in which articles which differ will be stored.', false, true );
+               $this->addOption(
+                       'save-failed',
+                       'Folder in which articles which differ will be stored.',
+                       false,
+                       true
+               );
                $this->addOption( 'show-diff', 'Show a diff of the two renderings.', false, false );
-               $this->addOption( 'diff-bin', 'Binary to use for diffing (can also be provided by DIFF env var).', false, false );
-               $this->addOption( 'strip-parameters', 'Remove parameters of html tags to increase readability.', false, false );
-               $this->addOption( 'show-parsed-output', 'Show the parsed html if both Parsers give the same output.', false, false );
+               $this->addOption(
+                       'diff-bin',
+                       'Binary to use for diffing (can also be provided by DIFF env var).',
+                       false,
+                       false
+               );
+               $this->addOption(
+                       'strip-parameters',
+                       'Remove parameters of html tags to increase readability.',
+                       false,
+                       false
+               );
+               $this->addOption(
+                       'show-parsed-output',
+                       'Show the parsed html if both Parsers give the same output.',
+                       false,
+                       false
+               );
        }
 
        public function checkOptions() {
@@ -118,7 +138,9 @@ class CompareParsers extends DumpIterator {
                $content = $rev->getContent();
 
                if ( $content->getModel() !== CONTENT_MODEL_WIKITEXT ) {
-                       $this->error( "Page {$title->getPrefixedText()} does not contain wikitext but {$content->getModel()}\n" );
+                       $this->error( "Page {$title->getPrefixedText()} does not contain wikitext "
+                               . "but {$content->getModel()}\n" );
+
                        return;
                }
 
@@ -132,13 +154,21 @@ class CompareParsers extends DumpIterator {
                        $this->error( "Parsing for {$title->getPrefixedText()} differs\n" );
 
                        if ( $this->saveFailed ) {
-                               file_put_contents( $this->saveFailed . '/' . rawurlencode( $title->getPrefixedText() ) . ".txt", $text );
+                               file_put_contents(
+                                       $this->saveFailed . '/' . rawurlencode( $title->getPrefixedText() ) . ".txt",
+                                       $text
+                               );
                        }
                        if ( $this->showDiff ) {
-                               $this->output( wfDiff( $this->stripParameters( $output1->getText() ), $this->stripParameters( $output2->getText() ), '' ) );
+                               $this->output( wfDiff(
+                                       $this->stripParameters( $output1->getText() ),
+                                       $this->stripParameters( $output2->getText() ),
+                                       ''
+                               ) );
                        }
                } else {
                        $this->output( $title->getPrefixedText() . "\tOK\n" );
+
                        if ( $this->showParsedOutput ) {
                                $this->output( $this->stripParameters( $output1->getText() ) );
                        }
index 6e6df24..6840a01 100644 (file)
@@ -36,14 +36,29 @@ class ConvertLinks extends Maintenance {
 
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Convert from the old links schema (string->ID) to the new schema (ID->ID).
-The wiki should be put into read-only mode while this script executes";
+               $this->mDescription =
+                       "Convert from the old links schema (string->ID) to the new schema (ID->ID)."
+                               . "The wiki should be put into read-only mode while this script executes";
 
                $this->addArg( 'logperformance', "Log performance to perfLogFilename.", false );
-               $this->addArg( 'perfLogFilename', "Filename where performance is logged if --logperformance was set (defaults to 'convLinksPerf.txt').", false );
-               $this->addArg( 'keep-links-table', "Don't overwrite the old links table with the new one, leave the new table at links_temp.", false );
-               $this->addArg( 'nokeys', "Don't create keys, and so allow duplicates in the new links table.\n
-This gives a huge speed improvement for very large links tables which are MyISAM." /* (What about InnoDB?) */, false );
+               $this->addArg(
+                       'perfLogFilename',
+                       "Filename where performance is logged if --logperformance was set "
+                               . "(defaults to 'convLinksPerf.txt').",
+                       false
+               );
+               $this->addArg(
+                       'keep-links-table',
+                       "Don't overwrite the old links table with the new one, leave the new table at links_temp.",
+                       false
+               );
+               $this->addArg(
+                       'nokeys',
+                       /* (What about InnoDB?) */
+                       "Don't create keys, and so allow duplicates in the new links table.\n"
+                               . "This gives a huge speed improvement for very large links tables which are MyISAM.",
+                       false
+               );
        }
 
        public function getDbType() {
@@ -61,17 +76,28 @@ This gives a huge speed improvement for very large links tables which are MyISAM
 
                global $wgContLang;
 
-               $numBadLinks = $curRowsRead = 0; # counters etc
-               $totalTuplesInserted = 0; # total tuples INSERTed into links_temp
+               # counters etc
+               $numBadLinks = $curRowsRead = 0;
 
-               $reportCurReadProgress = true; # whether or not to give progress reports while reading IDs from cur table
-               $curReadReportInterval = 1000; # number of rows between progress reports
+               # total tuples INSERTed into links_temp
+               $totalTuplesInserted = 0;
 
-               $reportLinksConvProgress = true; # whether or not to give progress reports during conversion
-               $linksConvInsertInterval = 1000; # number of rows per INSERT
+               # whether or not to give progress reports while reading IDs from cur table
+               $reportCurReadProgress = true;
+
+               # number of rows between progress reports
+               $curReadReportInterval = 1000;
+
+               # whether or not to give progress reports during conversion
+               $reportLinksConvProgress = true;
+
+               # number of rows per INSERT
+               $linksConvInsertInterval = 1000;
 
                $initialRowOffset = 0;
-               # $finalRowOffset = 0; # not used yet; highest row number from links table to process
+
+               # not used yet; highest row number from links table to process
+               # $finalRowOffset = 0;
 
                $overwriteLinksTable = !$this->hasOption( 'keep-links-table' );
                $noKeys = $this->hasOption( 'noKeys' );
@@ -80,7 +106,8 @@ This gives a huge speed improvement for very large links tables which are MyISAM
 
                # --------------------------------------------------------------------
 
-               list( $cur, $links, $links_temp, $links_backup ) = $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' );
+               list( $cur, $links, $links_temp, $links_backup ) =
+                       $dbw->tableNamesN( 'cur', 'links', 'links_temp', 'links_backup' );
 
                if ( $dbw->tableExists( 'pagelinks' ) ) {
                        $this->output( "...have pagelinks; skipping old links table updates\n" );
@@ -129,7 +156,10 @@ This gives a huge speed improvement for very large links tables which are MyISAM
                                $curRowsRead++;
                                if ( $reportCurReadProgress ) {
                                        if ( ( $curRowsRead % $curReadReportInterval ) == 0 ) {
-                                               $this->performanceLog( $fh, $curRowsRead . " " . ( $this->getMicroTime() - $baseTime ) . "\n" );
+                                               $this->performanceLog(
+                                                       $fh,
+                                                       $curRowsRead . " " . ( $this->getMicroTime() - $baseTime ) . "\n"
+                                               );
                                                $this->output( "\t$curRowsRead rows of $cur table read.\n" );
                                        }
                                }
@@ -137,7 +167,10 @@ This gives a huge speed improvement for very large links tables which are MyISAM
                        $dbw->freeResult( $res );
                        $dbw->bufferResults( true );
                        $this->output( "Finished loading IDs.\n\n" );
-                       $this->performanceLog( $fh, "Took " . ( $this->getMicroTime() - $baseTime ) . " seconds to load IDs.\n\n" );
+                       $this->performanceLog(
+                               $fh,
+                               "Took " . ( $this->getMicroTime() - $baseTime ) . " seconds to load IDs.\n\n"
+                       );
 
                        # --------------------------------------------------------------------
 
@@ -150,7 +183,9 @@ This gives a huge speed improvement for very large links tables which are MyISAM
                        $this->performanceLog( $fh, "Processing $numRows rows from $links table...\n" );
                        $this->performanceLog( $fh, "rows inserted vs seconds elapsed:\n" );
 
-                       for ( $rowOffset = $initialRowOffset; $rowOffset < $numRows; $rowOffset += $linksConvInsertInterval ) {
+                       for ( $rowOffset = $initialRowOffset; $rowOffset < $numRows;
+                               $rowOffset += $linksConvInsertInterval
+                       ) {
                                $sqlRead = "SELECT * FROM $links ";
                                $sqlRead = $dbw->limitResult( $sqlRead, $linksConvInsertInterval, $rowOffset );
                                $res = $dbw->query( $sqlRead );
@@ -176,7 +211,8 @@ This gives a huge speed improvement for very large links tables which are MyISAM
                                        }
                                }
                                $dbw->freeResult( $res );
-                               # $this->output( "rowOffset: $rowOffset\ttuplesAdded: $tuplesAdded\tnumBadLinks: $numBadLinks\n" );
+                               # $this->output( "rowOffset: $rowOffset\ttuplesAdded: "
+                               #       . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" );
                                if ( $tuplesAdded != 0 ) {
                                        if ( $reportLinksConvProgress ) {
                                                $this->output( "Inserting $tuplesAdded tuples into $links_temp..." );
@@ -185,13 +221,23 @@ This gives a huge speed improvement for very large links tables which are MyISAM
                                        $totalTuplesInserted += $tuplesAdded;
                                        if ( $reportLinksConvProgress ) {
                                                $this->output( " done. Total $totalTuplesInserted tuples inserted.\n" );
-                                               $this->performanceLog( $fh, $totalTuplesInserted . " " . ( $this->getMicroTime() - $baseTime ) . "\n" );
+                                               $this->performanceLog(
+                                                       $fh,
+                                                       $totalTuplesInserted . " " . ( $this->getMicroTime() - $baseTime ) . "\n"
+                                               );
                                        }
                                }
                        }
-                       $this->output( "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n\n" );
-                       $this->performanceLog( $fh, "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n" );
-                       $this->performanceLog( $fh, "Total execution time: " . ( $this->getMicroTime() - $startTime ) . " seconds.\n" );
+                       $this->output( "$totalTuplesInserted valid titles and "
+                               . "$numBadLinks invalid titles were processed.\n\n" );
+                       $this->performanceLog(
+                               $fh,
+                               "$totalTuplesInserted valid titles and $numBadLinks invalid titles were processed.\n"
+                       );
+                       $this->performanceLog(
+                               $fh,
+                               "Total execution time: " . ( $this->getMicroTime() - $startTime ) . " seconds.\n"
+                       );
                        if ( $this->logPerformance ) {
                                fclose ( $fh );
                        }
index aa25ee6..a8de640 100644 (file)
@@ -31,13 +31,15 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 class CreateAndPromote extends Maintenance {
-
-       static $permitRoles = array( 'sysop', 'bureaucrat', 'bot' );
+       private static $permitRoles = array( 'sysop', 'bureaucrat', 'bot' );
 
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Create a new user account and/or grant it additional rights";
-               $this->addOption( "force", "If acccount exists already, just grant it rights or change password." );
+               $this->addOption(
+                       'force',
+                       'If acccount exists already, just grant it rights or change password.'
+               );
                foreach ( self::$permitRoles as $role ) {
                        $this->addOption( $role, "Add the account to the {$role} group" );
                }
@@ -67,7 +69,10 @@ class CreateAndPromote extends Maintenance {
                        $inGroups = $user->getGroups();
                }
 
-               $promotions = array_diff( array_filter( self::$permitRoles, array( $this, 'hasOption' ) ), $inGroups );
+               $promotions = array_diff(
+                       array_filter( self::$permitRoles, array( $this, 'hasOption' ) ),
+                       $inGroups
+               );
 
                if ( $exists && !$password && count( $promotions ) === 0 ) {
                        $this->output( "Account exists and nothing to do.\n" );
index ffd581c..30883ba 100644 (file)
@@ -36,7 +36,8 @@ require_once __DIR__ . '/deleteArchivedRevisions.inc';
 class DeleteArchivedRevisions extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Deletes all archived revisions\nThese revisions will no longer be restorable";
+               $this->mDescription =
+                       "Deletes all archived revisions\nThese revisions will no longer be restorable";
                $this->addOption( 'delete', 'Performs the deletion' );
        }
 
@@ -53,7 +54,8 @@ class DeleteArchivedRevisions extends Maintenance {
                        $dbw = wfGetDB( DB_MASTER );
                        $res = $dbw->selectRow( 'archive', 'COUNT(*) as count', array(), __FUNCTION__ );
                        $this->output( "Found {$res->count} revisions to delete.\n" );
-                       $this->output( "Please run the script again with the --delete option to really delete the revisions.\n" );
+                       $this->output( "Please run the script again with the --delete option "
+                               . "to really delete the revisions.\n" );
                }
        }
 }
index c1cc03c..b21d950 100644 (file)
@@ -79,7 +79,9 @@ class DeleteBatch extends Maintenance {
                $dbw = wfGetDB( DB_MASTER );
 
                # Handle each entry
+               // @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
                for ( $linenum = 1; !feof( $file ); $linenum++ ) {
+                       // @codingStandardsIgnoreEnd
                        $line = trim( fgets( $file ) );
                        if ( $line == '' ) {
                                continue;
index 835de35..b44a424 100644 (file)
@@ -60,7 +60,12 @@ class DeleteImageCache extends Maintenance {
 
                foreach ( $res as $row ) {
                        if ( $i % $this->report == 0 ) {
-                               $this->output( sprintf( "%s: %13s done (%s)\n", wfWikiID(), "$i/$total", wfPercent( $i / $total * 100 ) ) );
+                               $this->output( sprintf(
+                                       "%s: %13s done (%s)\n",
+                                       wfWikiID(),
+                                       "$i/$total",
+                                       wfPercent( $i / $total * 100 )
+                               ) );
                        }
                        $md5 = md5( $row->img_name );
                        $wgMemc->delete( wfMemcKey( 'Image', $md5 ) );
index 9922a1d..7f1ffe4 100644 (file)
@@ -49,7 +49,8 @@ class DeleteOrphanedRevisions extends Maintenance {
 
                # Find all the orphaned revisions
                $this->output( "Checking for orphaned revisions..." );
-               $sql = "SELECT rev_id FROM {$revision} LEFT JOIN {$page} ON rev_page = page_id WHERE page_namespace IS NULL";
+               $sql = "SELECT rev_id FROM {$revision} LEFT JOIN {$page} ON rev_page = page_id "
+                       . "WHERE page_namespace IS NULL";
                $res = $dbw->query( $sql, 'deleteOrphanedRevisions' );
 
                # Stash 'em all up for deletion (if needed)
index 6bc0f7c..31f206d 100644 (file)
@@ -70,13 +70,34 @@ class DeleteRevision extends Maintenance {
                                $this->output( "Revision $revID not found\n" );
                        } else {
                                $affected += $dbw->affectedRows();
-                               $pageID = $dbw->selectField( 'revision', 'rev_page', array( 'rev_id' => $revID ), __METHOD__ );
-                               $pageLatest = $dbw->selectField( 'page', 'page_latest', array( 'page_id' => $pageID ), __METHOD__ );
+                               $pageID = $dbw->selectField(
+                                       'revision',
+                                       'rev_page',
+                                       array( 'rev_id' => $revID ),
+                                       __METHOD__
+                               );
+                               $pageLatest = $dbw->selectField(
+                                       'page',
+                                       'page_latest',
+                                       array( 'page_id' => $pageID ),
+                                       __METHOD__
+                               );
                                $dbw->delete( 'revision', array( 'rev_id' => $revID ) );
                                if ( $pageLatest == $revID ) {
                                        // Database integrity
-                                       $newLatest = $dbw->selectField( 'revision', 'rev_id', array( 'rev_page' => $pageID ), __METHOD__, array( 'ORDER BY' => 'rev_timestamp DESC' ) );
-                                       $dbw->update( 'page', array( 'page_latest' => $newLatest ), array( 'page_id' => $pageID ), __METHOD__ );
+                                       $newLatest = $dbw->selectField(
+                                               'revision',
+                                               'rev_id',
+                                               array( 'rev_page' => $pageID ),
+                                               __METHOD__,
+                                               array( 'ORDER BY' => 'rev_timestamp DESC' )
+                                       );
+                                       $dbw->update(
+                                               'page',
+                                               array( 'page_latest' => $newLatest ),
+                                               array( 'page_id' => $pageID ),
+                                               __METHOD__
+                                       );
                                }
                        }
                }
index 2b637cb..47e6a89 100644 (file)
@@ -82,8 +82,10 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
                // @todo FIXME: Replace this hack with general farm-friendly code
                # @todo FIXME: Wikimedia-specific stuff needs to go away to an ext
                # Maybe a hook?
+               // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
                global $cluster;
                $cluster = 'pmtpa';
+               // @codingStandardsIgnoreEnd
                require "$IP/../wmf-config/wgConf.php";
        }
        // Require the configuration (probably LocalSettings.php)
@@ -91,7 +93,10 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
 }
 
 if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
-       if ( $wgLocalisationCacheConf['storeClass'] === false && ( $wgLocalisationCacheConf['store'] == 'db' || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) ) ) {
+       if ( $wgLocalisationCacheConf['storeClass'] === false
+               && ( $wgLocalisationCacheConf['store'] == 'db'
+                       || ( $wgLocalisationCacheConf['store'] == 'detect' && !$wgCacheDirectory ) )
+       ) {
                $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
        }
 }
index cf3523e..078c598 100644 (file)
@@ -57,8 +57,11 @@ abstract class DumpIterator extends Maintenance {
                        $revision = new WikiRevision;
 
                        $revision->setText( file_get_contents( $this->getOption( 'file' ) ) );
-                       $revision->setTitle( Title::newFromText( rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) ) ) );
+                       $revision->setTitle( Title::newFromText(
+                               rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) )
+                       ) );
                        $this->handleRevision( $revision );
+
                        return;
                }
 
@@ -67,7 +70,8 @@ abstract class DumpIterator extends Maintenance {
                if ( $this->getOption( 'dump' ) == '-' ) {
                        $source = new ImportStreamSource( $this->getStdin() );
                } else {
-                       $this->error( "Sorry, I don't support dump filenames yet. Use - and provide it on stdin on the meantime.", true );
+                       $this->error( "Sorry, I don't support dump filenames yet. "
+                               . "Use - and provide it on stdin on the meantime.", true );
                }
                $importer = new WikiImporter( $source );
 
@@ -86,8 +90,9 @@ abstract class DumpIterator extends Maintenance {
                        $this->error( round( $this->count / $delta, 2 ) . " pages/sec" );
                }
 
-               # Perform the memory_get_peak_usage() when all the other data has been output so there's no damage if it dies.
-               # It is only available since 5.2.0 (since 5.2.1 if you haven't compiled with --enable-memory-limit)
+               # Perform the memory_get_peak_usage() when all the other data has been
+               # output so there's no damage if it dies. It is only available since
+               # 5.2.0 (since 5.2.1 if you haven't compiled with --enable-memory-limit)
                $this->error( "Memory peak usage of " . memory_get_peak_usage() . " bytes\n" );
        }
 
index 82c5b95..7c6c824 100644 (file)
@@ -158,7 +158,10 @@ class FindHooks extends Maintenance {
         */
        private function getHooksFromOnlineDoc() {
                        // All hooks
-                       $allhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php' );
+                       $allhookdata = Http::get(
+                               'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&'
+                                       . 'cmtitle=Category:MediaWiki_hooks&cmlimit=500&format=php'
+                       );
                        $allhookdata = unserialize( $allhookdata );
                        $allhooks = array();
                        foreach ( $allhookdata['query']['categorymembers'] as $page ) {
@@ -169,7 +172,10 @@ class FindHooks extends Maintenance {
                                }
                        }
                        // Removed hooks
-                       $oldhookdata = Http::get( 'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:Removed_hooks&cmlimit=500&format=php' );
+                       $oldhookdata = Http::get(
+                               'http://www.mediawiki.org/w/api.php?action=query&list=categorymembers&'
+                                       . 'cmtitle=Category:Removed_hooks&cmlimit=500&format=php'
+                       );
                        $oldhookdata = unserialize( $oldhookdata );
                        $removed = array();
                        foreach ( $oldhookdata['query']['categorymembers'] as $page ) {
@@ -190,7 +196,12 @@ class FindHooks extends Maintenance {
        private function getHooksFromFile( $file ) {
                $content = file_get_contents( $file );
                $m = array();
-               preg_match_all( '/(?:wfRunHooks|Hooks\:\:run|ContentHandler\:\:runLegacyHooks)\(\s*([\'"])(.*?)\1/', $content, $m );
+               preg_match_all(
+                       '/(?:wfRunHooks|Hooks\:\:run|ContentHandler\:\:runLegacyHooks)\(\s*([\'"])(.*?)\1/',
+                       $content,
+                       $m
+               );
+
                return $m[2];
        }
 
index 41458d1..af8a58e 100644 (file)
@@ -106,7 +106,8 @@ class FixDoubleRedirects extends Maintenance {
                        if ( !$async ) {
                                $success = ( $dryrun ? true : $job->run() );
                                if ( !$success ) {
-                                       $this->error( "Error fixing " . $titleA->getPrefixedText() . ": " . $job->getLastError() . "\n" );
+                                       $this->error( "Error fixing " . $titleA->getPrefixedText()
+                                               . ": " . $job->getLastError() . "\n" );
                                }
                        } else {
                                $jobs[] = $job;
index 02d65ed..920b2b0 100644 (file)
@@ -34,7 +34,8 @@ require_once __DIR__ . '/Maintenance.php';
 class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Fixes any entries in the externallinks table containing protocol-relative URLs";
+               $this->mDescription =
+                       "Fixes any entries in the externallinks table containing protocol-relative URLs";
        }
 
        protected function getUpdateKey() {
@@ -79,7 +80,15 @@ class FixExtLinksProtocolRelative extends LoggedUpdateMaintenance {
                                        )
                                ), __METHOD__, array( 'IGNORE' )
                        );
-                       $db->delete( 'externallinks', array( 'el_index' => $row->el_index, 'el_from' => $row->el_from, 'el_to' => $row->el_to ), __METHOD__ );
+                       $db->delete(
+                               'externallinks',
+                               array(
+                                       'el_index' => $row->el_index,
+                                       'el_from' => $row->el_from,
+                                       'el_to' => $row->el_to
+                               ),
+                               __METHOD__
+                       );
                }
                $this->output( "Done, $count rows updated.\n" );
                return true;
index a09a742..cbb2e9d 100644 (file)
@@ -30,6 +30,9 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 class FixSlaveDesync extends Maintenance {
+       /** @var array */
+       private $slaveIndexes;
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "";
@@ -41,7 +44,8 @@ class FixSlaveDesync extends Maintenance {
 
        public function execute() {
                $this->slaveIndexes = array();
-               for ( $i = 1; $i < wfGetLB()->getServerCount(); $i++ ) {
+               $serverCount = wfGetLB()->getServerCount();
+               for ( $i = 1; $i < $serverCount; $i++ ) {
                        if ( wfGetLB()->isNonZeroLoad( $i ) ) {
                                $this->slaveIndexes[] = $i;
                        }
@@ -66,7 +70,12 @@ class FixSlaveDesync extends Maintenance {
                $n = 0;
                $dbw = wfGetDB( DB_MASTER );
                $masterIDs = array();
-               $res = $dbw->select( 'page', array( 'page_id', 'page_latest' ), array( 'page_id<6054123' ), __METHOD__ );
+               $res = $dbw->select(
+                       'page',
+                       array( 'page_id', 'page_latest' ),
+                       array( 'page_id<6054123' ),
+                       __METHOD__
+               );
                $this->output( "Number of pages: " . $res->numRows() . "\n" );
                foreach ( $res as $row ) {
                        $masterIDs[$row->page_id] = $row->page_latest;
@@ -78,7 +87,12 @@ class FixSlaveDesync extends Maintenance {
 
                foreach ( $this->slaveIndexes as $i ) {
                        $db = wfGetDB( $i );
-                       $res = $db->select( 'page', array( 'page_id', 'page_latest' ), array( 'page_id<6054123' ), __METHOD__ );
+                       $res = $db->select(
+                               'page',
+                               array( 'page_id', 'page_latest' ),
+                               array( 'page_id<6054123' ),
+                               __METHOD__
+                       );
                        foreach ( $res as $row ) {
                                if ( isset( $masterIDs[$row->page_id] ) && $masterIDs[$row->page_id] != $row->page_latest ) {
                                        $desync[$row->page_id] = true;
@@ -141,7 +155,8 @@ class FixSlaveDesync extends Maintenance {
                if ( count( $masterIDs ) < count( $slaveIDs ) ) {
                        $missingIDs = array_diff( $slaveIDs, $masterIDs );
                        if ( count( $missingIDs ) ) {
-                               $this->output( "Found " . count( $missingIDs ) . " lost in master, copying from slave... " );
+                               $this->output( "Found " . count( $missingIDs )
+                                       . " lost in master, copying from slave... " );
                                $dbFrom = $dbw;
                                $found = true;
                                $toMaster = true;
@@ -151,7 +166,8 @@ class FixSlaveDesync extends Maintenance {
                } else {
                        $missingIDs = array_diff( $masterIDs, $slaveIDs );
                        if ( count( $missingIDs ) ) {
-                               $this->output( "Found " . count( $missingIDs ) . " missing revision(s), copying from master... " );
+                               $this->output( "Found " . count( $missingIDs )
+                                       . " missing revision(s), copying from master... " );
                                $dbFrom = $dbw;
                                $found = true;
                                $toMaster = false;
@@ -199,11 +215,23 @@ class FixSlaveDesync extends Maintenance {
                if ( $found ) {
                        $this->output( "Fixing page_latest... " );
                        if ( $toMaster ) {
-                               # $dbw->update( 'page', array( 'page_latest' => $realLatest ), array( 'page_id' => $pageID ), __METHOD__ );
+                               /*
+                               $dbw->update(
+                                       'page',
+                                       array( 'page_latest' => $realLatest ),
+                                       array( 'page_id' => $pageID ),
+                                       __METHOD__
+                               );
+                               */
                        } else {
                                foreach ( $this->slaveIndexes as $i ) {
                                        $db = wfGetDB( $i );
-                                       $db->update( 'page', array( 'page_latest' => $realLatest ), array( 'page_id' => $pageID ), __METHOD__ );
+                                       $db->update(
+                                               'page',
+                                               array( 'page_latest' => $realLatest ),
+                                               array( 'page_id' => $pageID ),
+                                               __METHOD__
+                                       );
                                }
                        }
                        $this->output( "done\n" );
index b0609d1..f96a917 100644 (file)
@@ -117,7 +117,8 @@ class FixTimestamps extends Maintenance {
 
                $fixup = -$offset;
                $sql = "UPDATE $revisionTable " .
-                       "SET rev_timestamp=DATE_FORMAT(DATE_ADD(rev_timestamp, INTERVAL $fixup SECOND), '%Y%m%d%H%i%s') " .
+                       "SET rev_timestamp="
+                               . "DATE_FORMAT(DATE_ADD(rev_timestamp, INTERVAL $fixup SECOND), '%Y%m%d%H%i%s') " .
                        "WHERE rev_id IN (" . $dbw->makeList( $badRevs ) . ')';
                $dbw->query( $sql, __METHOD__ );
                $this->output( "Done\n" );
index 097936c..878593c 100644 (file)
@@ -44,10 +44,20 @@ class FixUserRegistration extends Maintenance {
                foreach ( $res as $row ) {
                        $id = $row->user_id;
                        // Get first edit time
-                       $timestamp = $dbr->selectField( 'revision', 'MIN(rev_timestamp)', array( 'rev_user' => $id ), __METHOD__ );
+                       $timestamp = $dbr->selectField(
+                               'revision',
+                               'MIN(rev_timestamp)',
+                               array( 'rev_user' => $id ),
+                               __METHOD__
+                       );
                        // Update
                        if ( !empty( $timestamp ) ) {
-                               $dbw->update( 'user', array( 'user_registration' => $timestamp ), array( 'user_id' => $id ), __METHOD__ );
+                               $dbw->update(
+                                       'user',
+                                       array( 'user_registration' => $timestamp ),
+                                       array( 'user_id' => $id ),
+                                       __METHOD__
+                               );
                                $this->output( "$id $timestamp\n" );
                        } else {
                                $this->output( "$id NULL\n" );
index 959cc8f..b5681c1 100644 (file)
@@ -63,7 +63,8 @@ class GenerateSitemap extends Maintenance {
        public $fspath;
 
        /**
-        * The URL path to prepend to filenames in the index; should resolve to the same directory as $fspath
+        * The URL path to prepend to filenames in the index;
+        * should resolve to the same directory as $fspath.
         *
         * @var string
         */
@@ -145,11 +146,32 @@ class GenerateSitemap extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Creates a sitemap for the site";
-               $this->addOption( 'fspath', 'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory', false, true );
-               $this->addOption( 'urlpath', 'The URL path corresponding to --fspath, prepended to filenames in the index; defaults to an empty string', false, true );
-               $this->addOption( 'compress', 'Compress the sitemap files, can take value yes|no, default yes', false, true );
+               $this->addOption(
+                       'fspath',
+                       'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory',
+                       false,
+                       true
+               );
+               $this->addOption(
+                       'urlpath',
+                       'The URL path corresponding to --fspath, prepended to filenames in the index; '
+                               . 'defaults to an empty string',
+                       false,
+                       true
+               );
+               $this->addOption(
+                       'compress',
+                       'Compress the sitemap files, can take value yes|no, default yes',
+                       false,
+                       true
+               );
                $this->addOption( 'skip-redirects', 'Do not include redirecting articles in the sitemap' );
-               $this->addOption( 'identifier', 'What site identifier to use for the wiki, defaults to $wgDBname', false, true );
+               $this->addOption(
+                       'identifier',
+                       'What site identifier to use for the wiki, defaults to $wgDBname',
+                       false,
+                       true
+               );
        }
 
        /**
@@ -266,7 +288,9 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function priority( $namespace ) {
-               return isset( $this->priorities[$namespace] ) ? $this->priorities[$namespace] : $this->guessPriority( $namespace );
+               return isset( $this->priorities[$namespace] )
+                       ? $this->priorities[$namespace]
+                       : $this->guessPriority( $namespace );
        }
 
        /**
@@ -278,7 +302,9 @@ class GenerateSitemap extends Maintenance {
         * @return string
         */
        function guessPriority( $namespace ) {
-               return MWNamespace::isSubject( $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];
        }
 
        /**
@@ -324,7 +350,10 @@ class GenerateSitemap extends Maintenance {
                                        continue;
                                }
 
-                               if ( $i++ === 0 || $i === $this->url_limit + 1 || $length + $this->limit[1] + $this->limit[2] > $this->size_limit ) {
+                               if ( $i++ === 0
+                                       || $i === $this->url_limit + 1
+                                       || $length + $this->limit[1] + $this->limit[2] > $this->size_limit
+                               ) {
                                        if ( $this->file !== false ) {
                                                $this->write( $this->file, $this->closeFile() );
                                                $this->close( $this->file );
@@ -349,7 +378,11 @@ class GenerateSitemap extends Maintenance {
                                                if ( $vCode == $wgContLang->getCode() ) {
                                                        continue; // we don't want default variant
                                                }
-                                               $entry = $this->fileEntry( $title->getCanonicalURL( '', $vCode ), $date, $this->priority( $namespace ) );
+                                               $entry = $this->fileEntry(
+                                                       $title->getCanonicalURL( '', $vCode ),
+                                                       $date,
+                                                       $this->priority( $namespace )
+                                               );
                                                $length += strlen( $entry );
                                                $this->write( $this->file, $entry );
                                        }
@@ -379,7 +412,8 @@ class GenerateSitemap extends Maintenance {
        function open( $file, $flags ) {
                $resource = $this->compress ? gzopen( $file, $flags ) : fopen( $file, $flags );
                if ( $resource === false ) {
-                       throw new MWException( __METHOD__ . " error opening file $file with flags $flags. Check permissions?" );
+                       throw new MWException( __METHOD__
+                               . " error opening file $file with flags $flags. Check permissions?" );
                }
                return $resource;
        }
@@ -523,7 +557,11 @@ class GenerateSitemap extends Maintenance {
 
                $this->limit = array(
                        strlen( $this->openFile() ),
-                       strlen( $this->fileEntry( $title->getCanonicalURL(), wfTimestamp( TS_ISO_8601, wfTimestamp() ), $this->priority( $namespace ) ) ),
+                       strlen( $this->fileEntry(
+                               $title->getCanonicalURL(),
+                               wfTimestamp( TS_ISO_8601, wfTimestamp() ),
+                               $this->priority( $namespace )
+                       ) ),
                        strlen( $this->closeFile() )
                );
        }
index 9c4bdfb..7d7c1cc 100644 (file)
@@ -52,7 +52,10 @@ class GetTextMaint extends Maintenance {
                        $titleText = $title->getPrefixedText();
                        $this->error( "Page $titleText does not exist.\n", true );
                }
-               $content = $rev->getContent( $this->hasOption( 'show-private' ) ? Revision::RAW : Revision::FOR_PUBLIC );
+               $content = $rev->getContent( $this->hasOption( 'show-private' )
+                       ? Revision::RAW
+                       : Revision::FOR_PUBLIC );
+
                if ( $content === false ) {
                        $titleText = $title->getPrefixedText();
                        $this->error( "Couldn't extract the text from $titleText.\n", true );
index 61189b7..88e7120 100644 (file)
@@ -42,8 +42,12 @@ class BackupReader extends Maintenance {
 
        function __construct() {
                parent::__construct();
-               $gz = in_array( 'compress.zlib', stream_get_wrappers() ) ? 'ok' : '(disabled; requires PHP zlib module)';
-               $bz2 = in_array( 'compress.bzip2', stream_get_wrappers() ) ? 'ok' : '(disabled; requires PHP bzip2 module)';
+               $gz = in_array( 'compress.zlib', stream_get_wrappers() )
+                       ? 'ok'
+                       : '(disabled; requires PHP zlib module)';
+               $bz2 = in_array( 'compress.bzip2', stream_get_wrappers() )
+                       ? 'ok'
+                       : '(disabled; requires PHP bzip2 module)';
 
                $this->mDescription = <<<TEXT
 This script reads pages from an XML file as produced from Special:Export or
@@ -67,7 +71,10 @@ TEXT;
                $this->addOption( 'dry-run', 'Parse dump without actually importing pages' );
                $this->addOption( 'debug', 'Output extra verbose debug information' );
                $this->addOption( 'uploads', 'Process file upload data if included (experimental)' );
-               $this->addOption( 'no-updates', 'Disable link table updates. Is faster but leaves the wiki in an inconsistent state' );
+               $this->addOption(
+                       'no-updates',
+                       'Disable link table updates. Is faster but leaves the wiki in an inconsistent state'
+               );
                $this->addOption( 'image-base-path', 'Import files from a specified path', false, true );
                $this->addArg( 'file', 'Dump file to import [else use stdin]', false );
        }
index ae93287..7caedea 100644 (file)
@@ -110,9 +110,11 @@ function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) {
        return false;
 }
 
-# FIXME: Access the api in a saner way and performing just one query (preferably batching files too).
+# @todo FIXME: Access the api in a saner way and performing just one query
+# (preferably batching files too).
 function getFileCommentFromSourceWiki( $wiki_host, $file ) {
-       $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
+       $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
+               . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=comment';
        $body = Http::get( $url );
        if ( preg_match( '#<ii comment="([^"]*)" />#', $body, $matches ) == 0 ) {
                return false;
@@ -122,7 +124,8 @@ function getFileCommentFromSourceWiki( $wiki_host, $file ) {
 }
 
 function getFileUserFromSourceWiki( $wiki_host, $file ) {
-       $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:' . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
+       $url = $wiki_host . '/api.php?action=query&format=xml&titles=File:'
+               . rawurlencode( $file ) . '&prop=imageinfo&&iiprop=user';
        $body = Http::get( $url );
        if ( preg_match( '#<ii user="([^"]*)" />#', $body, $matches ) == 0 ) {
                return false;
index 54fd4e2..ba77354 100644 (file)
@@ -4,7 +4,8 @@
  * using the web-based interface.
  *
  * "Smart import" additions:
- * - aim: preserve the essential metadata (user, description) when importing medias from an existing wiki
+ * - aim: preserve the essential metadata (user, description) when importing media
+ *   files from an existing wiki.
  * - process:
  *      - interface with the source wiki, don't use bare files only (see --source-wiki-url).
  *      - fetch metadata from source wiki for each file to import.
@@ -87,16 +88,24 @@ if ( isset( $options['check-userblock'] ) ) {
 }
 
 # Get --from
-$from = @$options['from'];
+wfSuppressWarnings();
+$from = $options['from'];
+wfRestoreWarnings();
 
 # Get sleep time.
-$sleep = @$options['sleep'];
+wfSuppressWarnings();
+$sleep = $options['sleep'];
+wfRestoreWarnings();
+
 if ( $sleep ) {
        $sleep = (int)$sleep;
 }
 
 # Get limit number
-$limit = @$options['limit'];
+wfSuppressWarnings();
+$limit = $options['limit'];
+wfRestoreWarnings();
+
 if ( $limit ) {
        $limit = (int)$limit;
 }
@@ -167,7 +176,8 @@ if ( $count > 0 ) {
                } else {
                        if ( isset( $options['skip-dupes'] ) ) {
                                $repo = $image->getRepo();
-                               $sha1 = File::sha1Base36( $file ); # XXX: we end up calculating this again when actually uploading. that sucks.
+                               # XXX: we end up calculating this again when actually uploading. that sucks.
+                               $sha1 = File::sha1Base36( $file );
 
                                $dupes = $repo->findBySha1( $sha1 );
 
@@ -210,7 +220,8 @@ if ( $count > 0 ) {
                        if ( $commentExt ) {
                                $f = findAuxFile( $file, $commentExt );
                                if ( !$f ) {
-                                       echo " No comment file with extension {$commentExt} found for {$file}, using default comment. ";
+                                       echo " No comment file with extension {$commentExt} found "
+                                               . "for {$file}, using default comment. ";
                                } else {
                                        $commentText = file_get_contents( $f );
                                        if ( !$commentText ) {
@@ -254,7 +265,13 @@ if ( $count > 0 ) {
 
                if ( isset( $options['dry'] ) ) {
                        echo "done.\n";
-               } elseif ( $image->recordUpload2( $archive->value, $summary, $commentText, $props, $timestamp ) ) {
+               } elseif ( $image->recordUpload2(
+                       $archive->value,
+                       $summary,
+                       $commentText,
+                       $props,
+                       $timestamp
+               ) ) {
                        # We're done!
                        echo "done.\n";
 
@@ -337,28 +354,37 @@ USAGE: php importImages.php [options] <dir>
 <dir> : Path to the directory containing images to be imported
 
 Options:
---extensions=<exts>     Comma-separated list of allowable extensions, defaults to \$wgFileExtensions
---overwrite             Overwrite existing images with the same name (default is to skip them)
---limit=<num>           Limit the number of images to process. Ignored or skipped images are not counted.
---from=<name>           Ignore all files until the one with the given name. Useful for resuming
-                        aborted imports. <name> should be the file's canonical database form.
---skip-dupes            Skip images that were already uploaded under a different name (check SHA1)
---search-recursively    Search recursively for files in subdirectories
+--extensions=<exts>     Comma-separated list of allowable extensions, defaults
+                        to \$wgFileExtensions.
+--overwrite             Overwrite existing images with the same name (default
+                        is to skip them).
+--limit=<num>           Limit the number of images to process. Ignored or
+                        skipped images are not counted.
+--from=<name>           Ignore all files until the one with the given name.
+                        Useful for resuming aborted imports. <name> should be
+                        the file's canonical database form.
+--skip-dupes            Skip images that were already uploaded under a different
+                        name (check SHA1).
+--search-recursively    Search recursively for files in subdirectories.
 --sleep=<sec>           Sleep between files. Useful mostly for debugging.
---user=<username>       Set username of uploader, default 'Maintenance script'
+--user=<username>       Set username of uploader, default 'Maintenance script'.
 --check-userblock       Check if the user got blocked during import.
 --comment=<text>        Set file description, default 'Importing file'.
 --comment-file=<file>   Set description to the content of <file>.
---comment-ext=<ext>     Causes the description for each file to be loaded from a file with the same name
-                        but the extension <ext>. If a global description is also given, it is appended.
---license=<code>        Use an optional license template
---dry                   Dry run, don't import anything
---protect=<protect>     Specify the protect value (autoconfirmed,sysop)
---summary=<summary>     Upload summary, description will be used if not provided
---timestamp=<timestamp> Override upload time/date, all MediaWiki timestamp formats are accepted
---unprotect             Unprotects all uploaded images
---source-wiki-url       If specified, take User and Comment data for each imported file from this URL.
-                        For example, --source-wiki-url="http://en.wikipedia.org/"
+--comment-ext=<ext>     Causes the description for each file to be loaded from a
+                        file with the same name, but the extension <ext>. If a
+                        global description is also given, it is appended.
+--license=<code>        Use an optional license template.
+--dry                   Dry run, don't import anything.
+--protect=<protect>     Specify the protect value (autoconfirmed,sysop).
+--summary=<summary>     Upload summary, description will be used if not
+                        provided.
+--timestamp=<timestamp> Override upload time/date, all MediaWiki timestamp
+                        formats are accepted.
+--unprotect             Unprotects all uploaded images.
+--source-wiki-url       If specified, take User and Comment data for each
+                        imported file from this URL. For example,
+                        --source-wiki-url="http://en.wikipedia.org/."
 
 TEXT;
        exit( 1 );
index 92268b3..c368c3f 100644 (file)
@@ -34,7 +34,10 @@ class InitSiteStats extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Re-initialise the site statistics tables";
-               $this->addOption( 'update', 'Update the existing statistics (preserves the ss_total_views field)' );
+               $this->addOption(
+                       'update',
+                       'Update the existing statistics (preserves the ss_total_views field)'
+               );
                $this->addOption( 'noviews', "Don't update the page view counter" );
                $this->addOption( 'active', 'Also update active users count' );
                $this->addOption( 'use-master', 'Count using the master database' );
index 44c117e..6fc4782 100644 (file)
@@ -45,9 +45,19 @@ class CommandLineInstaller extends Maintenance {
 
                $this->addArg( 'admin', 'The username of the wiki administrator (WikiSysop)', true );
                $this->addOption( 'pass', 'The password for the wiki administrator.', false, true );
-               $this->addOption( 'passfile', 'An alternative way to provide pass option, as the contents of this file', false, true );
+               $this->addOption(
+                       'passfile',
+                       'An alternative way to provide pass option, as the contents of this file',
+                       false,
+                       true
+               );
                /* $this->addOption( 'email', 'The email for the wiki administrator', false, true ); */
-               $this->addOption( 'scriptpath', 'The relative path of the wiki in the web server (/wiki)', false, true );
+               $this->addOption(
+                       'scriptpath',
+                       'The relative path of the wiki in the web server (/wiki)',
+                       false,
+                       true
+               );
 
                $this->addOption( 'lang', 'The language to use (en)', false, true );
                /* $this->addOption( 'cont-lang', 'The content language (en)', false, true ); */
@@ -62,22 +72,32 @@ class CommandLineInstaller extends Maintenance {
                $this->addOption( 'installdbpass', 'The pasword for the DB user to install as.', false, true );
                $this->addOption( 'dbuser', 'The user to use for normal operations (wikiuser)', false, true );
                $this->addOption( 'dbpass', 'The pasword for the DB user for normal operations', false, true );
-               $this->addOption( 'dbpassfile', 'An alternative way to provide dbpass option, as the contents of this file', false, true );
+               $this->addOption(
+                       'dbpassfile',
+                       'An alternative way to provide dbpass option, as the contents of this file',
+                       false,
+                       true
+               );
                $this->addOption( 'confpath', "Path to write LocalSettings.php to, default $IP", false, true );
-               /* $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true ); */
-               /* $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true ); */
+               /*
+               $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true );
+               $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true );
+               */
                $this->addOption( 'env-checks', "Run environment checks only, don't change anything" );
        }
 
        function execute() {
                global $IP;
-               $siteName = isset( $this->mArgs[0] ) ? $this->mArgs[0] : "Don't care"; // Will not be set if used with --env-checks
+
+               // Will not be set if used with --env-checks
+               $siteName = isset( $this->mArgs[0] ) ? $this->mArgs[0] : "Don't care";
                $adminName = isset( $this->mArgs[1] ) ? $this->mArgs[1] : null;
 
                $dbpassfile = $this->getOption( 'dbpassfile', false );
                if ( $dbpassfile !== false ) {
                        if ( $this->getOption( 'dbpass', false ) !== false ) {
-                               $this->error( 'WARNING: You provide the options "dbpass" and "dbpassfile". The content of "dbpassfile" overwrites "dbpass".' );
+                               $this->error( 'WARNING: You provide the options "dbpass" and "dbpassfile". '
+                                       . 'The content of "dbpassfile" overwrites "dbpass".' );
                        }
                        wfSuppressWarnings();
                        $dbpass = file_get_contents( $dbpassfile );
@@ -91,7 +111,8 @@ class CommandLineInstaller extends Maintenance {
                $passfile = $this->getOption( 'passfile', false );
                if ( $passfile !== false ) {
                        if ( $this->getOption( 'pass', false ) !== false ) {
-                               $this->error( 'WARNING: You provide the options "pass" and "passfile". The content of "passfile" overwrites "pass".' );
+                               $this->error( 'WARNING: You provide the options "pass" and "passfile". '
+                                       . 'The content of "passfile" overwrites "pass".' );
                        }
                        wfSuppressWarnings();
                        $pass = file_get_contents( $passfile );
index 410bf75..52f8201 100644 (file)
@@ -39,7 +39,9 @@ class DatabaseLag extends Maintenance {
                if ( $this->hasOption( 'r' ) ) {
                        $lb = wfGetLB();
                        echo 'time     ';
-                       for ( $i = 1; $i < $lb->getServerCount(); $i++ ) {
+
+                       $serverCount = $lb->getServerCount();
+                       for ( $i = 1; $i < $serverCount; $i++ ) {
                                $hostname = $lb->getServerName( $i );
                                printf( "%-12s ", $hostname );
                        }
index a63c45b..f016a2c 100644 (file)
@@ -43,7 +43,12 @@ class MergeMessageFileList extends Maintenance {
 
        function __construct() {
                parent::__construct();
-               $this->addOption( 'list-file', 'A file containing a list of extension setup files, one per line.', false, true );
+               $this->addOption(
+                       'list-file',
+                       'A file containing a list of extension setup files, one per line.',
+                       false,
+                       true
+               );
                $this->addOption( 'extensions-dir', 'Path where extensions can be found.', false, true );
                $this->addOption( 'output', 'Send output to this file (omit for stdout)', false, true );
                $this->mDescription = 'Merge $wgExtensionMessagesFiles and $wgMessagesDirs from ' .
@@ -51,7 +56,10 @@ class MergeMessageFileList extends Maintenance {
        }
 
        public function execute() {
-               global $mmfl, $wgExtensionEntryPointListFiles;
+               // @codingStandardsIgnoreStart Ignore error: Global variable "$mmfl" is lacking 'wg' prefix
+               global $mmfl;
+               // @codingStandardsIgnoreEnd
+               global $wgExtensionEntryPointListFiles;
 
                if ( !count( $wgExtensionEntryPointListFiles )
                        && !$this->hasOption( 'list-file' )
index 5171b17..713753f 100644 (file)
@@ -82,7 +82,9 @@ class MoveBatch extends Maintenance {
 
                # Setup complete, now start
                $dbw = wfGetDB( DB_MASTER );
+               // @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning
                for ( $linenum = 1; !feof( $file ); $linenum++ ) {
+                       // @codingStandardsIgnoreEnd
                        $line = fgets( $file );
                        if ( $line === false ) {
                                break;
index 044003e..1a8052b 100644 (file)
@@ -79,7 +79,8 @@ class Orphans extends Maintenance {
                        $this->lockTables( $dbw );
                }
 
-               $this->output( "Checking for orphan revision table entries... (this may take a while on a large wiki)\n" );
+               $this->output( "Checking for orphan revision table entries... "
+                       . "(this may take a while on a large wiki)\n" );
                $result = $dbw->query( "
                        SELECT *
                        FROM $revision LEFT OUTER JOIN $page ON rev_page=page_id
@@ -88,8 +89,13 @@ class Orphans extends Maintenance {
                $orphans = $result->numRows();
                if ( $orphans > 0 ) {
                        global $wgContLang;
+
                        $this->output( "$orphans orphan revisions...\n" );
-                       $this->output( sprintf( "%10s %10s %14s %20s %s\n", 'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text', 'rev_comment' ) );
+                       $this->output( sprintf(
+                               "%10s %10s %14s %20s %s\n",
+                               'rev_id', 'rev_page', 'rev_timestamp', 'rev_user_text', 'rev_comment'
+                       ) );
+
                        foreach ( $result as $row ) {
                                $comment = ( $row->rev_comment == '' )
                                        ? ''
@@ -131,7 +137,8 @@ class Orphans extends Maintenance {
                        $this->lockTables( $dbw );
                }
 
-               $this->output( "\nChecking for childless page table entries... (this may take a while on a large wiki)\n" );
+               $this->output( "\nChecking for childless page table entries... "
+                       . "(this may take a while on a large wiki)\n" );
                $result = $dbw->query( "
                        SELECT *
                        FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
@@ -176,7 +183,8 @@ class Orphans extends Maintenance {
                        $this->lockTables( $dbw, array( 'user', 'text' ) );
                }
 
-               $this->output( "\nChecking for pages whose page_latest links are incorrect... (this may take a while on a large wiki)\n" );
+               $this->output( "\nChecking for pages whose page_latest links are incorrect... "
+                       . "(this may take a while on a large wiki)\n" );
                $result = $dbw->query( "
                        SELECT *
                        FROM $page LEFT OUTER JOIN $revision ON page_latest=rev_id
index 7765784..0ec1de9 100644 (file)
@@ -62,7 +62,12 @@ class CLIParser extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Parse a given wikitext";
-               $this->addOption( 'title', 'Title name for the given wikitext (Default: \'CLIParser\')', false, true );
+               $this->addOption(
+                       'title',
+                       'Title name for the given wikitext (Default: \'CLIParser\')',
+                       false,
+                       true
+               );
                $this->addArg( 'file', 'File containing wikitext (Default: stdin)', false );
        }
 
@@ -90,7 +95,8 @@ class CLIParser extends Maintenance {
 
                if ( $input_file === $php_stdin ) {
                        $ctrl = wfIsWindows() ? 'CTRL+Z' : 'CTRL+D';
-                       $this->error( basename( __FILE__ ) . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" );
+                       $this->error( basename( __FILE__ )
+                               . ": warning: reading wikitext from STDIN. Press $ctrl to parse.\n" );
                }
 
                return file_get_contents( $input_file );
index 31ce156..5d9fc1b 100644 (file)
@@ -33,7 +33,10 @@ class PatchSql extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Run an SQL file into the DB, replacing prefix and charset vars";
-               $this->addArg( 'patch-name', 'Name of the patch file, either full path or in maintenance/archives' );
+               $this->addArg(
+                       'patch-name',
+                       'Name of the patch file, either full path or in maintenance/archives'
+               );
        }
 
        public function getDbType() {
index 4c8cdaa..15087f8 100644 (file)
@@ -51,9 +51,24 @@ When the script has finished, it will make a note of this in the database, and
 will not run again without the --force option.
 TEXT;
 # '
-               $this->addOption( 'begin', 'Only do categories whose names are alphabetically after the provided name', false, true );
-               $this->addOption( 'max-slave-lag', 'If slave lag exceeds this many seconds, wait until it drops before continuing.  Default: 10', false, true );
-               $this->addOption( 'throttle', 'Wait this many milliseconds after each category.  Default: 0', false, true );
+               $this->addOption(
+                       'begin',
+                       'Only do categories whose names are alphabetically after the provided name',
+                       false,
+                       true
+               );
+               $this->addOption(
+                       'max-slave-lag',
+                       'If slave lag exceeds this many seconds, wait until it drops before continuing. Default: 10',
+                       false,
+                       true
+               );
+               $this->addOption(
+                       'throttle',
+                       'Wait this many milliseconds after each category. Default: 0',
+                       false,
+                       true
+               );
                $this->addOption( 'force', 'Run regardless of whether the database says it\'s been run already' );
        }