/**
* autoload - take a class name and attempt to load it
*
- * @param string $className name of class we're looking for.
+ * @param string $className Name of class we're looking for.
*/
static function autoload( $className ) {
global $wgAutoloadClasses, $wgAutoloadLocalClasses,
* The order is furthest from the server to nearest e.g., (Browser, proxy1, proxy2,
* local-squid, ...)
* @param array $block Array of blocks
- * @return Block|null the "best" block from the list
+ * @return Block|null The "best" block from the list
*/
public static function chooseBlock( array $blocks, array $ipChain ) {
if ( !count( $blocks ) ) {
/** @var array */
protected $name2id = array();
- /** @var "AND" or "OR" */
+ /** @var string "AND" or "OR" */
protected $mode;
/** @var DatabaseBase Read-DB slave */
/**
* Iterates through the parent tree starting with the seed values,
* then checks the articles if they match the conditions
- * @return array of page_ids (those given to seed() that match the conditions)
+ * @return array Array of page_ids (those given to seed() that match the conditions)
*/
function run() {
$this->dbr = wfGetDB( DB_SLAVE );
/**
* Get a short description for a tag
*
- * @param string $tag tag
+ * @param string $tag Tag
*
* @return string Short description of the tag from "mediawiki:tag-$tag" if this message exists,
* html-escaped version of $tag otherwise
* Add tags to a change given its rc_id, rev_id and/or log_id
*
* @param string|array $tags Tags to add to the change
- * @param int|null $rc_id rc_id of the change to add the tags to
- * @param int|null $rev_id rev_id of the change to add the tags to
- * @param int|null $log_id Log_id of the change to add the tags to
- * @param string $params params to put in the ct_params field of table 'change_tag'
+ * @param int|null $rc_id The rc_id of the change to add the tags to
+ * @param int|null $rev_id The rev_id of the change to add the tags to
+ * @param int|null $log_id The log_id of the change to add the tags to
+ * @param string $params Params to put in the ct_params field of table 'change_tag'
*
* @throws MWException
- * @return bool false if no changes are made, otherwise true
+ * @return bool False if no changes are made, otherwise true
*
- * @exception MWException when $rc_id, $rev_id and $log_id are all null
+ * @exception MWException When $rc_id, $rev_id and $log_id are all null
*/
public static function addTags( $tags, $rc_id = null, $rev_id = null,
$log_id = null, $params = null
/**
* Build a text box to select a change tag
*
- * @param string $selected tag to select by default
+ * @param string $selected Tag to select by default
* @param bool $fullForm
* - if false, then it returns an array of (label, form).
* - if true, it returns an entire form around the selector.
/** @var Collator */
private $mainCollator;
- /** @var */
+ /** @var string */
private $locale;
/** @var Language */
*
* @param string $modelId The ID of the content model to test. Use CONTENT_MODEL_XXX constants.
* @return bool
- * @throws MWException if $modelId has no known handler
+ * @throws MWException If $modelId has no known handler
*/
public function isSupportedContentModel( $modelId ) {
return $this->allowNonTextContent ||
* Subclasses may override this to replace the default behavior, which is
* to check ContentHandler::supportsSections.
*
- * @return bool true if this edit page supports sections, false otherwise.
+ * @return bool True if this edit page supports sections, false otherwise.
*/
protected function isSectionEditSupported() {
$contentHandler = ContentHandler::getForTitle( $this->mTitle );
* Fetch initial editing page content.
*
* @param string|bool $def_text
- * @return string|bool string on success, $def_text for invalid sections
+ * @return string|bool String on success, $def_text for invalid sections
* @private
* @deprecated since 1.21, get WikiPage::getContent() instead.
*/
* Get the contents to be preloaded into the box, either set by
* an earlier setPreloadText() or by loading the given page.
*
- * @param string $preload representing the title to preload from.
+ * @param string $preload Representing the title to preload from.
*
* @return string
*
* If the variable were set on the server, it would be cached, which is unwanted
* since the post-edit state should only apply to the load right after the save.
*
- * @param $statusValue int The status value (to check for new article status)
+ * @param int $statusValue The status value (to check for new article status)
*/
protected function setPostEditCookie( $statusValue ) {
$revisionId = $this->mArticle->getLatest();
/**
* Attempt submission
* @throws UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
- * @return bool false if output is done, true if the rest of the form should be displayed
+ * @return bool False if output is done, true if the rest of the form should be displayed
*/
public function attemptSave() {
global $wgUser;
* @param array|bool $resultDetails
*
* @throws ErrorPageError
- * @return bool false, if output is done, true if rest of the form should be displayed
+ * @return bool False, if output is done, true if rest of the form should be displayed
*/
private function handleStatus( Status $status, $resultDetails ) {
global $wgUser, $wgOut;
* @param Content|null|bool|string $content
* @return string The editable text form of the content.
*
- * @throws MWException if $content is not an instance of TextContent and
+ * @throws MWException If $content is not an instance of TextContent and
* $this->allowNonTextContent is not true.
*/
protected function toEditText( $content ) {
* @return Content The content object created from $text. If $text was false
* or null, false resp. null will be returned instead.
*
- * @throws MWException if unserializing the text results in a Content
+ * @throws MWException If unserializing the text results in a Content
* object that is not an instance of TextContent and
* $this->allowNonTextContent is not true.
*/
* Extract the section title from current section text, if any.
*
* @param string $text
- * @return string|bool string or false
+ * @return string|bool String or false
*/
public static function extractSectionTitle( $text ) {
preg_match( "/^(=+)(.+)\\1\\s*(\n|$)/i", $text, $matches );
}
/**
- * @param bool $isSubjectPreview true if this is the section subject/title
+ * @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
}
/**
- * @param bool $isSubjectPreview true if this is the section subject/title
+ * @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
* Fallback implementation of mb_strrpos, hardcoded to UTF-8.
* @param string $haystack
* @param string $needle
- * @param string $offset optional start position
- * @param string $encoding optional encoding; ignored
+ * @param string $offset Optional start position
+ * @param string $encoding Optional encoding; ignored
* @return int
*/
public static function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
/**
* Quickie hack... strip out wikilinks to more legible form from the comment.
*
- * @param string $text wikitext
+ * @param string $text Wikitext
* @return string
*/
public static function stripComment( $text ) {
/**
* Check whether feeds can be used and that $type is a valid feed type
*
- * @param string $type feed type, as requested by the user
+ * @param string $type Feed type, as requested by the user
* @return bool
*/
public static function checkFeedOutput( $type ) {
/**
* Get the URL of the remote origin.
- * @return string|bool string if a URL is available or false otherwise.
+ * @return string|bool String if a URL is available or false otherwise.
*/
protected function getRemoteUrl() {
if ( !isset( $this->cache['remoteURL'] ) ) {
* @deprecated since 1.22; use array_replace()
*
* @param array $array1 Initial array to merge.
- * @param array [$array2,...] Variable list of arrays to merge.
+ * @param array $array2,... Variable list of arrays to merge.
* @return array
*/
function wfArrayMerge( $array1 /*...*/ ) {
* array( 'y' )
* )
*
- * @param array [$array1,...]
+ * @param array $array1,...
* @return array
*/
function wfMergeErrorArrays( /*...*/ ) {
* Send a warning either to the debug log or in a PHP error depending on
* $wgDevelopmentWarnings. To log warnings in production, use wfLogWarning() instead.
*
- * @param string $msg message to send
+ * @param string $msg Message to send
* @param int $callerOffset Number of items to go back in the backtrace to
* find the correct caller (1 = function calling wfWarn, ...)
* @param int $level PHP error level; defaults to E_USER_NOTICE;
* This function replaces all old wfMsg* functions.
*
* @param string $key Message key
- * @param mixed [$params,...] Normal message parameters
+ * @param mixed $params,... Normal message parameters
* @return Message
*
* @since 1.17
* for the first message which is non-empty. If all messages are empty then an
* instance of the first message key is returned.
*
- * @param string|string[] [$keys,...] Message keys
+ * @param string|string[] $keys,... Message keys
* @return Message
*
* @since 1.18
*
* @deprecated since 1.18
*
- * @param string $key lookup key for the message, usually
+ * @param string $key Lookup key for the message, usually
* defined in languages/Language.php
*
* Parameters to the message, which can be used to insert variable text into
* @deprecated since 1.18
*
* @param string $key
- * @param string [$args,...] Parameters
+ * @param string $args,... Parameters
* @return string
*/
function wfMsgHtml( $key ) {
* @deprecated since 1.18
*
* @param string $key
- * @param string [$args,...] Parameters
+ * @param string $args,... Parameters
* @return string
*/
function wfMsgWikiHtml( $key ) {
* factors
*
* @param string $accept
- * @param string $def default
+ * @param string $def Default
* @return float[] Associative array of string => float pairs
*/
function wfAcceptToPrefs( $accept, $def = '*/*' ) {
* Also fixes the locale problems on Linux in PHP 5.2.6+ (bug backported to
* earlier distro releases of PHP)
*
- * @param string [$args,...]
+ * @param string $args,...
* @return string
*/
function wfEscapeShellArg( /*...*/ ) {
* Execute a shell command, with time and memory limits mirrored from the PHP
* configuration if supported.
*
- * @param string|string[] $cmd if string, a properly shell-escaped command line,
+ * @param string|string[] $cmd If string, a properly shell-escaped command line,
* or an array of unescaped arguments, in which case each value will be escaped
* Example: [ 'convert', '-font', 'font name' ] would produce "'convert' '-font' 'font name'"
* @param null|mixed &$retval Optional, will receive the program's exit code.
* @param string $cmd Command line, properly escaped for shell.
* @param null|mixed &$retval Optional, will receive the program's exit code.
* (non-zero is usually failure)
- * @param array $environ optional environment variables which should be
+ * @param array $environ Optional environment variables which should be
* added to the executed command environment.
* @param array $limits Optional array with limits(filesize, memory, time, walltime)
* this overwrites the global wgMaxShell* limits.
/**
* Check if there is sufficient entropy in php's built-in session generation
*
- * @return bool true = there is sufficient entropy
+ * @return bool True = there is sufficient entropy
*/
function wfCheckEntropy() {
return (
/**
* Get a cache key
*
- * @param string [$args,...]
+ * @param string $args,...
* @return string
*/
function wfMemcKey( /*...*/ ) {
*
* @param string $db
* @param string $prefix
- * @param string [$args,...]
+ * @param string $args,...
* @return string
*/
function wfForeignMemcKey( $db, $prefix /*...*/ ) {
/**
* Get a load balancer object.
*
- * @param string|bool $wiki wiki ID, or false for the current wiki
+ * @param string|bool $wiki Wiki ID, or false for the current wiki
* @return LoadBalancer
*/
function wfGetLB( $wiki = false ) {
* Find a file.
* Shortcut for RepoGroup::singleton()->findFile()
*
- * @param string $title or Title object
+ * @param string $title String or Title object
* @param array $options Associative array of options:
* time: requested time for an archived image, or false for the
* current version. An image object will be returned which was
/**
* Get the script URL.
*
- * @return string script URL
+ * @return string Script URL
*/
function wfGetScriptUrl() {
if ( isset( $_SERVER['SCRIPT_NAME'] ) ) {
* Also be careful when using this function to read unsigned 32 bit integer
* because php might make it negative.
*
- * @throws MWException if $data not long enough, or if unpack fails
+ * @throws MWException If $data not long enough, or if unpack fails
* @return array Associative array of the extracted data
*/
function wfUnpack( $format, $data, $length = false ) {
/** @var string */
public $mHash;
- /** @var */
+ /** @var string */
public $mRef;
/**
* the bytes backwards and initialised with 0 instead of 1. See bug 34428.
*
* @param string $s
- * @return string|bool false if the hash extension is not available
+ * @return string|bool False if the hash extension is not available
*/
function xdiffAdler32( $s ) {
if ( !function_exists( 'hash' ) ) {
* Clears hooks registered via Hooks::register(). Does not touch $wgHooks.
* This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
*
- * @param string $name the name of the hook to clear.
+ * @param string $name The name of the hook to clear.
*
* @since 1.21
- * @throws MWException if not in testing mode.
+ * @throws MWException If not in testing mode.
*/
public static function clear( $name ) {
if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
* Finally, process the return value and return/throw accordingly.
*
* @param string $event Event name
- * @param array $args Array of parameters passed to hook functions
+ * @param array $args Array of parameters passed to hook functions
* @param string|null $deprecatedVersion Optionally, mark hook as deprecated with version number
* @return bool True if no handler aborted the hook
*
* shaved off the HTML output as well.
*
* @param string $element The element's name, e.g., 'a'
- * @param array $attribs Associative array of attributes, e.g., array(
+ * @param array $attribs Associative array of attributes, e.g., array(
* 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
* further documentation.
* @param string $contents The raw HTML contents of the element: *not*
* you can omit the key, e.g., array( 'checked' ) instead of
* array( 'checked' => 'checked' ) or such.
*
- * @throws MWException if an attribute that doesn't allow lists is set to an array
+ * @throws MWException If an attribute that doesn't allow lists is set to an array
* @return string HTML fragment that goes between element name and '>'
* (starting with a space if at least one attribute is output)
*/
/**
* Removes content we've chosen to remove. The text of the removed elements can be
* extracted with the getText method.
- * @return array of removed DOMElements
+ * @return array Array of removed DOMElements
*/
public function filterContent() {
wfProfileIn( __METHOD__ );
/**
* Removes a list of elelments from DOMDocument
* @param array|DOMNodeList $elements
- * @return array of removed elements
+ * @return array Array of removed elements
*/
private function removeElements( $elements ) {
$list = $elements;
* Perform an HTTP request
*
* @param string $method HTTP method. Usually GET/POST
- * @param string $url full URL to act on. If protocol-relative, will be expanded to an http:// URL
- * @param array $options options to pass to MWHttpRequest object.
+ * @param string $url Full URL to act on. If protocol-relative, will be expanded to an http:// URL
+ * @param array $options Options to pass to MWHttpRequest object.
* Possible keys for the array:
* - timeout Timeout length in seconds
* - connectTimeout Timeout for connection, in seconds (curl only)
/**
* Retrieves the contents of the named attribute of the current element.
- * @param string $attr the name of the attribute
- * @return string the value of the attribute or an empty string if it is not set in the current element.
+ * @param string $attr The name of the attribute
+ * @return string The value of the attribute or an empty string if it is not set in the current element.
*/
public function nodeAttribute( $attr ) {
return $this->reader->getAttribute( $attr );
public $text;
/**
- * @param string $str license name??
+ * @param string $str License name??
*/
function __construct( $str ) {
list( $text, $template ) = explode( '|', strrev( $str ), 2 );
* Returns the Url used to link to a Title
*
* @param Title $target
- * @param array $query query parameters
+ * @param array $query Query parameters
* @param array $options
* @return string
*/
*
* @since 1.22
* @param bool|string $ts Timestamp to set, or false for current time
- * @return MWTimestamp the local instance
+ * @return MWTimestamp The local instance
*/
public static function getLocalInstance( $ts = false ) {
global $wgLocaltimezone;
*
* @since 1.22
* @param bool|string $ts Timestamp to set, or false for current time
- * @return MWTimestamp the instance
+ * @return MWTimestamp The instance
*/
public static function getInstance( $ts = false ) {
return new self( $ts );
* @since 1.17
*
* @param string|string[] $key Message key or array of keys.
- * @param mixed [$param,...] Parameters as strings.
+ * @param mixed $param,... Parameters as strings.
*
* @return Message
*/
*
* @since 1.18
*
- * @param string|string[] [$keys,...] Message keys, or first argument as an array of all the
+ * @param string|string[] $keys,... Message keys, or first argument as an array of all the
* message keys.
*
* @return Message
*
* @since 1.17
*
- * @param mixed [$params,...] Parameters as strings, or a single argument that is
+ * @param mixed $params,... Parameters as strings, or a single argument that is
* an array of strings.
*
* @return Message $this
*
* @since 1.17
*
- * @param mixed [$params,...] Raw parameters as strings, or a single argument that is
+ * @param mixed $params,... Raw parameters as strings, or a single argument that is
* an array of raw parameters.
*
* @return Message $this
*
* @since 1.18
*
- * @param mixed [$param,...] Numeric parameters, or a single argument that is
+ * @param mixed $param,... Numeric parameters, or a single argument that is
* an array of numeric parameters.
*
* @return Message $this
*
* @since 1.22
*
- * @param int|int[] [$param,...] Duration parameters, or a single argument that is
+ * @param int|int[] $param,... Duration parameters, or a single argument that is
* an array of duration parameters.
*
* @return Message $this
*
* @since 1.22
*
- * @param string|string[] [$param,...] Expiry parameters, or a single argument that is
+ * @param string|string[] $param,... Expiry parameters, or a single argument that is
* an array of expiry parameters.
*
* @return Message $this
*
* @since 1.22
*
- * @param int|int[] [$param,...] Time period parameters, or a single argument that is
+ * @param int|int[] $param,... Time period parameters, or a single argument that is
* an array of time period parameters.
*
* @return Message $this
*
* @since 1.22
*
- * @param int|int[] [$param,...] Size parameters, or a single argument that is
+ * @param int|int[] $param,... Size parameters, or a single argument that is
* an array of size parameters.
*
* @return Message $this
*
* @since 1.22
*
- * @param int|int[] [$param,...] Bit rate parameters, or a single argument that is
+ * @param int|int[] $param,... Bit rate parameters, or a single argument that is
* an array of bit rate parameters.
*
* @return Message $this
protected $mStatusCode;
/**
- * @ var string mLastModified and mEtag are used for sending cache control.
+ * @var string Variable mLastModified and mEtag are used for sending cache control.
* The whole caching system should probably be moved into its own class.
*/
protected $mLastModified = '';
* Add a new "<meta>" tag
* To add an http-equiv meta tag, precede the name with "http:"
*
- * @param string $name tag name
- * @param string $val tag value
+ * @param string $name Tag name
+ * @param string $val Tag value
*/
function addMeta( $name, $val ) {
array_push( $this->mMetatags, array( $name, $val ) );
*
* Note: use setCanonicalUrl() for rel=canonical.
*
- * @param array $linkarr associative array of attributes.
+ * @param array $linkarr Associative array of attributes.
*/
function addLink( $linkarr ) {
array_push( $this->mLinktags, $linkarr );
/**
* Add a new \<link\> with "rel" attribute set to "meta"
*
- * @param array $linkarr associative array mapping attribute names to their
+ * @param array $linkarr Associative array mapping attribute names to their
* values, both keys and values will be escaped, and the
* "rel" attribute will be automatically added
*/
/**
* Add raw HTML to the list of scripts (including \<script\> tag, etc.)
*
- * @param string $script raw HTML
+ * @param string $script Raw HTML
*/
function addScript( $script ) {
$this->mScripts .= $script . "\n";
/**
* Register and add a stylesheet from an extension directory.
*
- * @param string $url path to sheet. Provide either a full url (beginning
+ * @param string $url Path to sheet. Provide either a full url (beginning
* with 'http', etc) or a relative path from the document root
* (beginning with '/'). Otherwise it behaves identically to
* addStyle() and draws from the /skins folder.
/**
* Add a JavaScript file out of skins/common, or a given relative path.
*
- * @param string $file filename in skins/common or complete on-server path
+ * @param string $file Filename in skins/common or complete on-server path
* (/foo/bar.js)
- * @param string $version style version of the file. Defaults to $wgStyleVersion
+ * @param string $version Style version of the file. Defaults to $wgStyleVersion
*/
public function addScriptFile( $file, $version = null ) {
global $wgStylePath, $wgStyleVersion;
* Filter an array of modules to remove insufficiently trustworthy members, and modules
* which are no longer registered (eg a page is cached before an extension is disabled)
* @param array $modules
- * @param string|null $position if not null, only return modules with this position
+ * @param string|null $position If not null, only return modules with this position
* @param string $type
* @return array
*/
/**
* Add or replace an header item to the output
*
- * @param string $name item name
- * @param string $value raw HTML
+ * @param string $name Item name
+ * @param string $value Raw HTML
*/
public function addHeadItem( $name, $value ) {
$this->mHeadItems[$name] = $value;
/**
* Set the value of the ETag HTTP header, only used if $wgUseETag is true
*
- * @param string $tag value of "ETag" header
+ * @param string $tag Value of "ETag" header
*/
function setETag( $tag ) {
$this->mETag = $tag;
/**
* Override the last modified timestamp
*
- * @param string $timestamp new timestamp, in a format readable by
+ * @param string $timestamp New timestamp, in a format readable by
* wfTimestamp()
*/
public function setLastModified( $timestamp ) {
/**
* Set the robot policy for the page: <http://www.robotstxt.org/meta.html>
*
- * @param string $policy the literal string to output as the contents of
+ * @param string $policy The literal string to output as the contents of
* the meta tag. Will be parsed according to the spec and output in
* standardized form.
* @return null
* Set the follow policy for the page, but leave the index policy un-
* touched.
*
- * @param string $policy either 'follow' or 'nofollow'.
+ * @param string $policy Either 'follow' or 'nofollow'.
* @return null
*/
public function setFollowPolicy( $policy ) {
* Set the new value of the "action text", this will be added to the
* "HTML title", separated from it with " - ".
*
- * @param string $text new value of the "action text"
+ * @param string $text New value of the "action text"
*/
public function setPageTitleActionText( $text ) {
$this->mPageTitleActionText = $text;
/**
* Replace the subtitle with $str
*
- * @param string|Message $str new value of the subtitle. String should be safe HTML.
+ * @param string|Message $str New value of the subtitle. String should be safe HTML.
*/
public function setSubtitle( $str ) {
$this->clearSubtitle();
* Add $str to the subtitle
*
* @deprecated since 1.19; use addSubtitle() instead
- * @param string|Message $str to add to the subtitle
+ * @param string|Message $str String or Message to add to the subtitle
*/
public function appendSubtitle( $str ) {
$this->addSubtitle( $str );
/**
* Add $str to the subtitle
*
- * @param string|Message $str to add to the subtitle. String should be safe HTML.
+ * @param string|Message $str String or Message to add to the subtitle. String should be safe HTML.
*/
public function addSubtitle( $str ) {
if ( $str instanceof Message ) {
* for the new version
* @see addFeedLink()
*
- * @param bool $show 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 ) {
* for the new version
* @see addFeedLink()
*
- * @param string $val query to append to feed links or false to output
+ * @param string $val Query to append to feed links or false to output
* default links
*/
public function setFeedAppendQuery( $val ) {
/**
* Add a feed link to the page header
*
- * @param string $format feed type, should be a key of $wgFeedClasses
+ * @param string $format Feed type, should be a key of $wgFeedClasses
* @param string $href URL
*/
public function addFeedLink( $format, $href ) {
/**
* Return URLs for each supported syndication format for this page.
- * @return array associating format keys with URLs
+ * @return array Associating format keys with URLs
*/
public function getSyndicationLinks() {
return $this->mFeedLinks;
/**
* Add an array of categories, with names in the keys
*
- * @param array $categories mapping category name => sort key
+ * @param array $categories Mapping category name => sort key
*/
public function addCategoryLinks( $categories ) {
global $wgContLang;
/**
* Reset the category links (but not the category list) and add $categories
*
- * @param array $categories mapping category name => sort key
+ * @param array $categories Mapping category name => sort key
*/
public function setCategoryLinks( $categories ) {
$this->mCategoryLinks = array();
/**
* Add an HTTP header that will influence on the cache
*
- * @param string $header header name
+ * @param string $header Header name
* @param array|null $option
* @todo FIXME: Document the $option parameter; it appears to be for
* X-Vary-Options but what format is acceptable?
/**
* Actually output something with print.
*
- * @param string $ins the string to output
+ * @param string $ins The string to output
* @deprecated since 1.22 Use echo yourself.
*/
public function out( $ins ) {
* indexing, clear the current text and redirect, set the page's title
* and optionally an custom HTML title (content of the "<title>" tag).
*
- * @param string|Message $pageTitle will be passed directly to setPageTitle()
- * @param string|Message $htmlTitle will be passed directly to setHTMLTitle();
+ * @param string|Message $pageTitle Will be passed directly to setPageTitle()
+ * @param string|Message $htmlTitle Will be passed directly to setHTMLTitle();
* optional, if not passed the "<title>" attribute will be
* based on $pageTitle
*/
/**
* Output a standard permission error page
*
- * @param array $errors error message keys
- * @param string $action action that was denied or null if unknown
+ * @param array $errors Error message keys
+ * @param string $action Action that was denied or null if unknown
*/
public function showPermissionsErrorPage( $errors, $action = null ) {
// For some action (read, edit, create and upload), display a "login to do this action"
/**
* Display an error page noting that a given permission bit is required.
* @deprecated since 1.18, just throw the exception directly
- * @param string $permission key required
+ * @param string $permission Key required
* @throws PermissionsError
*/
public function permissionRequired( $permission ) {
}
/**
- * @return array in format "link name or number => 'link html'".
+ * @return array Array in format "link name or number => 'link html'".
*/
public function getHeadLinksArray() {
global $wgUniversalEditButton, $wgFavicon, $wgAppleTouchIcon, $wgEnableAPI,
* Meant primarily for internal use...
*
* @param string $style URL to the file
- * @param string $media to specify a media type, 'screen', 'printable', 'handheld' or any.
- * @param string $condition for IE conditional comments, specifying an IE version
- * @param string $dir set to 'rtl' or 'ltr' for direction-specific sheets
+ * @param string $media To specify a media type, 'screen', 'printable', 'handheld' or any.
+ * @param string $condition For IE conditional comments, specifying an IE version
+ * @param string $dir Set to 'rtl' or 'ltr' for direction-specific sheets
*/
public function addStyle( $style, $media = '', $condition = '', $dir = '' ) {
$options = array();
* @throws MWException
* @param User $user
* @param IContextSource $context
- * @param array defaultPreferences to load values for
+ * @param array $defaultPreferences Array to load values for
* @return array|null
*/
static function loadPreferenceValues( $user, $context, &$defaultPreferences ) {
}
/**
- * @param int $field one of DELETED_* bitfield constants
+ * @param int $field One of DELETED_* bitfield constants
*
* @return bool
*/
* - Invalid id attributes are re-encoded
*
* @param array $attribs
- * @param array $whitelist list of allowed attribute names
+ * @param array $whitelist List of allowed attribute names
* @return array
*
* @todo Check for legal values where the DTD limits things.
* @see http://www.whatwg.org/html/elements.html#the-id-attribute
* HTML5 definition of id attribute
*
- * @param string $id id to escape
+ * @param string $id Id to escape
* @param string|array $options String or array of strings (default is array()):
* 'noninitial': This is a non-initial fragment of an id, not a full id,
* so don't pay attention if the first character isn't valid at the
* attribs regex matches.
*
* @param array $set
- * @throws MWException when tag conditions are not met.
+ * @throws MWException When tag conditions are not met.
* @return string
*/
private static function getTagAttributeCallback( $set ) {
/**
* Find the number of users in a given user group.
- * @param string $group name of group
+ * @param string $group Name of group
* @return int
*/
static function numberingroup( $group ) {
* @param DatabaseBase|bool $database
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
- * @param array $options of options, may contain the following values
+ * @param array $options Array of options, may contain the following values
* - views Boolean: when true, do not update the number of page views (default: true)
* - activeUsers Boolean: whether to update the number of active users (default: false)
*/
/**
* Returns an HTML link for use in the footer
- * @param string $desc i18n message key for the link text
- * @param string $page i18n message key for the page to link to
+ * @param string $desc The i18n message key for the link text
+ * @param string $page The i18n message key for the page to link to
* @return string HTML anchor
*/
public function footerLink( $desc, $page ) {
/**
* Builds an array with tab definition
*
- * @param Title $title page Where the tab links to
+ * @param Title $title Page Where the tab links to
* @param string|array $message Message key or an array of message keys (will fall back)
* @param bool $selected Display the tab as selected
* @param string $query Query string attached to tab URL
/**
* an array of edit links by default used for the tabs
- * @param $content_navigation
+ * @param array $content_navigation
* @return array
*/
private function buildContentActionUrls( $content_navigation ) {
* Makes a link, usually used by makeListItem to generate a link for an item
* in a list used in navigation lists, portlets, portals, sidebars, etc...
*
- * @param string $key usually a key from the list you are generating this
+ * @param string $key Usually a key from the list you are generating this
* link from.
- * @param array $item contains some of a specific set of keys.
+ * @param array $item Contains some of a specific set of keys.
*
* The text of the link will be generated either from the contents of the
* "text" key in the $item array, if a "msg" key is present a message by
*
* If you don't want an accesskey, set $item['tooltiponly'] = true;
*
- * @param array $options can be used to affect the output of a link.
+ * @param array $options Can be used to affect the output of a link.
* Possible options are:
* - 'text-wrapper' key to specify a list of elements to wrap the text of
* a link in. This should be an array of arrays containing a 'tag' and
/**
* @param string $line
- * @return
*/
protected function processStatusLine( $line ) {
if ( !preg_match( '!^HTTP/(\d+)\.(\d+) (\d{3}) (.*)$!', $line, $m ) ) {
}
class SquidPurgeClientPool {
- /** @var array of SquidPurgeClient */
+ /** @var array Array of SquidPurgeClient */
protected $clients = array();
/** @var int */
/**
* Factory function for fatal errors
*
- * @param string|Message $message message name or object
+ * @param string|Message $message Message name or object
* @return Status
*/
static function newFatal( $message /*, parameters...*/ ) {
* @param string $name Name of the method called in this object.
* @param int $level Level to go in the stack trace to get the function
* who called this function.
- * @return The unstubbed version of itself
+ * @return object The unstubbed version of itself
* @throws MWException
*/
function _unstub( $name = '_unstub', $level = 2 ) {
/** @var array Array of groups allowed to edit this article */
public $mRestrictions = array();
- /** @var bool */
+ /** @var bool */
protected $mOldRestrictions = false;
/** @var bool Cascade restrictions on this page to included templates and images? */
/**
* Returns true if the title is inside one of the specified namespaces.
*
- * @param ...$namespaces The namespaces to check for
+ * @param int $namespaces,... The namespaces to check for
* @return bool
* @since 1.19
*/
* @see self::getFullURL to always get an absolute URL.
* @see self::newFromText to produce a Title object.
*
- * @param string|array $query an optional query string,
+ * @param string|array $query An optional query string,
* not used for interwiki links. Can be specified as an associative array as well,
* e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
* Some query patterns will trigger various shorturl path replacements.
*
* @todo FIXME: This *does not* check throttles (User::pingLimiter()).
*
- * @param string $action action that permission needs to be checked for
+ * @param string $action Action that permission needs to be checked for
* @param User $user User to check
* @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary
* queries by skipping checks for cascading protections and user blocks.
- * @param array $ignoreErrors of Strings Set this to a list of message keys
+ * @param array $ignoreErrors Array of Strings Set this to a list of message keys
* whose corresponding errors may be ignored.
* @return array Array of arguments to wfMessage to explain permissions problems.
*/
/**
* Permissions checks that fail most often, and which are easiest to test.
*
- * @param string $action the action to check
+ * @param string $action The action to check
* @param User $user User to check
* @param array $errors List of current errors
* @param bool $doExpensiveQueries Whether or not to perform expensive queries
/**
* Does the title correspond to a protected article?
*
- * @param string $action the action the page is protected from,
+ * @param string $action The action the page is protected from,
* by default checks all actions.
* @return bool
*/
/**
* Load user table data, given mId has already been set.
- * @return bool false if the ID does not exist, true otherwise
+ * @return bool False if the ID does not exist, true otherwise
*/
public function loadFromId() {
global $wgMemc;
* Given unvalidated password input, return error message on failure.
*
* @param string $password Desired password
- * @return bool|string|array true on success, string or array of error message on failure
+ * @return bool|string|array True on success, string or array of error message on failure
*/
public function getPasswordValidity( $password ) {
$result = $this->checkPasswordValidity( $password );
* Load user and user_group data from the database.
* $this->mId must be set, this is how the user is identified.
*
- * @param integer $flags Supports User::READ_LOCKING
+ * @param int $flags Supports User::READ_LOCKING
* @return bool True if the user exists, false if the user is anonymous
*/
public function loadFromDatabase( $flags = 0 ) {
* @see getNewtalk()
* @param string $field 'user_ip' for anonymous users, 'user_id' otherwise
* @param string|int $id User's IP address for anonymous users, User ID otherwise
- * @param bool $fromMaster true to fetch from the master, false for a slave
+ * @param bool $fromMaster True to fetch from the master, false for a slave
* @return bool True if the user has new messages
*/
protected function checkNewtalk( $field, $id, $fromMaster = false ) {
* a new password is set, for instance via e-mail.
*
* @param string $str New password to set
- * @throws PasswordError on failure
+ * @throws PasswordError On failure
*
* @return bool
*/
* @param IContextSource $context
* @param array $options Assoc. array with options keys to check as keys.
* Defaults to $this->mOptions.
- * @return array the key => kind mapping data
+ * @return array The key => kind mapping data
*/
public function getOptionKinds( IContextSource $context, $options = null ) {
$this->loadOptions();
/**
* Get the user's edit count.
- * @return int|null null for anonymous users
+ * @return int|null Null for anonymous users
*/
public function getEditCount() {
if ( !$this->getId() ) {
/**
* Check to see if the given clear-text password is one of the accepted passwords
- * @param string $password user password.
- * @return bool True if the given password is correct, otherwise False.
+ * @param string $password User password
+ * @return bool True if the given password is correct, otherwise False
*/
public function checkPassword( $password ) {
global $wgAuth, $wgLegacyEncoding;
* Alias for getEditToken.
* @deprecated since 1.19, use getEditToken instead.
*
- * @param string|array $salt of Strings Optional function-specific data for hashing
+ * @param string|array $salt Array of Strings Optional function-specific data for hashing
* @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
* @return string The new edit token
*/
*
* @since 1.19
*
- * @param string|array $salt of Strings Optional function-specific data for hashing
+ * @param string|array $salt Array of Strings Optional function-specific data for hashing
* @param WebRequest|null $request WebRequest object to use or null to use $wgRequest
* @return string The new edit token
*/
*
* @param string $val Input value to compare
* @param string $salt Optional function-specific data for hashing
- * @param WebRequest|null $request object to use or null to use $wgRequest
+ * @param WebRequest|null $request Object to use or null to use $wgRequest
* @return bool Whether the token matches
*/
public function matchEditTokenNoSuffix( $val, $salt = '', $request = null ) {
* Returns an array of the groups that a particular group can add/remove.
*
* @param string $group The group to check for whether it can add/remove
- * @return array array( 'add' => array( addablegroups ),
+ * @return array Array( 'add' => array( addablegroups ),
* 'remove' => array( removablegroups ),
* 'add-self' => array( addablegroups to self),
* 'remove-self' => array( removable groups from self) )
/**
* Returns an array of groups that this user can add and remove
- * @return array array( 'add' => array( addablegroups ),
+ * @return array Array( 'add' => array( addablegroups ),
* 'remove' => array( removablegroups ),
* 'add-self' => array( addablegroups to self),
* 'remove-self' => array( removable groups from self) )
/** @var int */
public $key;
- /** @var */
+ /** @var bool|stdClass */
public $current;
/**
/**
* Take an arbitrary query and rewrite the present URL to include it
- * @param string $query query string fragment; do not include initial '?'
+ * @param string $query Query string fragment; do not include initial '?'
*
* @return string
*/
* Return the path to the temporary file where PHP has stored the upload.
*
* @param string $key
- * @return string|null string or null if no such file.
+ * @return string|null String or null if no such file.
*/
public function getFileTempname( $key ) {
$file = new WebRequestUpload( $this, $key );
* Other than this the name is not verified for being a safe filename.
*
* @param string $key
- * @return string|null string or null if no such file.
+ * @return string|null String or null if no such file.
*/
public function getFileName( $key ) {
$file = new WebRequestUpload( $this, $key );
/**
* Get a request header, or false if it isn't set
- * @param string $name case-insensitive header name
+ * @param string $name Case-insensitive header name
*
* @return string|bool False on failure
*/
/**
* Parse the Accept-Language header sent by the client into an array
*
- * @return array array( languageCode => q-value ) sorted by q-value in
+ * @return array Array( languageCode => q-value ) sorted by q-value in
* descending order then appearing time in the header in ascending order.
* May contain the "language" '*', which applies to languages other than those explicitly listed.
* This is aligned with rfc2616 section 14.4
private $session = array();
/**
- * @param array $data of *non*-urlencoded key => value pairs, the
+ * @param array $data Array of *non*-urlencoded key => value pairs, the
* fake GET/POST values
* @param bool $wasPosted Whether to treat the data as POST
* @param array|null $session Session array or null
/**
* Output a HTTP header, wrapper for PHP's header()
- * @param string $string header to output
- * @param bool $replace replace current similar header
+ * @param string $string Header to output
+ * @param bool $replace Replace current similar header
* @param null|int $http_response_code Forces the HTTP response code to the specified value.
*/
public function header( $string, $replace = true, $http_response_code = null ) {
/**
* Set the browser cookie
- * @param string $name name of cookie
- * @param string $value value to give cookie
+ * @param string $name Name of cookie
+ * @param string $value Value to give cookie
* @param int|null $expire Unix timestamp (in seconds) when the cookie should expire.
* 0 (the default) causes it to expire $wgCookieExpiration seconds from now.
* null causes it to be a session cookie.
/**
* Stores a HTTP header
- * @param string $string header to output
- * @param bool $replace replace current similar header
+ * @param string $string Header to output
+ * @param bool $replace Replace current similar header
* @param null|int $http_response_code Forces the HTTP response code to the specified value.
*/
public function header( $string, $replace = true, $http_response_code = null ) {
/**
* @todo document. It just ignore optional parameters.
*
- * @param string $name name of cookie
- * @param string $value value to give cookie
- * @param int $expire number of seconds til cookie expires (Default: 0)
- * @param array $options ignored
+ * @param string $name Name of cookie
+ * @param string $value Value to give cookie
+ * @param int $expire Number of seconds til cookie expires (Default: 0)
+ * @param array $options Ignored
*/
public function setcookie( $name, $value, $expire = 0, $options = null ) {
$this->cookies[$name] = $value;
* @param string $inLanguage The ISO code of the language to display the select list in (optional)
* @param array $overrideAttrs Override the attributes of the select tag (since 1.20)
* @param Message|null $msg Label message key (since 1.20)
- * @return array containing 2 items: label HTML and select list HTML
+ * @return array Array containing 2 items: label HTML and select list HTML
*/
public static function languageSelector( $selected, $customisedOnly = true,
$inLanguage = null, $overrideAttrs = array(), Message $msg = null