* 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 ) {
* 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
*/
* @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:
* 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
*/
}
/**
- * @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;
}
/**
- * @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
* 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 ) {
* 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 );
* 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 );
/**
* Constructor
*
- * @param $file File object we're deleting
+ * @param File $file File object we're deleting
*/
public function __construct( $file ) {
$this->title = $file->getTitle();
/**
* 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
*/
* 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
*/
/**
* 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
*/
* 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
*/
/**
* 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
* 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 = '';
/**
* 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
/**
* Constructor
*
- * @param string $html: Text to process
+ * @param string $html Text to process
*/
public function __construct( $html ) {
$this->html = $html;
/**
* 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 ) {
* .<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 );
* 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 );
/**
* 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__ );
}
/**
- * @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 ) {
* 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
*/
/**
* 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 = '';
*
* @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",
* 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
/**
* 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;
/**
* 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;
/**
* 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 ) );
* 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.
*/
/**
* 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 ) {
/**
* 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 ) {
/**
* 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
/**
* 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 );
}
/**
- * @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 );
}
/**
- * @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 );
/**
* 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 ) {
/**
* 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 ) {
* 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 ) {
* 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!
* 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;
* 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
*/
* 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() == "" ) {
/**
* 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 );
* Currently unused.
*
* @param array $tree Return value of ParserOutput::getSections()
- * @return String: HTML fragment
+ * @return string HTML fragment
*/
public static function generateTOC( $tree ) {
$toc = '';
/**
* 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"
/**
* 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;
* @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;
/**
* 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__ );
* 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 ) {
* 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 ) {
/**
* 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 ) {
/**
* 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
* 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
*/
* 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 = ''
* 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
*/
* 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
*/
* 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
*/
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;
* 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 );
* 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 );
* 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 );
* 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;
* 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;
* 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] ) ) {
*
* 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;
* 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 ) {
/**
* Get the body HTML
*
- * @return String: HTML
+ * @return string HTML
*/
public function getHTML() {
return $this->mBodytext;
* 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 );
* 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 );
/**
* 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;
* 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
/**
* 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 );
/**
* 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 );
/**
* 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();
/**
* 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;
/**
* 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;
/**
* 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 );
/**
* 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;
/**
* 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.
*/
* 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 ) {
* 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 ) );
/**
* 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 ) {
*
* @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 ) {
* 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;
}
/**
- * @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;
* 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;
/**
* 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(
/**
* 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' ) {
* 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'] ) ) {
/**
* 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 ) {
* 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
*/
/** @var bool */
public $ok = true;
- /** @var mixed */
+ /** @var mixed */
public $value;
/** Counters for batch operations */
public $failCount = 0;
/** Array to indicate which items of the batch operations were successful */
- /** @var array */
+ /** @var array */
public $success = array();
/** @var array */
/**
* 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;
/**
* 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 );
* 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 ) {
*/
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;
/** @var string */
private $typeCGI = '';
- /** @var LogEventsList */
+ /** @var LogEventsList */
public $mLogEventsList;
/**
* 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
*/
* 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 ) {
* 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;
/**
* Set the output type
*
- * @param $ot Integer: new value
+ * @param int $ot new value
*/
function setOutputType( $ot ) {
$this->mOutputType = $ot;
* '<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;
/**
* Process [[ ]] wikilinks
*
- * @param $s string
+ * @param string $s
*
- * @return String: processed text
+ * @return string Processed text
*
* @private
*/
* 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 );
* 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 . ')/',
/**
* 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 ) {
/**
* 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__ );
* 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.
* 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 ) {
* 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
*/
/**
* 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() ) {
/**
* 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++;
* $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 ) {
* 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 );
* 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 ) {
/**
* 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 );
/**
* 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;
* 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 );
* @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 );
* 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
* 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
* 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 );
/**
* Get the ID of the revision we are parsing
*
- * @return Mixed: integer or null
+ * @return int|null
*/
function getRevisionId() {
return $this->mRevisionId;
/**
* 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 ) ) {
*
* @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 ) {
* 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
*/
/**
* Same as getUserLangObj() but returns a string instead.
*
- * @return String Language code
+ * @return String Language code
* @since 1.17
*/
function getUserLang() {
* 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 ) {
* 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 ) {
/**
* 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;
* 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() );
/**
* 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();
}
/**
- * @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 ) {
/**
* Generate wikitext showing extensions name, URL, author and description.
*
- * @return String: Wikitext
+ * @return string Wikitext
*/
function getExtensionCredits() {
global $wgExtensionCredits;
/**
* Generate wikitext showing hooks in $wgHooks.
*
- * @return String: wikitext
+ * @return string Wikitext
*/
private function getWgHooks() {
global $wgSpecialVersionShowHooks, $wgHooks;
/**
* 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() ) );
* 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;
/**
* 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 );
/**
* 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 ) {
*
* @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 );
/**
* 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 ) ) {
* 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 ) {
/**
* 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 ) {
/**
* 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" );
/**
* 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 ) {
* 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
*/
* 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();
* 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 );
* 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 );
/**
* 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();
* 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" );
* 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 ) {
* 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 ) ) {
* 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();
/**
* 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;
/**
* Remove the associated temporary file
- * @return Status: success
+ * @return status Success
*/
public function remove() {
if ( !$this->repo->fileExists( $this->path ) ) {
public $mManualLevel;
/**
- * @var String: memcached key name
+ * @var string memcached key name
*/
public $mCacheKey;
/**
* 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(),
* 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;
* 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] ) ) {
/**
* 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;
/**
* Get preferred language variant.
- * @return String: the preferred language code
+ * @return string The preferred language code
*/
public function getPreferredVariant() {
global $wgDefaultLanguageVariant, $wgUser;
/**
* 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;
/**
* 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 ) ) {
/**
* 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;
/**
* 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;
/**
* 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;
* 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__ );
/**
* 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__ );
* 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();
/**
* 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 ) {
* -{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();
/**
* 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;
* 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;
/**
* 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)
* 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
/**
* 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;
* 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
*/
* 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
* 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 ) {
* 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
- * { and }
+ * @param string $text Text to armour against conversion
+ * @return string Armoured text where { and } have been converted to
+ * { and }
* @deprecated since 1.22 is no longer used
*/
public function armourMath( $text ) {
/**
* 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;
/**
* 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;
/**
* Parse rules and flags.
- * @param $variant String: variant language code
+ * @param string $variant Variant language code
*/
public function parse( $variant = null ) {
if ( !$variant ) {
* 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
}
/**
- * @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
/**
* 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 );
* 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 ) ) {
* 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 ) {
/**
* 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(
/**
* 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 );