Merge "Split part of EnhancedChangesList::recentChangesLine into new method"
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 8 Apr 2014 18:27:45 +0000 (18:27 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 8 Apr 2014 18:27:45 +0000 (18:27 +0000)
32 files changed:
includes/CategoryViewer.php
includes/DefaultSettings.php
includes/EditPage.php
includes/Export.php
includes/FileDeleteForm.php
includes/Html.php
includes/HtmlFormatter.php
includes/Linker.php
includes/MimeMagic.php
includes/OutputPage.php
includes/Status.php
includes/Title.php
includes/diff/DifferenceEngine.php
includes/installer/i18n/en.json
includes/jobqueue/JobQueue.php
includes/jobqueue/JobQueueFederated.php
includes/libs/MultiHttpClient.php
includes/logging/LogPager.php
includes/parser/Parser.php
includes/parser/ParserCache.php
includes/parser/ParserOptions.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/upload/UploadStash.php
includes/utils/UIDGenerator.php
languages/LanguageConverter.php
languages/classes/LanguageSr.php
languages/i18n/en.json
maintenance/runJobs.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/jobqueue/JobQueueTest.php

index 183c5f2..7f213c3 100644 (file)
@@ -449,7 +449,7 @@ class CategoryViewer extends ContextSource {
         * of the output.
         *
         * @param string $type 'page', 'subcat', or 'file'
-        * @return String: HTML output, possibly empty if there are no other pages
+        * @return string HTML output, possibly empty if there are no other pages
         */
        private function getSectionPagingLinks( $type ) {
                if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) {
@@ -628,8 +628,8 @@ class CategoryViewer extends ContextSource {
         * Takes a title, and adds the fragment identifier that
         * corresponds to the correct segment of the category.
         *
-        * @param Title $title: The title (usually $this->title)
-        * @param string $section: Which section
+        * @param Title $title The title (usually $this->title)
+        * @param string $section Which section
         * @throws MWException
         * @return Title
         */
@@ -661,7 +661,7 @@ class CategoryViewer extends ContextSource {
         * @param int $rescnt The number of items returned by our database query.
         * @param int $dbcnt The number of items according to the category table.
         * @param string $type 'subcat', 'article', or 'file'
-        * @return string: A message giving the number of items, to output to HTML.
+        * @return string A message giving the number of items, to output to HTML.
         */
        private function getCountMessage( $rescnt, $dbcnt, $type ) {
                // There are three cases:
index 8f3de1a..a3c22b8 100644 (file)
@@ -6211,6 +6211,7 @@ $wgJobTypesExcludedFromDefaultQueue = array( 'AssembleUploadChunks', 'PublishSta
  * on each job runner process. The meaning of "work items" varies per job,
  * but typically would be something like "pages to update". A single job
  * may have a variable number of work items, as is the case with batch jobs.
+ * This is used by runJobs.php and not jobs run via $wgJobRunRate.
  * These settings should be global to all wikis.
  */
 $wgJobBackoffThrottling = array();
index 9b9e389..61995f2 100644 (file)
@@ -1344,8 +1344,8 @@ class EditPage {
         * Run hooks that can filter edits just before they get saved.
         *
         * @param Content $content the Content to filter.
-        * @param Status  $status for reporting the outcome to the caller
-        * @param User    $user the user performing the edit
+        * @param Status $status For reporting the outcome to the caller
+        * @param User $user The user performing the edit
         *
         * @return bool
         */
@@ -2606,11 +2606,11 @@ class EditPage {
        }
 
        /**
-        * @param $isSubjectPreview Boolean: true if this is the section subject/title
-        *                          up top, or false if this is the comment summary
-        *                          down below the textarea
+        * @param bool $isSubjectPreview true if this is the section subject/title
+        *   up top, or false if this is the comment summary
+        *   down below the textarea
         * @param string $summary The text of the summary to display
-        * @return String
+        * @return string
         */
        protected function showSummaryInput( $isSubjectPreview, $summary = "" ) {
                global $wgOut, $wgContLang;
@@ -2632,11 +2632,11 @@ class EditPage {
        }
 
        /**
-        * @param $isSubjectPreview Boolean: true if this is the section subject/title
-        *                          up top, or false if this is the comment summary
-        *                          down below the textarea
+        * @param bool $isSubjectPreview true if this is the section subject/title
+        *   up top, or false if this is the comment summary
+        *   down below the textarea
         * @param string $summary the text of the summary to display
-        * @return String
+        * @return string
         */
        protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
                // avoid spaces in preview, gets always trimmed on save
index 4c0eb30..2844a06 100644 (file)
@@ -73,15 +73,14 @@ class WikiExporter {
         * make additional queries to pull source data while the
         * main query is still running.
         *
-        * @param $db DatabaseBase
-        * @param $history Mixed: one of WikiExporter::FULL, WikiExporter::CURRENT,
-        *                 WikiExporter::RANGE or WikiExporter::STABLE,
-        *                 or an associative array:
-        *                   offset: non-inclusive offset at which to start the query
-        *                   limit: maximum number of rows to return
-        *                   dir: "asc" or "desc" timestamp order
-        * @param int $buffer one of WikiExporter::BUFFER or WikiExporter::STREAM
-        * @param int $text one of WikiExporter::TEXT or WikiExporter::STUB
+        * @param DatabaseBase $db
+        * @param int|array $history One of WikiExporter::FULL, WikiExporter::CURRENT,
+        *   WikiExporter::RANGE or WikiExporter::STABLE, or an associative array:
+        *   - offset: non-inclusive offset at which to start the query
+        *   - limit: maximum number of rows to return
+        *   - dir: "asc" or "desc" timestamp order
+        * @param int $buffer One of WikiExporter::BUFFER or WikiExporter::STREAM
+        * @param int $text One of WikiExporter::TEXT or WikiExporter::STUB
         */
        function __construct( $db, $history = WikiExporter::CURRENT,
                        $buffer = WikiExporter::BUFFER, $text = WikiExporter::TEXT ) {
@@ -127,8 +126,8 @@ class WikiExporter {
         * Dumps a series of page and revision records for those pages
         * in the database falling within the page_id range given.
         * @param int $start inclusive lower limit (this id is included)
-        * @param $end   Int: Exclusive upper limit (this id is not included)
-        *                   If 0, no upper limit.
+        * @param int $end Exclusive upper limit (this id is not included)
+        *   If 0, no upper limit.
         */
        public function pagesByRange( $start, $end ) {
                $condition = 'page_id >= ' . intval( $start );
@@ -142,8 +141,8 @@ class WikiExporter {
         * Dumps a series of page and revision records for those pages
         * in the database with revisions falling within the rev_id range given.
         * @param int $start inclusive lower limit (this id is included)
-        * @param $end   Int: Exclusive upper limit (this id is not included)
-        *                   If 0, no upper limit.
+        * @param int $end Exclusive upper limit (this id is not included)
+        *   If 0, no upper limit.
         */
        public function revsByRange( $start, $end ) {
                $condition = 'rev_id >= ' . intval( $start );
index 65d82b8..444d26f 100644 (file)
@@ -48,7 +48,7 @@ class FileDeleteForm {
        /**
         * Constructor
         *
-        * @param $file File object we're deleting
+        * @param File $file File object we're deleting
         */
        public function __construct( $file ) {
                $this->title = $file->getTitle();
@@ -132,12 +132,12 @@ class FileDeleteForm {
        /**
         * Really delete the file
         *
-        * @param $title Title object
-        * @param File $file: file object
-        * @param string $oldimage archive name
-        * @param string $reason reason of the deletion
-        * @param $suppress Boolean: whether to mark all deleted versions as restricted
-        * @param $user User object performing the request
+        * @param Title $title
+        * @param File $file
+        * @param string $oldimage Archive name
+        * @param string $reason Reason of the deletion
+        * @param bool $suppress Whether to mark all deleted versions as restricted
+        * @param User $user User object performing the request
         * @throws MWException
         * @return bool|Status
         */
index c4fc29a..b1d4f00 100644 (file)
@@ -635,10 +635,10 @@ class Html {
         * Convenience function to produce an "<input>" element.  This supports the
         * new HTML5 input types and attributes.
         *
-        * @param $name    string name attribute
-        * @param $value   mixed  value attribute
-        * @param $type    string type attribute
-        * @param array $attribs  Associative array of miscellaneous extra
+        * @param string $name Name attribute
+        * @param array $value Value attribute
+        * @param string $type Type attribute
+        * @param array $attribs Associative array of miscellaneous extra
         *   attributes, passed to Html::element()
         * @return string Raw HTML
         */
@@ -653,9 +653,9 @@ class Html {
        /**
         * Convenience function to produce an input element with type=hidden
         *
-        * @param $name    string name attribute
-        * @param $value   string value attribute
-        * @param array $attribs  Associative array of miscellaneous extra
+        * @param string $name Name attribute
+        * @param string $value Value attribute
+        * @param array $attribs Associative array of miscellaneous extra
         *   attributes, passed to Html::element()
         * @return string Raw HTML
         */
@@ -669,9 +669,9 @@ class Html {
         * This supports leaving out the cols= and rows= which Xml requires and are
         * required by HTML4/XHTML but not required by HTML5.
         *
-        * @param $name    string name attribute
-        * @param $value   string value attribute
-        * @param array $attribs  Associative array of miscellaneous extra
+        * @param string $name Name attribute
+        * @param string $value Value attribute
+        * @param array $attribs Associative array of miscellaneous extra
         *   attributes, passed to Html::element()
         * @return string Raw HTML
         */
@@ -693,7 +693,7 @@ class Html {
        /**
         * Build a drop-down box for selecting a namespace
         *
-        * @param $params array:
+        * @param array $params Params to set.
         * - selected: [optional] Id of namespace which should be pre-selected
         * - all: [optional] Value of item for "all namespaces". If null or unset, no "<option>" is generated to select all namespaces
         * - label: text for label to add before the field
@@ -794,9 +794,9 @@ class Html {
         * Constructs the opening html-tag with necessary doctypes depending on
         * global variables.
         *
-        * @param array $attribs  Associative array of miscellaneous extra
+        * @param array $attribs Associative array of miscellaneous extra
         *   attributes, passed to Html::element() of html tag.
-        * @return string  Raw HTML
+        * @return string Raw HTML
         */
        public static function htmlHeader( $attribs = array() ) {
                $ret = '';
@@ -840,8 +840,8 @@ class Html {
        /**
         * Determines if the given mime type is xml.
         *
-        * @param $mimetype    string MimeType
-        * @return Boolean
+        * @param string $mimetype MimeType
+        * @return bool
         */
        public static function isXmlMimeType( $mimetype ) {
                # http://www.whatwg.org/html/infrastructure.html#xml-mime-type
index c06fbbc..a72fd59 100644 (file)
@@ -34,7 +34,7 @@ class HtmlFormatter {
        /**
         * Constructor
         *
-        * @param string $html: Text to process
+        * @param string $html Text to process
         */
        public function __construct( $html ) {
                $this->html = $html;
@@ -51,15 +51,15 @@ class HtmlFormatter {
 
        /**
         * Override this in descendant class to modify HTML after it has been converted from DOM tree
-        * @param string $html: HTML to process
-        * @return string: Processed HTML
+        * @param string $html HTML to process
+        * @return string Processed HTML
         */
        protected function onHtmlReady( $html ) {
                return $html;
        }
 
        /**
-        * @return DOMDocument: DOM to manipulate
+        * @return DOMDocument DOM to manipulate
         */
        public function getDoc() {
                if ( !$this->doc ) {
@@ -101,7 +101,7 @@ class HtmlFormatter {
         *   .<class>
         *   #<id>
         *
-        * @param Array|string $selectors: Selector(s) of stuff to remove
+        * @param array|string $selectors Selector(s) of stuff to remove
         */
        public function remove( $selectors ) {
                $this->itemsToRemove = array_merge( $this->itemsToRemove, (array)$selectors );
@@ -114,7 +114,7 @@ class HtmlFormatter {
         * Note this interface may fail in surprising unexpected ways due to usage of regexes,
         * so should not be relied on for HTML markup security measures.
         *
-        * @param Array|string $elements: Name(s) of tag(s) to flatten
+        * @param array|string $elements Name(s) of tag(s) to flatten
         */
        public function flatten( $elements ) {
                $this->elementsToFlatten = array_merge( $this->elementsToFlatten, (array)$elements );
@@ -247,8 +247,8 @@ class HtmlFormatter {
        /**
         * Performs final transformations and returns resulting HTML
         *
-        * @param DOMElement|string|null $element: ID of element to get HTML from or false to get it from the whole tree
-        * @return string: Processed HTML
+        * @param DOMElement|string|null $element ID of element to get HTML from or false to get it from the whole tree
+        * @return string Processed HTML
         */
        public function getText( $element = null ) {
                wfProfileIn( __METHOD__ );
@@ -294,10 +294,10 @@ class HtmlFormatter {
        }
 
        /**
-        * @param $selector: CSS selector to parse
-        * @param $type
-        * @param $rawName
-        * @return bool: Whether the selector was successfully recognised
+        * @param string $selector CSS selector to parse
+        * @param string $type
+        * @param string $rawName
+        * @return bool Whether the selector was successfully recognised
         */
        protected function parseSelector( $selector, &$type, &$rawName ) {
                if ( strpos( $selector, '.' ) === 0 ) {
index 094a304..534ad4d 100644 (file)
@@ -93,9 +93,9 @@ class Linker {
         * link, given the Title object for the page we want to link to.
         *
         * @param $nt Title
-        * @param string $unused unused
-        * @param string $class the contents of the class attribute, default none
-        * @param $title Mixed: optional (unescaped) string to use in the title
+        * @param string $unused Unused
+        * @param string $class The contents of the class attribute, default none
+        * @param string|bool $title Optional (unescaped) string to use in the title
         *   attribute; if false, default to the name of the page we're linking to
         * @return string
         */
@@ -130,9 +130,9 @@ class Linker {
        /**
         * Return the CSS colour of a known link
         *
-        * @param $t Title object
-        * @param $threshold Integer: user defined threshold
-        * @return String: CSS class
+        * @param Title $t
+        * @param int $threshold User defined threshold
+        * @return string CSS class
         */
        public static function getLinkColour( $t, $threshold ) {
                $colour = '';
@@ -162,21 +162,21 @@ class Linker {
         *
         * @since 1.18 Method exists since 1.16 as non-static, made static in 1.18.
         *
-        * @param $target        Title  Can currently only be a Title, but this may
+        * @param Title $target Can currently only be a Title, but this may
         *   change to support Images, literal URLs, etc.
-        * @param $html          string The HTML contents of the <a> element, i.e.,
+        * @param string $html The HTML contents of the <a> element, i.e.,
         *   the link text.  This is raw HTML and will not be escaped.  If null,
         *   defaults to the prefixed text of the Title; or if the Title is just a
         *   fragment, the contents of the fragment.
-        * @param array $customAttribs  A key => value array of extra HTML attributes,
+        * @param array $customAttribs A key => value array of extra HTML attributes,
         *   such as title and class.  (href is ignored.)  Classes will be
         *   merged with the default classes, while other attributes will replace
         *   default attributes.  All passed attribute values will be HTML-escaped.
         *   A false attribute value means to suppress that attribute.
-        * @param $query         array  The query string to append to the URL
+        * @param array $query The query string to append to the URL
         *   you're linking to, in key => value array form.  Query keys and values
         *   will be URL-encoded.
-        * @param string|array $options  String or array of strings:
+        * @param string|array $options String or array of strings:
         *     'known': Page is known to exist, so don't check if it does.
         *     'broken': Page is known not to exist, so don't check if it does.
         *     'noclasses': Don't add any classes automatically (includes "new",
@@ -528,13 +528,13 @@ class Linker {
         *          link-target     Value for the target attribute, only with link-url
         *          no-link         Boolean, suppress description link
         *
-        * @param array $handlerParams associative array of media handler parameters, to be passed
+        * @param array $handlerParams Associative array of media handler parameters, to be passed
         *       to transform(). Typical keys are "width" and "page".
-        * @param string $time timestamp of the file, set as false for current
-        * @param string $query query params for desc url
-        * @param $widthOption: Used by the parser to remember the user preference thumbnailsize
+        * @param string $time Timestamp of the file, set as false for current
+        * @param string $query Query params for desc url
+        * @param int|null $widthOption Used by the parser to remember the user preference thumbnailsize
         * @since 1.20
-        * @return String: HTML for an image, with links, wrappers, etc.
+        * @return string HTML for an image, with links, wrappers, etc.
         */
        public static function makeImageLink( /*Parser*/ $parser, Title $title, $file, $frameParams = array(),
                $handlerParams = array(), $time = false, $query = "", $widthOption = null
@@ -902,13 +902,13 @@ class Linker {
        /**
         * Make a "broken" link to an image
         *
-        * @param $title Title object
+        * @param Title $title
         * @param string $label link label (plain text)
         * @param string $query query string
-        * @param $unused1 Unused parameter kept for b/c
-        * @param $unused2 Unused parameter kept for b/c
-        * @param $time Boolean: a file of a certain timestamp was requested
-        * @return String
+        * @param string $unused1 Unused parameter kept for b/c
+        * @param string $unused2 Unused parameter kept for b/c
+        * @param bool $time a file of a certain timestamp was requested
+        * @return string
         */
        public static function makeBrokenImageLinkObj( $title, $label = '', $query = '', $unused1 = '', $unused2 = '', $time = false ) {
                global $wgEnableUploads, $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
@@ -945,9 +945,9 @@ class Linker {
        /**
         * Get the URL to upload a certain file
         *
-        * @param $destFile Title object of the file to upload
-        * @param string $query urlencoded query string to prepend
-        * @return String: urlencoded URL
+        * @param Title $destFile Title object of the file to upload
+        * @param string $query Urlencoded query string to prepend
+        * @return string Urlencoded URL
         */
        protected static function getUploadUrl( $destFile, $query = '' ) {
                global $wgUploadMissingFileUrl, $wgUploadNavigationUrl;
@@ -969,10 +969,10 @@ class Linker {
        /**
         * Create a direct link to a given uploaded file.
         *
-        * @param $title Title object.
-        * @param string $html pre-sanitized HTML
+        * @param Title $title
+        * @param string $html Pre-sanitized HTML
         * @param string $time MW timestamp of file creation time
-        * @return String: HTML
+        * @return string HTML
         */
        public static function makeMediaLinkObj( $title, $html = '', $time = false ) {
                $img = wfFindFile( $title, array( 'time' => $time ) );
@@ -983,10 +983,10 @@ class Linker {
         * Create a direct link to a given uploaded file.
         * This will make a broken link if $file is false.
         *
-        * @param $title Title object.
-        * @param $file File|bool mixed File object or false
-        * @param string $html pre-sanitized HTML
-        * @return String: HTML
+        * @param Title $title
+        * @param File|bool $file File object or false
+        * @param string $html Pre-sanitized HTML
+        * @return string HTML
         *
         * @todo Handle invalid or missing images better.
         */
@@ -1024,11 +1024,11 @@ class Linker {
        /**
         * Make an external link
         * @param string $url URL to link to
-        * @param string $text text of link
-        * @param $escape Boolean: do we escape the link text?
-        * @param string $linktype type of external link. Gets added to the classes
-        * @param array $attribs of extra attributes to <a>
-        * @param $title Title|null Title object used for title specific link attributes
+        * @param string $text Text of link
+        * @param bool $escape Do we escape the link text?
+        * @param string $linktype Type of external link. Gets added to the classes
+        * @param array $attribs Array of extra attributes to <a>
+        * @param Title|null $title Title object used for title specific link attributes
         * @return string
         */
        public static function makeExternalLink( $url, $text, $escape = true, $linktype = '', $attribs = array(), $title = null ) {
@@ -1063,10 +1063,10 @@ class Linker {
 
        /**
         * Make user link (or user contributions for unregistered users)
-        * @param $userId   Integer: user id in database.
-        * @param string $userName user name in database.
-        * @param string $altUserName text to display instead of the user name (optional)
-        * @return String: HTML fragment
+        * @param int $userId User id in database.
+        * @param string $userName User name in database.
+        * @param string $altUserName Text to display instead of the user name (optional)
+        * @return string HTML fragment
         * @since 1.19 Method exists for a long time. $altUserName was added in 1.19.
         */
        public static function userLink( $userId, $userName, $altUserName = false ) {
@@ -1089,13 +1089,13 @@ class Linker {
        /**
         * Generate standard user tool links (talk, contributions, block link, etc.)
         *
-        * @param $userId Integer: user identifier
-        * @param string $userText user name or IP address
-        * @param $redContribsWhenNoEdits Boolean: should the contributions link be
-        *        red if the user has no edits?
-        * @param $flags Integer: customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL)
-        * @param $edits Integer: user edit count (optional, for performance)
-        * @return String: HTML fragment
+        * @param int $userId User identifier
+        * @param string $userText User name or IP address
+        * @param bool $redContribsWhenNoEdits Should the contributions link be
+        *   red if the user has no edits?
+        * @param int $flags Customisation flags (e.g. Linker::TOOL_LINKS_NOBLOCK and Linker::TOOL_LINKS_EMAIL)
+        * @param int $edits User edit count (optional, for performance)
+        * @return string HTML fragment
         */
        public static function userToolLinks(
                $userId, $userText, $redContribsWhenNoEdits = false, $flags = 0, $edits = null
@@ -1147,19 +1147,19 @@ class Linker {
 
        /**
         * Alias for userToolLinks( $userId, $userText, true );
-        * @param $userId Integer: user identifier
-        * @param string $userText user name or IP address
-        * @param $edits Integer: user edit count (optional, for performance)
-        * @return String
+        * @param int $userId User identifier
+        * @param string $userText User name or IP address
+        * @param int $edits User edit count (optional, for performance)
+        * @return string
         */
        public static function userToolLinksRedContribs( $userId, $userText, $edits = null ) {
                return self::userToolLinks( $userId, $userText, true, 0, $edits );
        }
 
        /**
-        * @param $userId Integer: user id in database.
-        * @param string $userText user name in database.
-        * @return String: HTML fragment with user talk link
+        * @param int $userId User id in database.
+        * @param string $userText User name in database.
+        * @return string HTML fragment with user talk link
         */
        public static function userTalkLink( $userId, $userText ) {
                $userTalkPage = Title::makeTitle( NS_USER_TALK, $userText );
@@ -1168,9 +1168,9 @@ class Linker {
        }
 
        /**
-        * @param $userId Integer: userid
-        * @param string $userText user name in database.
-        * @return String: HTML fragment with block link
+        * @param int $userId Userid
+        * @param string $userText User name in database.
+        * @return string HTML fragment with block link
         */
        public static function blockLink( $userId, $userText ) {
                $blockPage = SpecialPage::getTitleFor( 'Block', $userText );
@@ -1179,9 +1179,9 @@ class Linker {
        }
 
        /**
-        * @param $userId Integer: userid
-        * @param string $userText user name in database.
-        * @return String: HTML fragment with e-mail user link
+        * @param int $userId Userid
+        * @param string $userText User name in database.
+        * @return string HTML fragment with e-mail user link
         */
        public static function emailLink( $userId, $userText ) {
                $emailPage = SpecialPage::getTitleFor( 'Emailuser', $userText );
@@ -1191,9 +1191,9 @@ class Linker {
 
        /**
         * Generate a user link if the current user is allowed to view it
-        * @param $rev Revision object.
-        * @param $isPublic Boolean: show only if all users can see it
-        * @return String: HTML fragment
+        * @param Revision $rev
+        * @param bool $isPublic Show only if all users can see it
+        * @return String HTML fragment
         */
        public static function revUserLink( $rev, $isPublic = false ) {
                if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
@@ -1212,8 +1212,8 @@ class Linker {
 
        /**
         * Generate a user tool link cluster if the current user is allowed to view it
-        * @param $rev Revision object.
-        * @param $isPublic Boolean: show only if all users can see it
+        * @param Revision $rev
+        * @param bool $isPublic Show only if all users can see it
         * @return string HTML
         */
        public static function revUserTools( $rev, $isPublic = false ) {
@@ -1246,9 +1246,9 @@ class Linker {
         * Since you can't set a default parameter for a reference, I've turned it
         * temporarily to a value pass. Should be adjusted further. --brion
         *
-        * @param $comment String
-        * @param $title Mixed: Title object (to generate link to the section in autocomment) or null
-        * @param $local Boolean: whether section links should refer to local page
+        * @param string $comment
+        * @param Title|null $title Title object (to generate link to the section in autocomment) or null
+        * @param bool $local Whether section links should refer to local page
         * @return mixed|String
         */
        public static function formatComment( $comment, $title = null, $local = false ) {
@@ -1281,10 +1281,10 @@ class Linker {
         * add a separator where needed and format the comment itself with CSS
         * Called by Linker::formatComment.
         *
-        * @param string $comment comment text
-        * @param $title Title|null An optional title object used to links to sections
-        * @param $local Boolean: whether section links should refer to local page
-        * @return String: formatted comment
+        * @param string $comment Comment text
+        * @param Title|null $title An optional title object used to links to sections
+        * @param bool $local Whether section links should refer to local page
+        * @return string Formatted comment
         */
        private static function formatAutocomments( $comment, $title = null, $local = false ) {
                // Bah!
@@ -1365,10 +1365,10 @@ class Linker {
         * is ignored
         *
         * @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser
-        * @param string $comment text to format links in
-        * @param $title Title|null An optional title object used to links to sections
-        * @param $local Boolean: whether section links should refer to local page
-        * @return String
+        * @param string $comment Text to format links in
+        * @param Title|null $title An optional title object used to links to sections
+        * @param bool $local Whether section links should refer to local page
+        * @return string
         */
        public static function formatLinksInComment( $comment, $title = null, $local = false ) {
                self::$commentContextTitle = $title;
@@ -1547,9 +1547,9 @@ class Linker {
         * Wrap a comment in standard punctuation and formatting if
         * it's non-empty, otherwise return empty string.
         *
-        * @param $comment String
-        * @param $title Mixed: Title object (to generate link to section in autocomment) or null
-        * @param $local Boolean: whether section links should refer to local page
+        * @param string $comment
+        * @param Title|null $title Title object (to generate link to section in autocomment) or null
+        * @param bool $local Whether section links should refer to local page
         *
         * @return string
         */
@@ -1570,10 +1570,10 @@ class Linker {
         * Wrap and format the given revision's comment block, if the current
         * user is allowed to view it.
         *
-        * @param $rev Revision object
-        * @param $local Boolean: whether section links should refer to local page
-        * @param $isPublic Boolean: show only if all users can see it
-        * @return String: HTML fragment
+        * @param Revision $rev
+        * @param bool $local Whether section links should refer to local page
+        * @param bool $isPublic Show only if all users can see it
+        * @return string HTML fragment
         */
        public static function revComment( Revision $rev, $local = false, $isPublic = false ) {
                if ( $rev->getRawComment() == "" ) {
@@ -1654,9 +1654,9 @@ class Linker {
        /**
         * Wraps the TOC in a table and provides the hide/collapse javascript.
         *
-        * @param string $toc html of the Table Of Contents
-        * @param $lang String|Language|false: Language for the toc title, defaults to user language
-        * @return String: full html of the TOC
+        * @param string $toc Html of the Table Of Contents
+        * @param string|Language|false $lang Language for the toc title, defaults to user language
+        * @return string Full html of the TOC
         */
        public static function tocList( $toc, $lang = false ) {
                $lang = wfGetLangObj( $lang );
@@ -1673,7 +1673,7 @@ class Linker {
         * Currently unused.
         *
         * @param array $tree Return value of ParserOutput::getSections()
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        public static function generateTOC( $tree ) {
                $toc = '';
@@ -1700,17 +1700,17 @@ class Linker {
        /**
         * Create a headline for content
         *
-        * @param $level Integer: the level of the headline (1-6)
-        * @param string $attribs any attributes for the headline, starting with
-        *                 a space and ending with '>'
-        *                 This *must* be at least '>' for no attribs
+        * @param int $level The level of the headline (1-6)
+        * @param string $attribs Any attributes for the headline, starting with
+        *   a space and ending with '>'
+        *   This *must* be at least '>' for no attribs
         * @param string $anchor the anchor to give the headline (the bit after the #)
         * @param string $html html for the text of the header
         * @param string $link HTML to add for the section edit link
-        * @param $legacyAnchor Mixed: a second, optional anchor to give for
+        * @param bool|string $legacyAnchor a second, optional anchor to give for
         *   backward compatibility (false to omit)
         *
-        * @return String: HTML headline
+        * @return string HTML headline
         */
        public static function makeHeadline( $level, $attribs, $anchor, $html, $link, $legacyAnchor = false ) {
                $ret = "<h$level$attribs"
@@ -1853,10 +1853,10 @@ class Linker {
        /**
         * Build a raw rollback link, useful for collections of "tool" links
         *
-        * @param $rev Revision object
-        * @param $context IContextSource context to use or null for the main context.
-        * @param $editCount integer Number of edits that would be reverted
-        * @return String: HTML fragment
+        * @param Revision $rev
+        * @param IContextSource|null $context Context to use or null for the main context.
+        * @param int $editCount Number of edits that would be reverted
+        * @return string HTML fragment
         */
        public static function buildRollbackLink( $rev, IContextSource $context = null, $editCount = false ) {
                global $wgShowRollbackEditCount, $wgMiserMode;
@@ -1931,7 +1931,7 @@ class Linker {
         * @param bool $preview Whether this is for a preview
         * @param bool $section Whether this is for a section edit
         * @param Title|Message|string|null $more An escaped link for "More..." of the templates
-        * @return String: HTML output
+        * @return string HTML output
         */
        public static function formatTemplates( $templates, $preview = false, $section = false, $more = null ) {
                global $wgLang;
@@ -2022,9 +2022,9 @@ class Linker {
        /**
         * Returns HTML for the "hidden categories on this page" list.
         *
-        * @param array $hiddencats of hidden categories from Article::getHiddenCategories
-        * or similar
-        * @return String: HTML output
+        * @param array $hiddencats Array of hidden categories from Article::getHiddenCategories
+        *   or similar
+        * @return String HTML output
         */
        public static function formatHiddenCategories( $hiddencats ) {
                wfProfileIn( __METHOD__ );
@@ -2063,10 +2063,10 @@ class Linker {
         * isn't always, because sometimes the accesskey needs to go on a different
         * element than the id, for reverse-compatibility, etc.)
         *
-        * @param string $name id of the element, minus prefixes.
-        * @param $options Mixed: null or the string 'withaccess' to add an access-
+        * @param string $name Id of the element, minus prefixes.
+        * @param string|null $options null or the string 'withaccess' to add an access-
         *   key hint
-        * @return String: contents of the title attribute (which you must HTML-
+        * @return string Contents of the title attribute (which you must HTML-
         *   escape), or false for no title attribute
         */
        public static function titleAttrib( $name, $options = null ) {
@@ -2110,8 +2110,8 @@ class Linker {
         * the id but isn't always, because sometimes the accesskey needs to go on
         * a different element than the id, for reverse-compatibility, etc.)
         *
-        * @param string $name id of the element, minus prefixes.
-        * @return String: contents of the accesskey attribute (which you must HTML-
+        * @param string $name Id of the element, minus prefixes.
+        * @return string Contents of the accesskey attribute (which you must HTML-
         *   escape), or false for no accesskey attribute
         */
        public static function accesskey( $name ) {
@@ -2186,11 +2186,11 @@ class Linker {
        /**
         * Creates a (show/hide) link for deleting revisions/log entries
         *
-        * @param array $query query parameters to be passed to link()
-        * @param $restricted Boolean: set to true to use a "<strong>" instead of a "<span>"
-        * @param $delete Boolean: set to true to use (show/hide) rather than (show)
+        * @param array $query Query parameters to be passed to link()
+        * @param bool $restricted Set to true to use a "<strong>" instead of a "<span>"
+        * @param bool $delete Set to true to use (show/hide) rather than (show)
         *
-        * @return String: HTML "<a>" link to Special:Revisiondelete, wrapped in a
+        * @return string HTML "<a>" link to Special:Revisiondelete, wrapped in a
         * span to allow for customization of appearance with CSS
         */
        public static function revDeleteLink( $query = array(), $restricted = false, $delete = true ) {
@@ -2205,7 +2205,7 @@ class Linker {
        /**
         * Creates a dead (show/hide) link for deleting revisions/log entries
         *
-        * @param $delete Boolean: set to true to use (show/hide) rather than (show)
+        * @param bool $delete Set to true to use (show/hide) rather than (show)
         *
         * @return string HTML text wrapped in a span to allow for customization
         * of appearance with CSS
@@ -2226,13 +2226,12 @@ class Linker {
         * call this lots of times, pre-fill the link cache with a LinkBatch, otherwise each
         * call to this will result in a DB query.
         *
-        * @param $nt     Title: the title object to make the link from, e.g. from
-        *                      Title::newFromText.
-        * @param $text  String: link text
+        * @param Title $nt The title object to make the link from, e.g. from Title::newFromText.
+        * @param string $text Link text
         * @param string $query optional query part
         * @param string $trail optional trail. Alphabetic characters at the start of this string will
-        *                      be included in the link text. Other characters will be appended after
-        *                      the end of the link.
+        *   be included in the link text. Other characters will be appended after
+        *   the end of the link.
         * @param string $prefix optional prefix. As trail, only before instead of after.
         * @return string
         */
@@ -2259,14 +2258,14 @@ class Linker {
         * it doesn't have to do a database query. It's also valid for interwiki titles and special
         * pages.
         *
-        * @param $title  Title object of target page
-        * @param $text   String: text to replace the title
-        * @param $query  String: link target
-        * @param $trail  String: text after link
-        * @param string $prefix text before link text
-        * @param string $aprops extra attributes to the a-element
-        * @param $style  String: style to apply - if empty, use getInternalLinkAttributesObj instead
-        * @return string the a-element
+        * @param Title $title Title object of target page
+        * @param string $text Text to replace the title
+        * @param string $query Link target
+        * @param string $trail Text after link
+        * @param string $prefix Text before link text
+        * @param string $aprops Extra attributes to the a-element
+        * @param string $style Style to apply - if empty, use getInternalLinkAttributesObj instead
+        * @return string The a-element
         */
        static function makeKnownLinkObj(
                $title, $text = '', $query = '', $trail = '', $prefix = '', $aprops = '', $style = ''
index e3b8577..b5c0c7d 100644 (file)
@@ -536,9 +536,9 @@ class MimeMagic {
         * based formats like OPC/ODF files).
         *
         * @param string $file the file to check
-        * @param $ext Mixed: the file extension, or true (default) to extract it from the filename.
-        *             Set it to false to ignore the extension. DEPRECATED! Set to false, use
-        *             improveTypeFromExtension($mime, $ext) later to improve mime type.
+        * @param string|bool $ext The file extension, or true (default) to extract it from the filename.
+        *   Set it to false to ignore the extension. DEPRECATED! Set to false, use
+        *   improveTypeFromExtension($mime, $ext) later to improve mime type.
         *
         * @return string the mime type of $file
         */
@@ -744,11 +744,11 @@ class MimeMagic {
         * header data.  Currently works for OpenDocument and OpenXML types...
         * If can't tell, returns 'application/zip'.
         *
-        * @param string $header some reasonably-sized chunk of file header
-        * @param $tail   String: the tail of the file
-        * @param $ext Mixed: the file extension, or true to extract it from the filename.
-        *             Set it to false (default) to ignore the extension. DEPRECATED! Set to false,
-        *             use improveTypeFromExtension($mime, $ext) later to improve mime type.
+        * @param string $header Some reasonably-sized chunk of file header
+        * @param string|null $tail The tail of the file
+        * @param string|bool $ext The file extension, or true to extract it from the filename.
+        *   Set it to false (default) to ignore the extension. DEPRECATED! Set to false,
+        *   use improveTypeFromExtension($mime, $ext) later to improve mime type.
         *
         * @return string
         */
@@ -850,10 +850,10 @@ class MimeMagic {
         * mime type if the file is an image. If no mime type can be determined,
         * this function returns 'unknown/unknown'.
         *
-        * @param string $file the file to check
-        * @param $ext Mixed: the file extension, or true (default) to extract it from the filename.
-        *             Set it to false to ignore the extension. DEPRECATED! Set to false, use
-        *             improveTypeFromExtension($mime, $ext) later to improve mime type.
+        * @param string $file The file to check
+        * @param string|bool $ext The file extension, or true (default) to extract it from the filename.
+        *   Set it to false to ignore the extension. DEPRECATED! Set to false, use
+        *   improveTypeFromExtension($mime, $ext) later to improve mime type.
         *
         * @return string the mime type of $file
         */
index f469732..9b641c3 100644 (file)
@@ -252,17 +252,17 @@ class OutputPage extends ContextSource {
        private $mProperties = array();
 
        /**
-        * @var string|null: ResourceLoader target for load.php links. If null, will be omitted
+        * @var string|null ResourceLoader target for load.php links. If null, will be omitted
         */
        private $mTarget = null;
 
        /**
-        * @var bool: Whether parser output should contain table of contents
+        * @var bool Whether parser output should contain table of contents
         */
        private $mEnableTOC = true;
 
        /**
-        * @var bool: Whether parser output should contain section edit links
+        * @var bool Whether parser output should contain section edit links
         */
        private $mEnableSectionEditLinks = true;
 
@@ -481,7 +481,7 @@ class OutputPage extends ContextSource {
         * through this function will be loaded by the resource loader when the
         * page loads.
         *
-        * @param $modules Mixed: module name (string) or array of module names
+        * @param string|array $modules Module name (string) or array of module names
         */
        public function addModules( $modules ) {
                $this->mModules = array_merge( $this->mModules, (array)$modules );
@@ -504,7 +504,7 @@ class OutputPage extends ContextSource {
         * scripts added through this function will be loaded by the resource loader when
         * the page loads.
         *
-        * @param $modules Mixed: module name (string) or array of module names
+        * @param string|array $modules Module name (string) or array of module names
         */
        public function addModuleScripts( $modules ) {
                $this->mModuleScripts = array_merge( $this->mModuleScripts, (array)$modules );
@@ -529,7 +529,7 @@ class OutputPage extends ContextSource {
         * tags, rather than as a combined Javascript and CSS package. Thus, they will
         * load when JavaScript is disabled (unless CSS also happens to be disabled).
         *
-        * @param $modules Mixed: module name (string) or array of module names
+        * @param string|array $modules Module name (string) or array of module names
         */
        public function addModuleStyles( $modules ) {
                $this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules );
@@ -552,14 +552,14 @@ class OutputPage extends ContextSource {
         * Module messages added through this function will be loaded by the resource
         * loader when the page loads.
         *
-        * @param $modules Mixed: module name (string) or array of module names
+        * @param string|array $modules Module name (string) or array of module names
         */
        public function addModuleMessages( $modules ) {
                $this->mModuleMessages = array_merge( $this->mModuleMessages, (array)$modules );
        }
 
        /**
-        * @return null|string: ResourceLoader target
+        * @return null|string ResourceLoader target
         */
        public function getTarget() {
                return $this->mTarget;
@@ -630,7 +630,7 @@ class OutputPage extends ContextSource {
         * without any skin, sidebar, etc.
         * Used e.g. when calling with "action=render".
         *
-        * @param $only Boolean: whether to output only the body of the article
+        * @param bool $only Whether to output only the body of the article
         */
        public function setArticleBodyOnly( $only ) {
                $this->mArticleBodyOnly = $only;
@@ -660,8 +660,8 @@ class OutputPage extends ContextSource {
         * Get an additional output property
         * @since 1.21
         *
-        * @param $name
-        * @return mixed: Property value or null if not found
+        * @param string $name
+        * @return mixed Property value or null if not found
         */
        public function getProperty( $name ) {
                if ( isset( $this->mProperties[$name] ) ) {
@@ -678,9 +678,9 @@ class OutputPage extends ContextSource {
         *
         * Side effect: sets mLastModified for Last-Modified header
         *
-        * @param $timestamp string
+        * @param string $timestamp
         *
-        * @return Boolean: true if cache-ok headers was sent.
+        * @return bool True if cache-ok headers was sent.
         */
        public function checkLastModified( $timestamp ) {
                global $wgCachePages, $wgCacheEpoch, $wgUseSquid, $wgSquidMaxage;
@@ -1036,7 +1036,7 @@ class OutputPage extends ContextSource {
         * for the new version
         * @see addFeedLink()
         *
-        * @param $show Boolean: true: add default feeds, false: remove all feeds
+        * @param bool $show true: add default feeds, false: remove all feeds
         */
        public function setSyndicated( $show = true ) {
                if ( $show ) {
@@ -1372,7 +1372,7 @@ class OutputPage extends ContextSource {
        /**
         * Get the body HTML
         *
-        * @return String: HTML
+        * @return string HTML
         */
        public function getHTML() {
                return $this->mBodytext;
@@ -1397,8 +1397,8 @@ class OutputPage extends ContextSource {
         * Set the revision ID which will be seen by the wiki text parser
         * for things such as embedded {{REVISIONID}} variable use.
         *
-        * @param $revid Mixed: an positive integer, or null
-        * @return Mixed: previous value
+        * @param int|null $revid An positive integer, or null
+        * @return mixed Previous value
         */
        public function setRevisionId( $revid ) {
                $val = is_null( $revid ) ? null : intval( $revid );
@@ -1418,8 +1418,8 @@ class OutputPage extends ContextSource {
         * Set the timestamp of the revision which will be displayed. This is used
         * to avoid a extra DB call in Skin::lastModified().
         *
-        * @param $timestamp Mixed: string, or null
-        * @return Mixed: previous value
+        * @param string|null $timestamp
+        * @return mixed Previous value
         */
        public function setRevisionTimestamp( $timestamp ) {
                return wfSetVar( $this->mRevisionTimestamp, $timestamp );
@@ -1438,8 +1438,8 @@ class OutputPage extends ContextSource {
        /**
         * Set the displayed file version
         *
-        * @param $file File|bool
-        * @return Mixed: previous value
+        * @param File|bool $file
+        * @return mixed Previous value
         */
        public function setFileVersion( $file ) {
                $val = null;
@@ -1482,9 +1482,9 @@ class OutputPage extends ContextSource {
         * Convert wikitext to HTML and add it to the buffer
         * Default assumes that the current page title will be used.
         *
-        * @param $text String
-        * @param $linestart Boolean: is this the start of a line?
-        * @param $interface Boolean: is this text in the user interface language?
+        * @param string $text
+        * @param bool $linestart Is this the start of a line?
+        * @param bool $interface Is this text in the user interface language?
         */
        public function addWikiText( $text, $linestart = true, $interface = true ) {
                $title = $this->getTitle(); // Work around E_STRICT
@@ -1497,9 +1497,9 @@ class OutputPage extends ContextSource {
        /**
         * Add wikitext with a custom Title object
         *
-        * @param string $text wikitext
-        * @param $title Title object
-        * @param $linestart Boolean: is this the start of a line?
+        * @param string $text Wikitext
+        * @param Title $title
+        * @param bool $linestart Is this the start of a line?
         */
        public function addWikiTextWithTitle( $text, &$title, $linestart = true ) {
                $this->addWikiTextTitle( $text, $title, $linestart );
@@ -1508,9 +1508,9 @@ class OutputPage extends ContextSource {
        /**
         * Add wikitext with a custom Title object and tidy enabled.
         *
-        * @param string $text wikitext
-        * @param $title Title object
-        * @param $linestart Boolean: is this the start of a line?
+        * @param string $text Wikitext
+        * @param Title $title
+        * @param bool $linestart Is this the start of a line?
         */
        function addWikiTextTitleTidy( $text, &$title, $linestart = true ) {
                $this->addWikiTextTitle( $text, $title, $linestart, true );
@@ -1519,8 +1519,8 @@ class OutputPage extends ContextSource {
        /**
         * Add wikitext with tidy enabled
         *
-        * @param string $text wikitext
-        * @param $linestart Boolean: is this the start of a line?
+        * @param string $text Wikitext
+        * @param bool $linestart Is this the start of a line?
         */
        public function addWikiTextTidy( $text, $linestart = true ) {
                $title = $this->getTitle();
@@ -1530,12 +1530,12 @@ class OutputPage extends ContextSource {
        /**
         * Add wikitext with a custom Title object
         *
-        * @param string $text wikitext
-        * @param $title Title object
-        * @param $linestart Boolean: is this the start of a line?
-        * @param $tidy Boolean: whether to use tidy
-        * @param $interface Boolean: whether it is an interface message
-        *                                                              (for example disables conversion)
+        * @param string $text Wikitext
+        * @param Title $title
+        * @param bool $linestart Is this the start of a line?
+        * @param bool $tidy Whether to use tidy
+        * @param bool $interface Whether it is an interface message
+        *   (for example disables conversion)
         */
        public function addWikiTextTitle( $text, Title $title, $linestart, $tidy = false, $interface = false ) {
                global $wgParser;
@@ -1640,16 +1640,14 @@ class OutputPage extends ContextSource {
        /**
         * Parse wikitext and return the HTML.
         *
-        * @param $text String
-        * @param $linestart Boolean: is this the start of a line?
-        * @param $interface Boolean: use interface language ($wgLang instead of
-        *                   $wgContLang) while parsing language sensitive magic
-        *                   words like GRAMMAR and PLURAL. This also disables
-        *                   LanguageConverter.
-        * @param $language  Language object: target language object, will override
-        *                   $interface
+        * @param String $text
+        * @param bool $linestart Is this the start of a line?
+        * @param bool $interface Use interface language ($wgLang instead of
+        *   $wgContLang) while parsing language sensitive magic words like GRAMMAR and PLURAL.
+        *   This also disables LanguageConverter.
+        * @param Language $language Target language object, will override $interface
         * @throws MWException
-        * @return String: HTML
+        * @return string HTML
         */
        public function parse( $text, $linestart = true, $interface = false, $language = null ) {
                global $wgParser;
@@ -1684,12 +1682,12 @@ class OutputPage extends ContextSource {
        /**
         * Parse wikitext, strip paragraphs, and return the HTML.
         *
-        * @param $text String
-        * @param $linestart Boolean: is this the start of a line?
-        * @param $interface Boolean: use interface language ($wgLang instead of
-        *                   $wgContLang) while parsing language sensitive magic
-        *                   words like GRAMMAR and PLURAL
-        * @return String: HTML
+        * @param string $text
+        * @param bool $linestart Is this the start of a line?
+        * @param bool $interface Use interface language ($wgLang instead of
+        *   $wgContLang) while parsing language sensitive magic
+        *   words like GRAMMAR and PLURAL
+        * @return string HTML
         */
        public function parseInline( $text, $linestart = true, $interface = false ) {
                $parsed = $this->parse( $text, $linestart, $interface );
@@ -1705,7 +1703,7 @@ class OutputPage extends ContextSource {
        /**
         * Set the value of the "s-maxage" part of the "Cache-control" HTTP header
         *
-        * @param $maxage Integer: maximum cache time on the Squid, in seconds.
+        * @param int $maxage Maximum cache time on the Squid, in seconds.
         */
        public function setSquidMaxage( $maxage ) {
                $this->mSquidMaxage = $maxage;
@@ -1969,9 +1967,8 @@ class OutputPage extends ContextSource {
        /**
         * Get the message associated with the HTTP response code $code
         *
-        * @param $code Integer: status code
-        * @return String or null: message or null if $code is not in the list of
-        *         messages
+        * @param int $code Status code
+        * @return string|null Message or null if $code is not in the list of messages
         *
         * @deprecated since 1.18 Use HttpStatus::getMessage() instead.
         */
@@ -2147,9 +2144,9 @@ class OutputPage extends ContextSource {
         * showErrorPage( 'titlemsg', $messageObject );
         * showErrorPage( $titleMessageObject, $messageObject );
         *
-        * @param $title Mixed: message key (string) for page title, or a Message object
-        * @param $msg Mixed: message key (string) for page text, or a Message object
-        * @param array $params message parameters; ignored if $msg is a Message object
+        * @param string|Message $title Message key (string) for page title, or a Message object
+        * @param string|Message $msg Message key (string) for page text, or a Message object
+        * @param array $params Message parameters; ignored if $msg is a Message object
         */
        public function showErrorPage( $title, $msg, $params = array() ) {
                if ( !$title instanceof Message ) {
@@ -2246,7 +2243,7 @@ class OutputPage extends ContextSource {
         * Display an error page indicating that a given version of MediaWiki is
         * required to use it
         *
-        * @param $version Mixed: the version of MediaWiki needed to use the page
+        * @param mixed $version The version of MediaWiki needed to use the page
         */
        public function versionRequired( $version ) {
                $this->prepareErrorPage( $this->msg( 'versionrequired', $version ) );
@@ -2277,9 +2274,9 @@ class OutputPage extends ContextSource {
        /**
         * Format a list of error messages
         *
-        * @param array $errors of arrays returned by Title::getUserPermissionsErrors
-        * @param string $action action that was denied or null if unknown
-        * @return String: the wikitext error-messages, formatted into a list.
+        * @param array $errors Array of arrays returned by Title::getUserPermissionsErrors
+        * @param string $action Action that was denied or null if unknown
+        * @return string The wikitext error-messages, formatted into a list.
         */
        public function formatPermissionsErrorMessage( $errors, $action = null ) {
                if ( $action == null ) {
@@ -2326,10 +2323,10 @@ class OutputPage extends ContextSource {
         *
         * @todo Needs to be split into multiple functions.
         *
-        * @param $source    String: source code to show (or null).
-        * @param $protected Boolean: is this a permissions error?
-        * @param $reasons   Array: list of reasons for this error, as returned by Title::getUserPermissionsErrors().
-        * @param $action    String: action that was denied or null if unknown
+        * @param string $source Source code to show (or null).
+        * @param bool $protected Is this a permissions error?
+        * @param array $reasons List of reasons for this error, as returned by Title::getUserPermissionsErrors().
+        * @param string $action Action that was denied or null if unknown
         * @throws ReadOnlyError
         */
        public function readOnlyPage( $source = null, $protected = false, $reasons = array(), $action = null ) {
@@ -2403,7 +2400,7 @@ $templates
         * then the warning is a bit more obvious. If the lag is
         * lower than $wgSlaveLagWarning, then no warning is shown.
         *
-        * @param $lag Integer: slave lag
+        * @param int $lag Slave lag
         */
        public function showLagWarning( $lag ) {
                global $wgSlaveLagWarning, $wgSlaveLagCritical;
@@ -2490,9 +2487,9 @@ $templates
        }
 
        /**
-        * @param $sk Skin The given Skin
-        * @param $includeStyle Boolean: unused
-        * @return String: The doctype, opening "<html>", and head element.
+        * @param Skin $sk The given Skin
+        * @param bool $includeStyle Unused
+        * @return string The doctype, opening "<html>", and head element.
         */
        public function headElement( Skin $sk, $includeStyle = true ) {
                global $wgContLang, $wgMimeType;
@@ -2816,7 +2813,7 @@ $templates
         * JS stuff to put in the "<head>". This is the startup module, config
         * vars and modules marked with position 'top'
         *
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        function getHeadScripts() {
                global $wgResourceLoaderExperimentalAsyncLoading;
@@ -3348,10 +3345,10 @@ $templates
        /**
         * Generate a "<link rel/>" for a feed.
         *
-        * @param string $type feed type
+        * @param string $type Feed type
         * @param string $url URL to the feed
-        * @param string $text value of the "title" attribute
-        * @return String: HTML fragment
+        * @param string $text Value of the "title" attribute
+        * @return string HTML fragment
         */
        private function feedLink( $type, $url, $text ) {
                return Html::element( 'link', array(
@@ -3389,7 +3386,7 @@ $templates
 
        /**
         * Adds inline CSS styles
-        * @param $style_css Mixed: inline CSS
+        * @param mixed $style_css Inline CSS
         * @param string $flip Set to 'flip' to flip the CSS if needed
         */
        public function addInlineStyle( $style_css, $flip = 'noflip' ) {
@@ -3510,9 +3507,8 @@ $templates
         * Generate \<link\> tags for stylesheets
         *
         * @param string $style URL to the file
-        * @param array $options option, can contain 'condition', 'dir', 'media'
-        *                 keys
-        * @return String: HTML fragment
+        * @param array $options Option, can contain 'condition', 'dir', 'media' keys
+        * @return string HTML fragment
         */
        protected function styleLink( $style, $options ) {
                if ( isset( $options['dir'] ) ) {
@@ -3551,8 +3547,8 @@ $templates
        /**
         * Transform "media" attribute based on request parameters
         *
-        * @param string $media current value of the "media" attribute
-        * @return String: modified value of the "media" attribute, or null to skip
+        * @param string $media Current value of the "media" attribute
+        * @return string Modified value of the "media" attribute, or null to skip
         * this stylesheet
         */
        public static function transformCssMedia( $media ) {
@@ -3667,8 +3663,8 @@ $templates
         * Include jQuery core. Use this to avoid loading it multiple times
         * before we get a usable script loader.
         *
-        * @param array $modules list of jQuery modules which should be loaded
-        * @return Array: the list of modules which were not loaded.
+        * @param array $modules List of jQuery modules which should be loaded
+        * @return array The list of modules which were not loaded.
         * @since 1.16
         * @deprecated since 1.17
         */
index 795fd45..3573f4a 100644 (file)
@@ -41,7 +41,7 @@ class Status {
        /** @var bool */
        public $ok = true;
 
-       /** @var mixed  */
+       /** @var mixed */
        public $value;
 
        /** Counters for batch operations */
@@ -52,7 +52,7 @@ class Status {
        public $failCount = 0;
 
        /** Array to indicate which items of the batch operations were successful */
-       /** @var array  */
+       /** @var array */
        public $success = array();
 
        /** @var array */
@@ -90,8 +90,8 @@ class Status {
        /**
         * Change operation result
         *
-        * @param $ok Boolean: whether the operation completed
-        * @param $value Mixed
+        * @param bool $ok Whether the operation completed
+        * @param mixed $value
         */
        public function setResult( $ok, $value = null ) {
                $this->ok = $ok;
@@ -326,8 +326,8 @@ class Status {
        /**
         * Merge another status object into this one
         *
-        * @param $other Status Other Status object
-        * @param $overwriteValue Boolean: whether to override the "value" member
+        * @param Status $other Other Status object
+        * @param bool $overwriteValue Whether to override the "value" member
         */
        public function merge( $other, $overwriteValue = false ) {
                $this->errors = array_merge( $this->errors, $other->errors );
@@ -427,8 +427,8 @@ class Status {
         * Note, due to the lack of tools for comparing Message objects, this
         * function will not work when using a Message object as the search parameter.
         *
-        * @param $source Message|String: Message key or object to search for
-        * @param $dest Message|String: Replacement message key or object
+        * @param Message|string $source Message key or object to search for
+        * @param Message|string $dest Replacement message key or object
         * @return bool Return true if the replacement was done, false otherwise.
         */
        public function replaceMessage( $source, $dest ) {
index d025f35..34ebf3a 100644 (file)
@@ -4343,7 +4343,7 @@ class Title {
         * @param int|Revision $new New revision or rev ID (first after range)
         * @return Int Number of revisions between these revisions.
         */
-       public function countRevisionsBetween( $old, $new ) {
+       public function countRevisionsBetween( $old, $new, $max = null ) {
                if ( !( $old instanceof Revision ) ) {
                        $old = Revision::newFromTitle( $this, (int)$old );
                }
@@ -4354,14 +4354,21 @@ class Title {
                        return 0; // nothing to compare
                }
                $dbr = wfGetDB( DB_SLAVE );
-               return (int)$dbr->selectField( 'revision', 'count(*)',
-                       array(
-                               'rev_page' => $this->getArticleID(),
-                               'rev_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $old->getTimestamp() ) ),
-                               'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
-                       ),
-                       __METHOD__
+               $conds = array(
+                       'rev_page' => $this->getArticleID(),
+                       'rev_timestamp > ' . $dbr->addQuotes( $dbr->timestamp( $old->getTimestamp() ) ),
+                       'rev_timestamp < ' . $dbr->addQuotes( $dbr->timestamp( $new->getTimestamp() ) )
                );
+               if ( $max !== null ) {
+                       $res = $dbr->select( 'revision', '1',
+                               $conds,
+                               __METHOD__,
+                               array( 'LIMIT' => $max + 1 ) // extra to detect truncation
+                       );
+                       return $res->numRows();
+               } else {
+                       return (int)$dbr->selectField( 'revision', 'count(*)', $conds, __METHOD__ );
+               }
        }
 
        /**
index f77a4eb..dd3f351 100644 (file)
@@ -84,7 +84,7 @@ class DifferenceEngine extends ContextSource {
         */
        public $enableDebugComment = false;
 
-       /** @var bool  If true, line X is not displayed when X is 1, for example
+       /** @var bool If true, line X is not displayed when X is 1, for example
         *    to increase readability and conserve space with many small diffs.
         */
        protected $mReducedLineNumbers = false;
@@ -970,8 +970,10 @@ class DifferenceEngine extends ContextSource {
                        $newRev = $this->mNewRev;
                }
 
-               $nEdits = $this->mNewPage->countRevisionsBetween( $oldRev, $newRev );
-               if ( $nEdits > 0 ) {
+               // Sanity: don't show the notice if too many rows must be scanned
+               // @TODO: show some special message for that case
+               $nEdits = $this->mNewPage->countRevisionsBetween( $oldRev, $newRev, 1000 );
+               if ( $nEdits > 0 && $nEdits <= 1000 ) {
                        $limit = 100; // use diff-multi-manyusers if too many users
                        $users = $this->mNewPage->getAuthorsBetween( $oldRev, $newRev, $limit );
                        $numUsers = count( $users );
index 32a9912..0c6ff63 100644 (file)
@@ -76,7 +76,7 @@
     "config-gd": "Found GD graphics library built-in.\nImage thumbnailing will be enabled if you enable uploads.",
     "config-no-scaling": "Could not find GD library or ImageMagick.\nImage thumbnailing will be disabled.",
     "config-no-uri": "<strong>Error:</strong> Could not determine the current URI.\nInstallation aborted.",
-    "config-no-cli-uri": "<strong>Warning:</strong> No --scriptpath specified, using default: <code>$1</code>.",
+    "config-no-cli-uri": "<strong>Warning:</strong> No <code>--scriptpath</code> specified, using default: <code>$1</code>.",
     "config-using-server": "Using server name \"<nowiki>$1</nowiki>\".",
     "config-using-uri": "Using server URL \"<nowiki>$1$2</nowiki>\".",
     "config-uploads-not-safe": "<strong>Warning:</strong> Your default directory for uploads <code>$1</code> is vulnerable to arbitrary scripts execution.\nAlthough MediaWiki checks all uploaded files for security threats, it is highly recommended to [//www.mediawiki.org/wiki/Manual:Security#Upload_security close this security vulnerability] before enabling uploads.",
index 2d7103c..9b13aea 100644 (file)
@@ -304,11 +304,11 @@ abstract class JobQueue {
         *
         * @param Job|array $jobs A single job or an array of Jobs
         * @param int $flags Bitfield (supports JobQueue::QOS_ATOMIC)
-        * @return bool Returns false on failure
+        * @return void
         * @throws JobQueueError
         */
        final public function push( $jobs, $flags = 0 ) {
-               return $this->batchPush( is_array( $jobs ) ? $jobs : array( $jobs ), $flags );
+               $this->batchPush( is_array( $jobs ) ? $jobs : array( $jobs ), $flags );
        }
 
        /**
@@ -318,8 +318,8 @@ abstract class JobQueue {
         *
         * @param array $jobs List of Jobs
         * @param int $flags Bitfield (supports JobQueue::QOS_ATOMIC)
+        * @return void
         * @throws MWException
-        * @return bool Returns false on failure
         */
        final public function batchPush( array $jobs, $flags = 0 ) {
                if ( !count( $jobs ) ) {
@@ -337,17 +337,14 @@ abstract class JobQueue {
                }
 
                wfProfileIn( __METHOD__ );
-               $ok = $this->doBatchPush( $jobs, $flags );
+               $this->doBatchPush( $jobs, $flags );
                wfProfileOut( __METHOD__ );
-
-               return $ok;
        }
 
        /**
         * @see JobQueue::batchPush()
         * @param array $jobs
         * @param $flags
-        * @return bool
         */
        abstract protected function doBatchPush( array $jobs, $flags );
 
@@ -399,24 +396,21 @@ abstract class JobQueue {
         * Outside callers should use JobQueueGroup::ack() instead of this function.
         *
         * @param Job $job
+        * @return void
         * @throws MWException
-        * @return bool
         */
        final public function ack( Job $job ) {
                if ( $job->getType() !== $this->type ) {
                        throw new MWException( "Got '{$job->getType()}' job; expected '{$this->type}'." );
                }
                wfProfileIn( __METHOD__ );
-               $ok = $this->doAck( $job );
+               $this->doAck( $job );
                wfProfileOut( __METHOD__ );
-
-               return $ok;
        }
 
        /**
         * @see JobQueue::ack()
         * @param Job $job
-        * @return bool
         */
        abstract protected function doAck( Job $job );
 
@@ -539,22 +533,19 @@ abstract class JobQueue {
        /**
         * Deleted all unclaimed and delayed jobs from the queue
         *
-        * @return bool Success
         * @throws JobQueueError
         * @since 1.22
+        * @return void
         */
        final public function delete() {
                wfProfileIn( __METHOD__ );
-               $res = $this->doDelete();
+               $this->doDelete();
                wfProfileOut( __METHOD__ );
-
-               return $res;
        }
 
        /**
         * @see JobQueue::delete()
         * @throws MWException
-        * @return bool Success
         */
        protected function doDelete() {
                throw new MWException( "This method is not implemented." );
index 9502148..f2599ae 100644 (file)
@@ -265,7 +265,8 @@ class JobQueueFederated extends JobQueue {
                        /** @var JobQueue $queue */
                        $queue = $this->partitionQueues[$partition];
                        try {
-                               $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
+                               $ok = true;
+                               $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
                                MWExceptionHandler::logException( $e );
@@ -287,7 +288,8 @@ class JobQueueFederated extends JobQueue {
                        $partition = ArrayUtils::pickRandom( $partitionRing->getLocationWeights() );
                        $queue = $this->partitionQueues[$partition];
                        try {
-                               $ok = $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
+                               $ok = true;
+                               $queue->doBatchPush( $jobBatch, $flags | self::QOS_ATOMIC );
                        } catch ( JobQueueError $e ) {
                                $ok = false;
                                MWExceptionHandler::logException( $e );
index 00cd257..340e7f4 100644 (file)
@@ -211,7 +211,8 @@ class MultiHttpClient {
                        $ch = $handles[$index];
                        curl_multi_remove_handle( $chm, $ch );
                        if ( curl_errno( $ch ) !== 0 ) {
-                               $req['error'] = "(curl error: " . curl_errno( $ch ) . ") " . curl_error( $ch );
+                               $req['response']['error'] = "(curl error: " .
+                                       curl_errno( $ch ) . ") " . curl_error( $ch );
                        }
                        // For convenience with the list() operator
                        $req['response'][0] = $req['response']['code'];
index e27e28a..d33fc91 100644 (file)
@@ -42,7 +42,7 @@ class LogPager extends ReverseChronologicalPager {
        /** @var string */
        private $typeCGI = '';
 
-       /** @var LogEventsList  */
+       /** @var LogEventsList */
        public $mLogEventsList;
 
        /**
index 3b448e4..2d9078d 100644 (file)
@@ -591,7 +591,7 @@ class Parser {
         * If $frame is not provided, then template variables (e.g., {{{1}}}) within $text are not expanded
         *
         * @param string $text text extension wants to have parsed
-        * @param $frame PPFrame: The frame to use for expanding any template variables
+        * @param PPFrame $frame The frame to use for expanding any template variables
         *
         * @return string
         */
@@ -628,8 +628,8 @@ class Parser {
         * hook.
         *
         * @param string $text text to be expanded
-        * @param $frame PPFrame: The frame to use for expanding any template variables
-        * @return String
+        * @param PPFrame $frame The frame to use for expanding any template variables
+        * @return string
         * @since 1.19
         */
        public function recursivePreprocess( $text, $frame = false ) {
@@ -680,7 +680,7 @@ class Parser {
         * Set the current user.
         * Should only be used when doing pre-save transform.
         *
-        * @param $user Mixed: User object or null (to reset)
+        * @param User|null $user User object or null (to reset)
         */
        function setUser( $user ) {
                $this->mUser = $user;
@@ -745,7 +745,7 @@ class Parser {
        /**
         * Set the output type
         *
-        * @param $ot Integer: new value
+        * @param int $ot new value
         */
        function setOutputType( $ot ) {
                $this->mOutputType = $ot;
@@ -888,11 +888,11 @@ class Parser {
         *     '<element param="x">tag content</element>' ) )
         * @endcode
         *
-        * @param array $elements list of element names. Comments are always extracted.
+        * @param array $elements List of element names. Comments are always extracted.
         * @param string $text Source text string.
         * @param array $matches Out parameter, Array: extracted tags
-        * @param $uniq_prefix string
-        * @return String: stripped text
+        * @param string $uniq_prefix
+        * @return string Stripped text
         */
        public static function extractTagsAndParams( $elements, $text, &$matches, $uniq_prefix = '' ) {
                static $n = 1;
@@ -1821,9 +1821,9 @@ class Parser {
        /**
         * Process [[ ]] wikilinks
         *
-        * @param $s string
+        * @param string $s
         *
-        * @return String: processed text
+        * @return string Processed text
         *
         * @private
         */
@@ -2175,12 +2175,12 @@ class Parser {
         * breaking URLs in the following text without breaking trails on the
         * wiki links, it's been made into a horrible function.
         *
-        * @param $nt Title
-        * @param $text String
-        * @param array $query or String
-        * @param $trail String
-        * @param $prefix String
-        * @return String: HTML-wikitext mix oh yuck
+        * @param Title $nt
+        * @param string $text
+        * @param array|string $query
+        * @param string $trail
+        * @param string $prefix
+        * @return string HTML-wikitext mix oh yuck
         */
        function makeKnownLinkHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
                list( $inside, $trail ) = Linker::splitTrail( $trail );
@@ -2204,8 +2204,8 @@ class Parser {
         * Not needed quite as much as it used to be since free links are a bit
         * more sensible these days. But bracketed links are still an issue.
         *
-        * @param string $text more-or-less HTML
-        * @return String: less-or-more HTML with NOPARSE bits
+        * @param string $text More-or-less HTML
+        * @return string Less-or-more HTML with NOPARSE bits
         */
        function armorLinks( $text ) {
                return preg_replace( '/\b((?i)' . $this->mUrlProtocols . ')/',
@@ -2224,9 +2224,9 @@ class Parser {
        /**
         * Handle link to subpage if necessary
         *
-        * @param string $target the source of the link
-        * @param &$text String: the link text, modified as necessary
-        * @return string the full name of the link
+        * @param string $target The source of the link
+        * @param string &$text The link text, modified as necessary
+        * @return string The full name of the link
         * @private
         */
        function maybeDoSubpageLink( $target, &$text ) {
@@ -2357,10 +2357,10 @@ class Parser {
        /**
         * Make lists from lines starting with ':', '*', '#', etc. (DBL)
         *
-        * @param $text String
-        * @param $linestart Boolean: whether or not this is at the start of a line.
+        * @param string $text
+        * @param bool $linestart Whether or not this is at the start of a line.
         * @private
-        * @return string the lists rendered as HTML
+        * @return string The lists rendered as HTML
         */
        function doBlockLevels( $text, $linestart ) {
                wfProfileIn( __METHOD__ );
@@ -3073,9 +3073,9 @@ class Parser {
         * This is the ghost of replace_variables().
         *
         * @param string $text The text to parse
-        * @param $flags Integer: bitwise combination of:
-        *          self::PTD_FOR_INCLUSION    Handle "<noinclude>" and "<includeonly>" as if the text is being
-        *                                     included. Default is to assume a direct page view.
+        * @param int $flags Bitwise combination of:
+        *   - self::PTD_FOR_INCLUSION: Handle "<noinclude>" and "<includeonly>" as if the text is being
+        *     included. Default is to assume a direct page view.
         *
         * The generated DOM tree must depend only on the input text and the flags.
         * The DOM tree must be the same in OT_HTML and OT_WIKI mode, to avoid a regression of bug 4899.
@@ -3221,13 +3221,13 @@ class Parser {
         * Return the text of a template, after recursively
         * replacing any variables or templates within the template.
         *
-        * @param array $piece the parts of the template
+        * @param array $piece The parts of the template
         *  $piece['title']: the title, i.e. the part before the |
         *  $piece['parts']: the parameter array
         *  $piece['lineStart']: whether the brace was at the start of a line
-        * @param $frame PPFrame The current frame, contains template arguments
+        * @param PPFrame $frame The current frame, contains template arguments
         * @throws MWException
-        * @return String: the text of the template
+        * @return string The text of the template
         * @private
         */
        function braceSubstitution( $piece, $frame ) {
@@ -3733,8 +3733,8 @@ class Parser {
         * Static function to get a template
         * Can be overridden via ParserOptions::setTemplateCallback().
         *
-        * @param $title  Title
-        * @param $parser Parser
+        * @param Title $title
+        * @param Parser $parser
         *
         * @return array
         */
@@ -4069,9 +4069,9 @@ class Parser {
        /**
         * Increment an include size counter
         *
-        * @param string $type the type of expansion
-        * @param $size Integer: the size of the text
-        * @return Boolean: false if this inclusion would take it over the maximum, true otherwise
+        * @param string $type The type of expansion
+        * @param int $size The size of the text
+        * @return bool false if this inclusion would take it over the maximum, true otherwise
         */
        function incrementIncludeSize( $type, $size ) {
                if ( $this->mIncludeSizes[$type] + $size > $this->mOptions->getMaxIncludeSize() ) {
@@ -4085,7 +4085,7 @@ class Parser {
        /**
         * Increment the expensive function count
         *
-        * @return Boolean: false if the limit has been exceeded
+        * @return bool false if the limit has been exceeded
         */
        function incrementExpensiveFunctionCount() {
                $this->mExpensiveFunctionCount++;
@@ -4159,8 +4159,8 @@ class Parser {
         * $wgTrackingCategories. That way they will be listed on
         * Special:TrackingCategories.
         *
-        * @param string $msg message key
-        * @return Boolean: whether the addition was successful
+        * @param string $msg Message key
+        * @return bool Whether the addition was successful
         */
        public function addTrackingCategory( $msg ) {
                if ( $this->mTitle->getNamespace() === NS_SPECIAL ) {
@@ -4578,12 +4578,12 @@ class Parser {
         * Transform wiki markup when saving a page by doing "\r\n" -> "\n"
         * conversion, substitting signatures, {{subst:}} templates, etc.
         *
-        * @param string $text the text to transform
-        * @param $title Title: the Title object for the current article
-        * @param $user User: the User object describing the current user
-        * @param $options ParserOptions: parsing options
-        * @param $clearState Boolean: whether to clear the parser state first
-        * @return String: the altered wiki markup
+        * @param string $text The text to transform
+        * @param Title $title The Title object for the current article
+        * @param User $user The User object describing the current user
+        * @param ParserOptions $options Parsing options
+        * @param bool $clearState Whether to clear the parser state first
+        * @return string The altered wiki markup
         */
        public function preSaveTransform( $text, Title $title, User $user, ParserOptions $options, $clearState = true ) {
                $this->startParse( $title, $options, self::OT_WIKI, $clearState );
@@ -4753,9 +4753,9 @@ class Parser {
         * 1) Strip ~~~, ~~~~ and ~~~~~ out of signatures @see cleanSigInSig
         * 2) Substitute all transclusions
         *
-        * @param $text String
+        * @param string $text
         * @param bool $parsing Whether we're cleaning (preferences save) or parsing
-        * @return String: signature text
+        * @return string Signature text
         */
        public function cleanSig( $text, $parsing = false ) {
                if ( !$parsing ) {
@@ -4790,8 +4790,8 @@ class Parser {
        /**
         * Strip ~~~, ~~~~ and ~~~~~ out of signatures
         *
-        * @param $text String
-        * @return String: signature text with /~{3,5}/ removed
+        * @param string $text
+        * @return string Signature text with /~{3,5}/ removed
         */
        public static function cleanSigInSig( $text ) {
                $text = preg_replace( '/~{3,5}/', '', $text );
@@ -4829,10 +4829,10 @@ class Parser {
        /**
         * Wrapper for preprocess()
         *
-        * @param string $text the text to preprocess
-        * @param $options ParserOptions: options
-        * @param $title Title object or null to use $wgTitle
-        * @return String
+        * @param string $text The text to preprocess
+        * @param ParserOptions $options Options
+        * @param Title|null $title Title object or null to use $wgTitle
+        * @return string
         */
        public function transformMsg( $text, $options, $title = null ) {
                static $executing = false;
@@ -4875,10 +4875,10 @@ class Parser {
         * this interface, as it is not documented and injudicious use could smash
         * private variables.**
         *
-        * @param $tag Mixed: the tag to use, e.g. 'hook' for "<hook>"
-        * @param $callback Mixed: the callback function (and object) to use for the tag
+        * @param string $tag The tag to use, e.g. 'hook' for "<hook>"
+        * @param mixed $callback The callback function (and object) to use for the tag
         * @throws MWException
-        * @return Mixed|null The old value of the mTagHooks array associated with the hook
+        * @return mixed|null The old value of the mTagHooks array associated with the hook
         */
        public function setHook( $tag, $callback ) {
                $tag = strtolower( $tag );
@@ -4906,10 +4906,10 @@ class Parser {
         * @since 1.10
         * @todo better document or deprecate this
         *
-        * @param $tag Mixed: the tag to use, e.g. 'hook' for "<hook>"
-        * @param $callback Mixed: the callback function (and object) to use for the tag
+        * @param string $tag The tag to use, e.g. 'hook' for "<hook>"
+        * @param mixed $callback The callback function (and object) to use for the tag
         * @throws MWException
-        * @return Mixed|null The old value of the mTagHooks array associated with the hook
+        * @return mixed|null The old value of the mTagHooks array associated with the hook
         */
        function setTransparentTagHook( $tag, $callback ) {
                $tag = strtolower( $tag );
@@ -4948,8 +4948,8 @@ class Parser {
         *   isHTML                    The returned text is HTML, armour it against wikitext transformation
         *
         * @param string $id The magic word ID
-        * @param $callback Mixed: the callback function (and object) to use
-        * @param $flags Integer: a combination of the following flags:
+        * @param mixed $callback The callback function (and object) to use
+        * @param int $flags A combination of the following flags:
         *     SFH_NO_HASH   No leading hash, i.e. {{plural:...}} instead of {{#if:...}}
         *
         *     SFH_OBJECT_ARGS   Pass the template arguments as PPNode objects instead of text. This
@@ -5605,10 +5605,10 @@ class Parser {
         * string. If $text is the empty string and section 0 is replaced, $newText is
         * returned.
         *
-        * @param string $mode one of "get" or "replace"
-        * @param string $newText replacement text for section data.
-        * @return String: for "get", the extracted section text.
-        *                 for "replace", the whole page with the section replaced.
+        * @param string $mode One of "get" or "replace"
+        * @param string $newText Replacement text for section data.
+        * @return string For "get", the extracted section text.
+        *   for "replace", the whole page with the section replaced.
         */
        private function extractSections( $text, $section, $mode, $newText = '' ) {
                global $wgTitle; # not generally used but removes an ugly failure mode
@@ -5740,10 +5740,10 @@ class Parser {
         * specified by $section has been replaced with $text. If the target
         * section does not exist, $oldtext is returned unchanged.
         *
-        * @param string $oldtext former text of the article
-        * @param int $section section identifier
-        * @param string $text replacing text
-        * @return String: modified text
+        * @param string $oldtext Former text of the article
+        * @param int $section Section identifier
+        * @param string $text Replacing text
+        * @return string Modified text
         */
        public function replaceSection( $oldtext, $section, $text ) {
                return $this->extractSections( $oldtext, $section, "replace", $text );
@@ -5752,7 +5752,7 @@ class Parser {
        /**
         * Get the ID of the revision we are parsing
         *
-        * @return Mixed: integer or null
+        * @return int|null
         */
        function getRevisionId() {
                return $this->mRevisionId;
@@ -5805,7 +5805,7 @@ class Parser {
        /**
         * Get the name of the user that edited the last revision
         *
-        * @return String: user name
+        * @return string User name
         */
        function getRevisionUser() {
                if ( is_null( $this->mRevisionUser ) ) {
index 4c7084e..ff74f2a 100644 (file)
@@ -125,9 +125,9 @@ class ParserCache {
         *
         * @todo Document parameter $useOutdated
         *
-        * @param $article     Article
-        * @param $popts       ParserOptions
-        * @param $useOutdated Boolean (default true)
+        * @param Article $article
+        * @param ParserOptions $popts
+        * @param bool $useOutdated (default true)
         * @return bool|mixed|string
         */
        public function getKey( $article, $popts, $useOutdated = true ) {
@@ -171,9 +171,9 @@ class ParserCache {
         * Retrieve the ParserOutput from ParserCache.
         * false if not found or outdated.
         *
-        * @param $article     Article
-        * @param $popts       ParserOptions
-        * @param $useOutdated Boolean (default false)
+        * @param Article $article
+        * @param ParserOptions $popts
+        * @param bool $useOutdated (default false)
         *
         * @return ParserOutput|bool False on failure
         */
index 7c6dde6..edd4911 100644 (file)
@@ -286,7 +286,7 @@ class ParserOptions {
        /**
         * Same as getUserLangObj() but returns a string instead.
         *
-        * @return String   Language code
+        * @return String Language code
         * @since 1.17
         */
        function getUserLang() {
@@ -478,8 +478,8 @@ class ParserOptions {
         * settings.
         *
         * @since 1.17
-        * @param $forOptions Array
-        * @param $title Title: used to get the content language of the page (since r97636)
+        * @param array $forOptions
+        * @param Title $title Used to get the content language of the page (since r97636)
         * @return string Page rendering hash
         */
        public function optionsHash( $forOptions, $title = null ) {
index f8e5c84..08edf73 100644 (file)
@@ -67,7 +67,7 @@ class UserrightsPage extends SpecialPage {
         * Manage forms to be shown according to posted data.
         * Depending on the submit button used, call a form or a save function.
         *
-        * @param $par Mixed: string if any subpage provided, else null
+        * @param string|null $par String if any subpage provided, else null
         * @throws UserBlockedError|PermissionsError
         */
        public function execute( $par ) {
@@ -218,11 +218,11 @@ class UserrightsPage extends SpecialPage {
        /**
         * Save user groups changes in the database.
         *
-        * @param $user User object
-        * @param array $add of groups to add
-        * @param array $remove of groups to remove
-        * @param string $reason reason for group change
-        * @return Array: Tuple of added, then removed groups
+        * @param User $user
+        * @param array $add Array of groups to add
+        * @param array $remove Array of groups to remove
+        * @param string $reason Reason for group change
+        * @return array Tuple of added, then removed groups
         */
        function doSaveUserGroups( $user, $add, $remove, $reason = '' ) {
                global $wgAuth;
@@ -445,8 +445,8 @@ class UserrightsPage extends SpecialPage {
         * form will be able to manipulate based on the current user's system
         * permissions.
         *
-        * @param array $groups list of groups the given user is in
-        * @return Array:  Tuple of addable, then removable groups
+        * @param array $groups List of groups the given user is in
+        * @return array Tuple of addable, then removable groups
         */
        protected function splitGroups( $groups ) {
                list( $addable, $removable, $addself, $removeself ) = array_values( $this->changeableGroups() );
@@ -466,8 +466,8 @@ class UserrightsPage extends SpecialPage {
        /**
         * Show the form to edit group memberships.
         *
-        * @param $user      User or UserRightsProxy you're editing
-        * @param $groups    Array:  Array of groups the user is in
+        * @param User|UserRightsProxy $user User or UserRightsProxy you're editing
+        * @param array $groups Array of groups the user is in
         */
        protected function showEditUserGroupsForm( $user, $groups ) {
                $list = array();
@@ -682,7 +682,7 @@ class UserrightsPage extends SpecialPage {
        }
 
        /**
-        * @param $group String: the name of the group to check
+        * @param string $group The name of the group to check
         * @return bool Can we remove the group?
         */
        private function canRemove( $group ) {
index 5c3f509..f07d97b 100644 (file)
@@ -422,7 +422,7 @@ class SpecialVersion extends SpecialPage {
        /**
         * Generate wikitext showing extensions name, URL, author and description.
         *
-        * @return String: Wikitext
+        * @return string Wikitext
         */
        function getExtensionCredits() {
                global $wgExtensionCredits;
@@ -761,7 +761,7 @@ class SpecialVersion extends SpecialPage {
        /**
         * Generate wikitext showing hooks in $wgHooks.
         *
-        * @return String: wikitext
+        * @return string Wikitext
         */
        private function getWgHooks() {
                global $wgSpecialVersionShowHooks, $wgHooks;
@@ -832,7 +832,7 @@ class SpecialVersion extends SpecialPage {
        /**
         * Get information about client's IP address.
         *
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        private function IPInfo() {
                $ip = str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) );
@@ -854,11 +854,11 @@ class SpecialVersion extends SpecialPage {
         *   If no '...' string variant is found, but an authors file is found an
         *   'and others' will be added to the end of the credits.
         *
-        * @param $authors mixed: string or array of strings
-        * @param $extName string: name of the extension for link creation
-        * @param $extDir  string: path to the extension root directory
+        * @param string|array $authors
+        * @param string $extName Name of the extension for link creation
+        * @param string $extDir Path to the extension root directory
         *
-        * @return String: HTML fragment
+        * @return string HTML fragment
         */
        function listAuthors( $authors, $extName, $extDir ) {
                $hasOthers = false;
@@ -958,10 +958,10 @@ class SpecialVersion extends SpecialPage {
        /**
         * Convert an array of items into a list for display.
         *
-        * @param array $list of elements to display
-        * @param $sort Boolean: whether to sort the items in $list
+        * @param array $list List of elements to display
+        * @param bool $sort Whether to sort the items in $list
         *
-        * @return String
+        * @return string
         */
        function listToText( $list, $sort = true ) {
                $cnt = count( $list );
@@ -984,10 +984,10 @@ class SpecialVersion extends SpecialPage {
        /**
         * Convert an array or object to a string for display.
         *
-        * @param $list Mixed: will convert an array to string if given and return
-        *              the paramater unaltered otherwise
+        * @param mixed $list will convert an array to string if given and return
+        *   the paramater unaltered otherwise
         *
-        * @return Mixed
+        * @return mixed
         */
        public static function arrayToString( $list ) {
                if ( is_array( $list ) && count( $list ) == 1 ) {
@@ -1098,7 +1098,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @param string $dir directory of the svn checkout
         *
-        * @return Integer: revision number as int
+        * @return int Revision number
         */
        public static function getSvnRevision( $dir ) {
                $info = self::getSvnInfo( $dir );
index f50eb49..ad2196d 100644 (file)
@@ -177,12 +177,12 @@ class UploadStash {
        /**
         * Stash a file in a temp directory and record that we did this in the database, along with other metadata.
         *
-        * @param string $path path to file you want stashed
-        * @param string $sourceType the type of upload that generated this file (currently, I believe, 'file' or null)
+        * @param string $path Path to file you want stashed
+        * @param string $sourceType The type of upload that generated this file (currently, I believe, 'file' or null)
         * @throws UploadStashBadPathException
         * @throws UploadStashFileException
         * @throws UploadStashNotLoggedInException
-        * @return UploadStashFile: file, or null on failure
+        * @return UploadStashFile|null File, or null on failure
         */
        public function stashFile( $path, $sourceType = null ) {
                if ( !is_file( $path ) ) {
@@ -293,7 +293,7 @@ class UploadStash {
         * Does not clean up files in the repo, just the record of them.
         *
         * @throws UploadStashNotLoggedInException
-        * @return boolean: success
+        * @return bool success
         */
        public function clear() {
                if ( !$this->isLoggedIn ) {
@@ -318,9 +318,9 @@ class UploadStash {
        /**
         * Remove a particular file from the stash.  Also removes it from the repo.
         *
-        * @param $key
+        * @param string $key
         * @throws UploadStashNoSuchKeyException|UploadStashNotLoggedInException|UploadStashWrongOwnerException
-        * @return boolean: success
+        * @return bool Success
         */
        public function removeFile( $key ) {
                if ( !$this->isLoggedIn ) {
@@ -352,7 +352,8 @@ class UploadStash {
        /**
         * Remove a file (see removeFile), but doesn't check ownership first.
         *
-        * @return boolean: success
+        * @param string $key
+        * @return bool Success
         */
        public function removeFileNoAuth( $key ) {
                wfDebug( __METHOD__ . " clearing row $key\n" );
@@ -456,8 +457,8 @@ class UploadStash {
        /**
         * Helper function: do the actual database query to fetch file metadata.
         *
-        * @param string $key key
-        * @param $readFromDB: constant (default: DB_SLAVE)
+        * @param string $key
+        * @param int $readFromDB Constant (default: DB_SLAVE)
         * @return boolean
         */
        protected function fetchFileMetadata( $key, $readFromDB = DB_SLAVE ) {
@@ -514,9 +515,9 @@ class UploadStashFile extends UnregisteredLocalFile {
         * A LocalFile wrapper around a file that has been temporarily stashed, so we can do things like create thumbnails for it
         * Arguably UnregisteredLocalFile should be handling its own file repo but that class is a bit retarded currently
         *
-        * @param $repo FileRepo: repository where we should find the path
-        * @param string $path path to file
-        * @param string $key key to store the path and any stashed data under
+        * @param FileRepo $repo Repository where we should find the path
+        * @param string $path Path to file
+        * @param string $key Key to store the path and any stashed data under
         * @throws UploadStashBadPathException
         * @throws UploadStashFileNotFoundException
         */
@@ -554,7 +555,7 @@ class UploadStashFile extends UnregisteredLocalFile {
         * However, we also can't return the empty string, as the rest of MediaWiki demands this (and calls to imagemagick
         * convert require it to be there)
         *
-        * @return String: dummy value
+        * @return string Dummy value
         */
        public function getDescriptionUrl() {
                return $this->getUrl();
@@ -565,8 +566,8 @@ class UploadStashFile extends UnregisteredLocalFile {
         * The actual argument is the result of thumbName although we seem to have
         * buggy code elsewhere that expects a boolean 'suffix'
         *
-        * @param string $thumbName name of thumbnail (e.g. "120px-123456.jpg" ), or false to just get the path
-        * @return String: path thumbnail should take on filesystem, or containing directory if thumbname is false
+        * @param string $thumbName Name of thumbnail (e.g. "120px-123456.jpg" ), or false to just get the path
+        * @return string Path thumbnail should take on filesystem, or containing directory if thumbname is false
         */
        public function getThumbPath( $thumbName = false ) {
                $path = dirname( $this->path );
@@ -581,9 +582,9 @@ class UploadStashFile extends UnregisteredLocalFile {
         * We override this because we want to use the pretty url name instead of the
         * ugly file name.
         *
-        * @param array $params handler-specific parameters
-        * @param $flags integer Bitfield that supports THUMB_* constants
-        * @return String: base name for URL, like '120px-12345.jpg', or null if there is no handler
+        * @param array $params Handler-specific parameters
+        * @param int $flags Bitfield that supports THUMB_* constants
+        * @return string Base name for URL, like '120px-12345.jpg', or null if there is no handler
         */
        function thumbName( $params, $flags = 0 ) {
                return $this->generateThumbName( $this->getUrlName(), $params );
@@ -591,8 +592,8 @@ class UploadStashFile extends UnregisteredLocalFile {
 
        /**
         * Helper function -- given a 'subpage', return the local URL e.g. /wiki/Special:UploadStash/subpage
-        * @param $subPage String
-        * @return String: local URL for this subpage in the Special:UploadStash space.
+        * @param string $subPage
+        * @return string Local URL for this subpage in the Special:UploadStash space.
         */
        private function getSpecialUrl( $subPage ) {
                return SpecialPage::getTitleFor( 'UploadStash', $subPage )->getLocalURL();
@@ -604,8 +605,8 @@ class UploadStashFile extends UnregisteredLocalFile {
         * the thumbnail urls be predictable. However, in our model the URL is not based on the filename
         * (that's hidden in the db)
         *
-        * @param string $thumbName basename of thumbnail file -- however, we don't want to use the file exactly
-        * @return String: URL to access thumbnail, or URL with partial path
+        * @param string $thumbName Basename of thumbnail file -- however, we don't want to use the file exactly
+        * @return string URL to access thumbnail, or URL with partial path
         */
        public function getThumbUrl( $thumbName = false ) {
                wfDebug( __METHOD__ . " getting for $thumbName \n" );
@@ -616,7 +617,7 @@ class UploadStashFile extends UnregisteredLocalFile {
         * The basename for the URL, which we want to not be related to the filename.
         * Will also be used as the lookup key for a thumbnail file.
         *
-        * @return String: base url name, like '120px-123456.jpg'
+        * @return string Base url name, like '120px-123456.jpg'
         */
        public function getUrlName() {
                if ( ! $this->urlName ) {
@@ -629,7 +630,7 @@ class UploadStashFile extends UnregisteredLocalFile {
         * Return the URL of the file, if for some reason we wanted to download it
         * We tend not to do this for the original file, but we do want thumb icons
         *
-        * @return String: url
+        * @return string Url
         */
        public function getUrl() {
                if ( !isset( $this->url ) ) {
@@ -642,7 +643,7 @@ class UploadStashFile extends UnregisteredLocalFile {
         * Parent classes use this method, for no obvious reason, to return the path (relative to wiki root, I assume).
         * But with this class, the URL is unrelated to the path.
         *
-        * @return String: url
+        * @return string Url
         */
        public function getFullUrl() {
                return $this->getUrl();
@@ -651,7 +652,7 @@ class UploadStashFile extends UnregisteredLocalFile {
        /**
         * Getter for file key (the unique id by which this file's location & metadata is stored in the db)
         *
-        * @return String: file key
+        * @return string File key
         */
        public function getFileKey() {
                return $this->fileKey;
@@ -659,7 +660,7 @@ class UploadStashFile extends UnregisteredLocalFile {
 
        /**
         * Remove the associated temporary file
-        * @return Status: success
+        * @return status Success
         */
        public function remove() {
                if ( !$this->repo->fileExists( $this->path ) ) {
index 0eac06e..c7bb4f3 100644 (file)
@@ -500,6 +500,6 @@ class UIDGenerator {
        }
 
        function __destruct() {
-               array_map( 'fclose', $this->fileHandles );
+               array_map( 'fclose', array_filter( $this->fileHandles ) );
        }
 }
index 57e73da..e2f0e91 100644 (file)
@@ -55,7 +55,7 @@ class LanguageConverter {
        public $mManualLevel;
 
        /**
-        * @var String: memcached key name
+        * @var string memcached key name
         */
        public $mCacheKey;
 
@@ -75,12 +75,12 @@ class LanguageConverter {
        /**
         * Constructor
         *
-        * @param $langobj Language: the Language Object
-        * @param $maincode String: the main language code of this language
-        * @param $variants Array: the supported variants of this language
-        * @param $variantfallbacks Array: the fallback language of each variant
-        * @param $flags Array: defining the custom strings that maps to the flags
-        * @param $manualLevel Array: limit for supported variants
+        * @param Language $langobj
+        * @param string $maincode The main language code of this language
+        * @param array $variants The supported variants of this language
+        * @param array $variantfallbacks The fallback language of each variant
+        * @param array $flags Defining the custom strings that maps to the flags
+        * @param array $manualLevel Limit for supported variants
         */
        public function __construct( $langobj, $maincode, $variants = array(),
                                                                $variantfallbacks = array(), $flags = array(),
@@ -120,7 +120,7 @@ class LanguageConverter {
         * Get all valid variants.
         * Call this instead of using $this->mVariants directly.
         *
-        * @return Array: contains all valid variants
+        * @return array Contains all valid variants
         */
        public function getVariants() {
                return $this->mVariants;
@@ -133,9 +133,9 @@ class LanguageConverter {
         * when zh-sg is preferred but not defined, we will pick zh-hans
         * in this case. Right now this is only used by zh.
         *
-        * @param $variant String: the language code of the variant
-        * @return String|array: The code of the fallback language or the
-        *                               main code if there is no fallback
+        * @param string $variant The language code of the variant
+        * @return string|array The code of the fallback language or the
+        *   main code if there is no fallback
         */
        public function getVariantFallbacks( $variant ) {
                if ( isset( $this->mVariantFallbacks[$variant] ) ) {
@@ -146,7 +146,7 @@ class LanguageConverter {
 
        /**
         * Get the title produced by the conversion rule.
-        * @return String: The converted title text
+        * @return string The converted title text
         */
        public function getConvRuleTitle() {
                return $this->mConvRuleTitle;
@@ -154,7 +154,7 @@ class LanguageConverter {
 
        /**
         * Get preferred language variant.
-        * @return String: the preferred language code
+        * @return string The preferred language code
         */
        public function getPreferredVariant() {
                global $wgDefaultLanguageVariant, $wgUser;
@@ -184,7 +184,7 @@ class LanguageConverter {
        /**
         * Get default variant.
         * This function would not be affected by user's settings
-        * @return String: the default variant code
+        * @return string The default variant code
         */
        public function getDefaultVariant() {
                global $wgDefaultLanguageVariant;
@@ -207,8 +207,8 @@ class LanguageConverter {
 
        /**
         * Validate the variant
-        * @param $variant String: the variant to validate
-        * @return Mixed: returns the variant if it is valid, null otherwise
+        * @param string $variant The variant to validate
+        * @return mixed Returns the variant if it is valid, null otherwise
         */
        public function validateVariant( $variant = null ) {
                if ( $variant !== null && in_array( $variant, $this->mVariants ) ) {
@@ -220,7 +220,7 @@ class LanguageConverter {
        /**
         * Get the variant specified in the URL
         *
-        * @return Mixed: variant if one found, false otherwise.
+        * @return mixed Variant if one found, false otherwise.
         */
        public function getURLVariant() {
                global $wgRequest;
@@ -243,7 +243,7 @@ class LanguageConverter {
        /**
         * Determine if the user has a variant set.
         *
-        * @return Mixed: variant if one found, false otherwise.
+        * @return mixed Variant if one found, false otherwise.
         */
        protected function getUserVariant() {
                global $wgUser, $wgContLang;
@@ -277,7 +277,7 @@ class LanguageConverter {
        /**
         * Determine the language variant from the Accept-Language header.
         *
-        * @return Mixed: variant if one found, false otherwise.
+        * @return mixed Variant if one found, false otherwise.
         */
        protected function getHeaderVariant() {
                global $wgRequest;
@@ -456,9 +456,9 @@ class LanguageConverter {
         * Doesn't parse rules or do any of that other stuff, for that use
         * convert() or convertTo().
         *
-        * @param $text String: text to convert
-        * @param $variant String: variant language code
-        * @return String: translated text
+        * @param string $text Text to convert
+        * @param string $variant Variant language code
+        * @return string Translated text
         */
        public function translate( $text, $variant ) {
                wfProfileIn( __METHOD__ );
@@ -475,8 +475,8 @@ class LanguageConverter {
        /**
         * Call translate() to convert text to all valid variants.
         *
-        * @param $text String: the text to be converted
-        * @return Array: variant => converted text
+        * @param string $text The text to be converted
+        * @return array Variant => converted text
         */
        public function autoConvertToAllVariants( $text ) {
                wfProfileIn( __METHOD__ );
@@ -534,8 +534,8 @@ class LanguageConverter {
         * Auto convert a Title object to a readable string in the
         * preferred variant.
         *
-        * @param $title Title a object of Title
-        * @return String: converted title text
+        * @param Title $title A object of Title
+        * @return string Converted title text
         */
        public function convertTitle( $title ) {
                $variant = $this->getPreferredVariant();
@@ -552,9 +552,9 @@ class LanguageConverter {
        /**
         * Get the namespace display name in the preferred variant.
         *
-        * @param $index int namespace id
-        * @param $variant string|null variant code or null for preferred variant
-        * @return String: namespace name for display
+        * @param int $index Namespace id
+        * @param string|null $variant Variant code or null for preferred variant
+        * @return string Namespace name for display
         */
        public function convertNamespace( $index, $variant = null ) {
                if ( $variant === null ) {
@@ -591,8 +591,8 @@ class LanguageConverter {
         * -{flags|code1:text1;code2:text2;...}-  or
         * -{text}- in which case no conversion should take place for text
         *
-        * @param $text String: text to be converted
-        * @return String: converted text
+        * @param string $text Text to be converted
+        * @return string Converted text
         */
        public function convert( $text ) {
                $variant = $this->getPreferredVariant();
@@ -602,9 +602,9 @@ class LanguageConverter {
        /**
         * Same as convert() except a extra parameter to custom variant.
         *
-        * @param $text String: text to be converted
-        * @param $variant String: the target variant code
-        * @return String: converted text
+        * @param string $text Text to be converted
+        * @param string $variant The target variant code
+        * @return string Converted text
         */
        public function convertTo( $text, $variant ) {
                global $wgDisableLangConversion;
@@ -620,10 +620,10 @@ class LanguageConverter {
         * Recursively convert text on the outside. Allow to use nested
         * markups to custom rules.
         *
-        * @param $text String: text to be converted
-        * @param $variant String: the target variant code
-        * @param $depth Integer: depth of recursion
-        * @return String: converted text
+        * @param string $text Text to be converted
+        * @param string $variant The target variant code
+        * @param int $depth Depth of recursion
+        * @return string Converted text
         */
        protected function recursiveConvertTopLevel( $text, $variant, $depth = 0 ) {
                $startPos = 0;
@@ -659,13 +659,13 @@ class LanguageConverter {
        /**
         * Recursively convert text on the inside.
         *
-        * @param $text String: text to be converted
-        * @param $variant String: the target variant code
-        * @param $startPos int
-        * @param $depth Integer: depth of recursion
+        * @param string $text Text to be converted
+        * @param string $variant The target variant code
+        * @param int $startPos
+        * @param int $depth Depth of recursion
         *
         * @throws MWException
-        * @return String: converted text
+        * @return string Converted text
         */
        protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) {
                // Quick sanity check (no function calls)
@@ -739,11 +739,11 @@ class LanguageConverter {
         * non-existing link in one variant actually exists in another variant.
         * This function tries to find it. See e.g. LanguageZh.php
         *
-        * @param $link String: the name of the link
-        * @param $nt Mixed: the title object of the link
-        * @param $ignoreOtherCond Boolean: to disable other conditions when
-        *              we need to transclude a template or update a category's link
-        * @return Null, the input parameters may be modified upon return
+        * @param string $link The name of the link
+        * @param mixed $nt The title object of the link
+        * @param bool $ignoreOtherCond To disable other conditions when
+        *   we need to transclude a template or update a category's link
+        * @return void Null, the input parameters may be modified upon return
         */
        public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                # If the article has already existed, there is no need to
@@ -843,7 +843,7 @@ class LanguageConverter {
        /**
         * Load conversion tables either from the cache or the disk.
         * @private
-        * @param $fromCache Boolean: load from memcached? Defaults to true.
+        * @param bool $fromCache Load from memcached? Defaults to true.
         */
        function loadTables( $fromCache = true ) {
                global $wgLangConvMemc;
@@ -911,9 +911,9 @@ class LanguageConverter {
         * To make the tables more manageable, subpages are allowed
         * and will be parsed recursively if $recursive == true.
         *
-        * @param $code String: language code
-        * @param $subpage String: subpage name
-        * @param $recursive Boolean: parse subpages recursively? Defaults to true.
+        * @param string $code Language code
+        * @param string $subpage Subpage name
+        * @param bool $recursive Parse subpages recursively? Defaults to true.
         *
         * @return array
         */
@@ -1020,9 +1020,9 @@ class LanguageConverter {
         * Enclose a string with the "no conversion" tag. This is used by
         * various functions in the Parser.
         *
-        * @param $text String: text to be tagged for no conversion
-        * @param $noParse Boolean: unused
-        * @return String: the tagged text
+        * @param string $text Text to be tagged for no conversion
+        * @param bool $noParse Unused
+        * @return string The tagged text
         */
        public function markNoConversion( $text, $noParse = false ) {
                # don't mark if already marked
@@ -1051,16 +1051,16 @@ class LanguageConverter {
         * MediaWiki:Conversiontable* is updated.
         * @private
         *
-        * @param $page WikiPage object
-        * @param $user Object: User object for the current user
-        * @param $content Content: new page content
-        * @param $summary String: edit summary of the edit
-        * @param $isMinor Boolean: was the edit marked as minor?
-        * @param $isWatch Boolean: did the user watch this page or not?
-        * @param $section
-        * @param $flags int Bitfield
-        * @param $revision Object: new Revision object or null
-        * @return Boolean: true
+        * @param WikiPage $page
+        * @param User $user User object for the current user
+        * @param Content $content new page content
+        * @param string $summary edit summary of the edit
+        * @param bool $isMinor was the edit marked as minor?
+        * @param bool $isWatch did the user watch this page or not?
+        * @param string|int $section
+        * @param int $flags Bitfield
+        * @param Revision $revision new Revision object or null
+        * @return bool true
         */
        function OnPageContentSaveComplete( $page, $user, $content, $summary, $isMinor,
                        $isWatch, $section, $flags, $revision ) {
@@ -1082,9 +1082,9 @@ class LanguageConverter {
         * Armour rendered math against conversion.
         * Escape special chars in parsed math text. (in most cases are img elements)
         *
-        * @param $text String: text to armour against conversion
-        * @return String: armoured text where { and } have been converted to
-        *                 &#123; and &#125;
+        * @param string $text Text to armour against conversion
+        * @return string Armoured text where { and } have been converted to
+        *   &#123; and &#125;
         * @deprecated since 1.22 is no longer used
         */
        public function armourMath( $text ) {
@@ -1145,8 +1145,8 @@ class ConverterRule {
        /**
         * Constructor
         *
-        * @param $text String: the text between -{ and }-
-        * @param $converter LanguageConverter object
+        * @param string $text The text between -{ and }-
+        * @param LanguageConverter $converter
         */
        public function __construct( $text, $converter ) {
                $this->mText = $text;
@@ -1156,8 +1156,8 @@ class ConverterRule {
        /**
         * Check if variants array in convert array.
         *
-        * @param $variants Array or string: variant language code
-        * @return String: translated text
+        * @param array|string $variants Variant language code
+        * @return string Translated text
         */
        public function getTextInBidtable( $variants ) {
                $variants = (array)$variants;
@@ -1440,7 +1440,7 @@ class ConverterRule {
 
        /**
         * Parse rules and flags.
-        * @param $variant String: variant language code
+        * @param string $variant Variant language code
         */
        public function parse( $variant = null ) {
                if ( !$variant ) {
index a728c9d..06cb1b5 100644 (file)
@@ -190,9 +190,9 @@ class SrConverter extends LanguageConverter {
         * Guess if a text is written in Cyrillic or Latin.
         * Overrides LanguageConverter::guessVariant()
         *
-        * @param string  $text The text to be checked
-        * @param string  $variant Language code of the variant to be checked for
-        * @return bool  true if $text appears to be written in $variant
+        * @param string $text The text to be checked
+        * @param string $variant Language code of the variant to be checked for
+        * @return bool true if $text appears to be written in $variant
         *
         * @author Nikola Smolenski <smolensk@eunet.rs>
         * @since 1.19
index b5110bd..1a21f1f 100644 (file)
     "listgrouprights-removegroup-self-all": "Remove all groups from own account",
     "trackingcategories": "Tracking categories",
     "trackingcategories-summary": "This page lists tracking categories which are automatically populated by the MediaWiki software. Their names can be changed by altering the relevant system messages in the {{ns:8}} namespace.",
-    "trackingcategories-msg": "Tracking Category",
+    "trackingcategories-msg": "Tracking category",
     "trackingcategories-name": "Message name",
     "trackingcategories-desc": "Category inclusion criteria",
-    "noindex-category-desc": "The page has a <nowiki>__NOINDEX__</nowiki> magic word on it (and is in a namespace where that flag is allowed), and hence is not indexed by robots.",
+    "noindex-category-desc": "The page is not indexed by robots because it has the magic word <nowiki>__NOINDEX__</nowiki> on it and is in a namespace where that flag is allowed.",
     "index-category-desc": "The page has a <nowiki>__INDEX__</nowiki> on it (and is in a namespace where that flag is allowed), and hence is indexed by robots where it normally wouldn't be.",
     "post-expand-template-inclusion-category-desc": "After expanding all the templates, the page size is bigger than $wgMaxArticleSize, so some templates weren't expanded.",
     "post-expand-template-argument-category-desc": "After expanding a template argument (something in triple braces, like {{{Foo}}}), the page is bigger than $wgMaxArticleSize.",
index cd657ac..dc9c763 100644 (file)
@@ -36,6 +36,7 @@ class RunJobs extends Maintenance {
                $this->addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true );
                $this->addOption( 'type', 'Type of job to run', false, true );
                $this->addOption( 'procs', 'Number of processes to use', false, true );
+               $this->addOption( 'nothrottle', 'Ignore job throttling configuration', false, false );
        }
 
        public function memoryLimit() {
@@ -66,6 +67,7 @@ class RunJobs extends Maintenance {
                $type = $this->getOption( 'type', false );
                $maxJobs = $this->getOption( 'maxjobs', false );
                $maxTime = $this->getOption( 'maxtime', false );
+               $noThrottle = $this->hasOption( 'nothrottle' );
                $startTime = time();
 
                $group = JobQueueGroup::singleton();
@@ -83,10 +85,12 @@ class RunJobs extends Maintenance {
                $flags = JobQueueGroup::USE_CACHE;
                $lastTime = time(); // time since last slave check
                do {
+                       $backoffs = array_filter( $backoffs, $backoffExpireFunc );
+                       $blacklist = $noThrottle ? array() : array_keys( $backoffs );
                        if ( $type === false ) {
-                               $backoffs = array_filter( $backoffs, $backoffExpireFunc );
-                               $blacklist = array_keys( $backoffs );
                                $job = $group->pop( JobQueueGroup::TYPE_DEFAULT, $flags, $blacklist );
+                       } elseif ( in_array( $type, $blacklist ) ) {
+                               $job = false; // requested queue in backoff state
                        } else {
                                $job = $group->pop( $type ); // job from a single queue
                        }
index f67f696..4e30bdd 100644 (file)
@@ -437,11 +437,11 @@ class GlobalTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param String $old: Text as it was in the database
-        * @param String $mine: Text submitted while user was editing
-        * @param String $yours: Text submitted by the user
-        * @param Boolean $expectedMergeResult Whether the merge should be a success
-        * @param String $expectedText: Text after merge has been completed
+        * @param string $old Text as it was in the database
+        * @param string $mine Text submitted while user was editing
+        * @param string $yours Text submitted by the user
+        * @param bool $expectedMergeResult Whether the merge should be a success
+        * @param string $expectedText Text after merge has been completed
         *
         * @dataProvider provideMerge()
         * @group medium
index 1d534ee..c0612d1 100644 (file)
@@ -96,10 +96,10 @@ class RandomImageGenerator {
        /**
         * Writes random images with random filenames to disk in the directory you specify, or current working directory
         *
-        * @param $number Integer: number of filenames to write
-        * @param $format String: optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
-        * @param $dir String: directory, optional (will default to current working directory)
-        * @return Array: filenames we just wrote
+        * @param int $number number of filenames to write
+        * @param string $format optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
+        * @param string $dir directory, optional (will default to current working directory)
+        * @return array filenames we just wrote
         */
        function writeImages( $number, $format = 'jpg', $dir = null ) {
                $filenames = $this->getRandomFilenames( $number, $format, $dir );
@@ -139,10 +139,10 @@ class RandomImageGenerator {
         * Return a number of randomly-generated filenames
         * Each filename uses two words randomly drawn from the dictionary, like elephantine_spatula.jpg
         *
-        * @param $number Integer: of filenames to generate
-        * @param $extension String: optional, defaults to 'jpg'
-        * @param $dir String: optional, defaults to current working directory
-        * @return Array: of filenames
+        * @param int $number Number of filenames to generate
+        * @param string $extension Optional, defaults to 'jpg'
+        * @param string $dir Optional, defaults to current working directory
+        * @return array Array of filenames
         */
        private function getRandomFilenames( $number, $extension = 'jpg', $dir = null ) {
                if ( is_null( $dir ) ) {
@@ -208,7 +208,7 @@ class RandomImageGenerator {
         * Given array( array('x' => 10, 'y' => 20), array( 'x' => 30, y=> 5 ) )
         * returns "10,20 30,5"
         * Useful for SVG and imagemagick command line arguments
-        * @param $shape: Array of arrays, each array containing x & y keys mapped to numeric values
+        * @param array $shape Array of arrays, each array containing x & y keys mapped to numeric values
         * @return string
         */
        static function shapePointsToString( $shape ) {
@@ -347,10 +347,10 @@ class RandomImageGenerator {
 
        /**
         * Given a matrix and a pair of images, return new position
-        * @param $matrix: 2x2 rotation matrix
-        * @param $x: x-coordinate number
-        * @param $y: y-coordinate number
-        * @return Array transformed with properties x, y
+        * @param array $matrix 2x2 rotation matrix
+        * @param int $x x-coordinate number
+        * @param int $y y-coordinate number
+        * @return array Transformed with properties x, y
         */
        private static function matrixMultiply2x2( $matrix, $x, $y ) {
                return array(
@@ -412,8 +412,8 @@ class RandomImageGenerator {
        /**
         * Get an array of random pairs of random words, like array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) );
         *
-        * @param $number Integer: number of pairs
-        * @return Array: of two-element arrays
+        * @param int $number Number of pairs
+        * @return array two-element arrays
         */
        private function getRandomWordPairs( $number ) {
                $lines = $this->getRandomLines( $number * 2 );
index 3319490..70374dc 100644 (file)
@@ -108,8 +108,8 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" );
                $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" );
 
-               $this->assertTrue( $queue->push( $this->newJob() ), "Push worked ($desc)" );
-               $this->assertTrue( $queue->batchPush( array( $this->newJob() ) ), "Push worked ($desc)" );
+               $this->assertNull( $queue->push( $this->newJob() ), "Push worked ($desc)" );
+               $this->assertNull( $queue->batchPush( array( $this->newJob() ) ), "Push worked ($desc)" );
 
                $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" );
 
@@ -157,7 +157,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $queue->flushCaches();
                $this->assertEquals( 0, $queue->getAcquiredCount(), "Active job count ($desc)" );
 
-               $this->assertTrue( $queue->batchPush( array( $this->newJob(), $this->newJob() ) ),
+               $this->assertNull( $queue->batchPush( array( $this->newJob(), $this->newJob() ) ),
                        "Push worked ($desc)" );
                $this->assertFalse( $queue->isEmpty(), "Queue is not empty ($desc)" );
 
@@ -183,7 +183,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $queue->getSize(), "Queue is empty ($desc)" );
                $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" );
 
-               $this->assertTrue(
+               $this->assertNull(
                        $queue->batchPush(
                                array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() )
                        ),
@@ -195,7 +195,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertEquals( 1, $queue->getSize(), "Queue size is correct ($desc)" );
                $this->assertEquals( 0, $queue->getAcquiredCount(), "No jobs active ($desc)" );
 
-               $this->assertTrue(
+               $this->assertNull(
                        $queue->batchPush(
                                array( $this->newDedupedJob(), $this->newDedupedJob(), $this->newDedupedJob() )
                        ),
@@ -244,7 +244,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $id = wfRandomString( 32 );
                $root1 = Job::newRootJobParams( "nulljobspam:$id" ); // task ID/timestamp
                for ( $i = 0; $i < 5; ++$i ) {
-                       $this->assertTrue( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" );
+                       $this->assertNull( $queue->push( $this->newJob( 0, $root1 ) ), "Push worked ($desc)" );
                }
                $queue->deduplicateRootJob( $this->newJob( 0, $root1 ) );
                sleep( 1 ); // roo job timestamp will increase
@@ -252,7 +252,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertNotEquals( $root1['rootJobTimestamp'], $root2['rootJobTimestamp'],
                        "Root job signatures have different timestamps." );
                for ( $i = 0; $i < 5; ++$i ) {
-                       $this->assertTrue( $queue->push( $this->newJob( 0, $root2 ) ), "Push worked ($desc)" );
+                       $this->assertNull( $queue->push( $this->newJob( 0, $root2 ) ), "Push worked ($desc)" );
                }
                $queue->deduplicateRootJob( $this->newJob( 0, $root2 ) );
 
@@ -296,7 +296,7 @@ class JobQueueTest extends MediaWikiTestCase {
                $this->assertEquals( 0, $queue->getAcquiredCount(), "Queue is empty ($desc)" );
 
                for ( $i = 0; $i < 10; ++$i ) {
-                       $this->assertTrue( $queue->push( $this->newJob( $i ) ), "Push worked ($desc)" );
+                       $this->assertNull( $queue->push( $this->newJob( $i ) ), "Push worked ($desc)" );
                }
 
                for ( $i = 0; $i < 10; ++$i ) {