/**
* Check if a given action is recognised, even if it's disabled
*
- * @param $name String: name of an action
+ * @param string $name name of an action
* @return Bool
*/
final public static function exists( $name ) {
/**
* Execute the action silently, not giving any output. Since these actions don't have
* forms, they probably won't have any data, but some (eg rollback) may do
- * @param $data Array values that would normally be in the GET request
- * @param $captureErrors Bool whether to catch exceptions and just return false
+ * @param array $data values that would normally be in the GET request
+ * @param bool $captureErrors whether to catch exceptions and just return false
* @throws ErrorPageError|Exception
* @return Bool whether execution was successful
*/
/**
* Constructor from a page id
- * @param $id Int article ID to load
+ * @param int $id article ID to load
* @return Article|null
*/
public static function newFromID( $id ) {
/**
* Get the robot policy to be used for the current view
- * @param $action String the action= GET parameter
+ * @param string $action the action= GET parameter
* @param $pOutput ParserOutput
* @return Array the policy that should be set
* TODO: actions other than 'view'
* Revision as of \<date\>; view current revision
* \<- Previous version | Next Version -\>
*
- * @param $oldid int: revision ID of this article revision
+ * @param int $oldid revision ID of this article revision
*/
public function setOldSubtitle( $oldid = 0 ) {
if ( !wfRunHooks( 'DisplayOldSubtitle', array( &$this, &$oldid ) ) ) {
/**
* Output deletion confirmation dialog
* @todo FIXME: Move to another file?
- * @param $reason String: prefilled reason
+ * @param string $reason prefilled reason
*/
public function confirmDelete( $reason ) {
wfDebug( "Article::confirmDelete\n" );
*
* @deprecated in 1.18; call OutputPage::redirect() directly
* @param $noRedir Boolean: add redirect=no
- * @param $sectionAnchor String: section to redirect to, including "#"
- * @param $extraQuery String: extra query params
+ * @param string $sectionAnchor section to redirect to, including "#"
+ * @param string $extraQuery extra query params
*/
public function doRedirect( $noRedir = false, $sectionAnchor = '', $extraQuery = '' ) {
wfDeprecated( __METHOD__, '1.18' );
* Use PHP's magic __get handler to handle accessing of
* raw WikiPage fields for backwards compatibility.
*
- * @param $fname String Field name
+ * @param string $fname Field name
*/
public function __get( $fname ) {
if ( property_exists( $this->mPage, $fname ) ) {
* Use PHP's magic __set handler to handle setting of
* raw WikiPage fields for backwards compatibility.
*
- * @param $fname String Field name
+ * @param string $fname Field name
* @param $fvalue mixed New value
*/
public function __set( $fname, $fvalue ) {
* Use PHP's magic __call handler to transform instance calls to
* WikiPage functions for backwards compatibility.
*
- * @param $fname String Name of called method
- * @param $args Array Arguments to the method
+ * @param string $fname Name of called method
+ * @param array $args Arguments to the method
* @return mixed
*/
public function __call( $fname, $args ) {
* you might need to munge it (for instance, for lowercase initial
* letters).
*
- * @param $username String: username.
+ * @param string $username username.
* @return bool
*/
public function userExists( $username ) {
* you might need to munge it (for instance, for lowercase initial
* letters).
*
- * @param $username String: username.
- * @param $password String: user password.
+ * @param string $username username.
+ * @param string $password user password.
* @return bool
*/
public function authenticate( $username, $password ) {
* Modify options in the login template.
*
* @param $template UserLoginTemplate object.
- * @param $type String 'signup' or 'login'. Added in 1.16.
+ * @param string $type 'signup' or 'login'. Added in 1.16.
*/
public function modifyUITemplate( &$template, &$type ) {
# Override this!
/**
* Set the domain this plugin is supposed to use when authenticating.
*
- * @param $domain String: authentication domain.
+ * @param string $domain authentication domain.
*/
public function setDomain( $domain ) {
$this->domain = $domain;
/**
* Check to see if the specific domain is a valid domain.
*
- * @param $domain String: authentication domain.
+ * @param string $domain authentication domain.
* @return bool
*/
public function validDomain( $domain ) {
* Return true if successful.
*
* @param $user User object.
- * @param $password String: password.
+ * @param string $password password.
* @return bool
*/
public function setPassword( $user, $password ) {
* Check if a user should authenticate locally if the global authentication fails.
* If either this or strict() returns true, local authentication is not used.
*
- * @param $username String: username.
+ * @param string $username username.
* @return Boolean
*/
public function strictUserAuth( $username ) {
/**
* autoload - take a class name and attempt to load it
*
- * @param $className String: name of class we're looking for.
+ * @param string $className name of class we're looking for.
* @return bool Returning false is important on failure as
* it allows Zend to try and look in other registered autoloaders
* as well.
* Does not return groups the user already belongs to or has once belonged.
*
* @param $user User The user to get the groups for
- * @param $event String key in $wgAutopromoteOnce (each one has groups/criteria)
+ * @param string $event key in $wgAutopromoteOnce (each one has groups/criteria)
*
* @return array Groups the user should be promoted to.
*
* APCOND_AGE. Other types will throw an exception if no extension evalu-
* ates them.
*
- * @param $cond Array: A condition, which must not contain other conditions
+ * @param array $cond A condition, which must not contain other conditions
* @param $user User The user to check the condition against
* @throws MWException
* @return bool Whether the condition is true for the user
* user ID. Tries the user ID first, and if that doesn't work, tries
* the address.
*
- * @param $address String: IP address of user/anon
+ * @param string $address IP address of user/anon
* @param $user Integer: user id of user
* @return Block Object
* @deprecated since 1.18
/**
* Get a block from the DB, with either the given address or the given username
*
- * @param $address string The IP address of the user, or blank to skip IP blocks
- * @param $user int The user ID, or zero for anonymous users
+ * @param string $address The IP address of the user, or blank to skip IP blocks
+ * @param int $user The user ID, or zero for anonymous users
* @return Boolean: the user is blocked from editing
* @deprecated since 1.18
*/
/**
* Get a set of SQL conditions which will select rangeblocks encompasing a given range
- * @param $start String Hexadecimal IP representation
- * @param $end String Hexadecimal IP represenation, or null to use $start = $end
+ * @param string $start Hexadecimal IP representation
+ * @param string $end Hexadecimal IP represenation, or null to use $start = $end
* @return String
*/
public static function getRangeCond( $start, $end = null ) {
* blocked by this Block. This will use the recentchanges table.
*
* @param Block $block
- * @param Array &$blockIds
+ * @param array &$blockIds
* @return Array: block IDs of retroactive autoblocks made
*/
protected static function defaultRetroactiveAutoblock( Block $block, array &$blockIds ) {
* Checks whether a given IP is on the autoblock whitelist.
* TODO: this probably belongs somewhere else, but not sure where...
*
- * @param $ip String: The IP to check
+ * @param string $ip The IP to check
* @return Boolean
*/
public static function isWhitelistedFromAutoblocks( $ip ) {
/**
* Autoblocks the given IP, referring to this Block.
*
- * @param $autoblockIP String: the IP to autoblock.
+ * @param string $autoblockIP the IP to autoblock.
* @return mixed: block ID if an autoblock was inserted, false if not.
*/
public function doAutoblock( $autoblockIP ) {
/**
* Encode expiry for DB
*
- * @param $expiry String: timestamp for expiry, or
+ * @param string $expiry timestamp for expiry, or
* @param $db DatabaseBase object
* @return String
* @deprecated since 1.18; use $dbw->encodeExpiry() instead
/**
* Decode expiry which has come from the DB
*
- * @param $expiry String: Database expiry format
- * @param $timestampType Int Requested timestamp format
+ * @param string $expiry Database expiry format
+ * @param int $timestampType Requested timestamp format
* @return String
* @deprecated since 1.18; use $wgLang->formatExpiry() instead
*/
/**
* Gets rid of uneeded numbers in quad-dotted/octet IP strings
* For example, 127.111.113.151/24 -> 127.111.113.0/24
- * @param $range String: IP address to normalize
+ * @param string $range IP address to normalize
* @return string
* @deprecated since 1.18, call IP::sanitizeRange() directly
*/
/**
* Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute
* ("24 May 2034"), into an absolute timestamp we can put into the database.
- * @param $expiry String: whatever was typed into the form
+ * @param string $expiry whatever was typed into the form
* @return String: timestamp or "infinity" string for th DB implementation
* @deprecated since 1.18 moved to SpecialBlock::parseExpiryInput()
*/
* @param $vagueTarget String|User|Int as above, but we will search for *any* block which
* affects that target (so for an IP address, get ranges containing that IP; and also
* get any relevant autoblocks). Leave empty or blank to skip IP-based lookups.
- * @param $fromMaster Bool whether to use the DB_MASTER database
+ * @param bool $fromMaster whether to use the DB_MASTER database
* @return Block|null (null if no relevant block could be found). The target and type
* of the returned Block will refer to the actual block which was found, which might
* not be the same as the target you gave if you used $vagueTarget!
/**
* Factory function.
*
- * @param $name Array: A category name (no "Category:" prefix). It need
+ * @param array $name A category name (no "Category:" prefix). It need
* not be normalized, with spaces replaced by underscores.
* @return mixed Category, or false on a totally invalid name
*/
/**
* Constructor from a page id
- * @param $id Int article ID to load
+ * @param int $id article ID to load
* @return CategoryPage|null
*/
public static function newFromID( $id ) {
* @since 1.19 $context is a second, required parameter
* @param $title Title
* @param $context IContextSource
- * @param $from Array An array with keys page, subcat,
+ * @param array $from An array with keys page, subcat,
* and file for offset of results of each section (since 1.17)
- * @param $until Array An array with 3 keys for until of each section (since 1.17)
+ * @param array $until An array with 3 keys for until of each section (since 1.17)
* @param $query Array
*/
function __construct( $title, IContextSource $context, $from = array(), $until = array(), $query = array() ) {
* Get the paging links for a section (subcats/pages/files), to go at the top and bottom
* of the output.
*
- * @param $type String: 'page', 'subcat', or 'file'
+ * @param string $type 'page', 'subcat', or 'file'
* @return String: HTML output, possibly empty if there are no other pages
*/
private function getSectionPagingLinks( $type ) {
/**
* Create paging links, as a helper method to getSectionPagingLinks().
*
- * @param $first String The 'until' parameter for the generated URL
- * @param $last String The 'from' parameter for the genererated URL
- * @param $type String A prefix for parameters, 'page' or 'subcat' or
+ * @param string $first The 'until' parameter for the generated URL
+ * @param string $last The 'from' parameter for the genererated URL
+ * @param string $type A prefix for parameters, 'page' or 'subcat' or
* 'file'
* @return String HTML
*/
* corresponds to the correct segment of the category.
*
* @param Title $title: The title (usually $this->title)
- * @param String $section: Which section
+ * @param string $section: Which section
* @throws MWException
* @return Title
*/
* category-subcat-count-limited, category-file-count,
* category-file-count-limited.
*
- * @param $rescnt Int: The number of items returned by our database query.
- * @param $dbcnt Int: The number of items according to the category table.
- * @param $type String: 'subcat', 'article', or 'file'
+ * @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.
*/
private function getCountMessage( $rescnt, $dbcnt, $type ) {
* Initializes the instance. Do this prior to calling run().
* @param $article_ids Array of article IDs
* @param $categories FIXME
- * @param $mode String: FIXME, default 'AND'.
+ * @param string $mode FIXME, default 'AND'.
* @todo FIXME: $categories/$mode
*/
function seed( $article_ids, $categories, $mode = 'AND' ) {
/**
* This functions recurses through the parent representation, trying to match the conditions
- * @param $id int The article/category to check
- * @param $conds array The array of categories to match
- * @param $path array used to check for recursion loops
+ * @param int $id The article/category to check
+ * @param array $conds The array of categories to match
+ * @param array $path used to check for recursion loops
* @return bool Does this match the conditions?
*/
function check( $id, &$conds, $path = array() ) {
/**
* Creates HTML for the given tags
*
- * @param $tags String: Comma-separated list of tags
- * @param $page String: A label for the type of action which is being displayed,
+ * @param string $tags Comma-separated list of tags
+ * @param string $page A label for the type of action which is being displayed,
* for example: 'history', 'contributions' or 'newpages'
*
* @return Array with two items: (html, classes)
/**
* Get a short description for a tag
*
- * @param $tag String: 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 $tags String|Array: Tags to add to the change
+ * @param string|array $tags Tags to add to the change
* @param $rc_id int: rc_id of the change to add the tags to
* @param $rev_id int: rev_id of the change to add the tags to
* @param $log_id int: log_id of the change to add the tags to
- * @param $params String: params to put in the ct_params field of tabel 'change_tag'
+ * @param string $params params to put in the ct_params field of tabel 'change_tag'
*
* @throws MWException
* @return bool: false if no changes are made, otherwise true
* Handles selecting tags, and filtering.
* Needs $tables to be set up properly, so we can figure out which join conditions to use.
*
- * @param $tables String|Array: Tabel names, see DatabaseBase::select
- * @param $fields String|Array: Fields used in query, see DatabaseBase::select
- * @param $conds String|Array: conditions used in query, see DatabaseBase::select
+ * @param string|array $tables Tabel names, see DatabaseBase::select
+ * @param string|array $fields Fields used in query, see DatabaseBase::select
+ * @param string|array $conds conditions used in query, see DatabaseBase::select
* @param $join_conds Array: join conditions, see DatabaseBase::select
- * @param $options Array: options, see Database::select
+ * @param array $options options, see Database::select
* @param bool|string $filter_tag Tag to select on
*
* @throws MWException When unable to determine appropriate JOIN condition for tagging
/**
* Build a text box to select a change tag
*
- * @param $selected String: tag to select by default
+ * @param string $selected tag to select by default
* @param $fullForm Boolean:
* - if false, then it returns an array of (label, form).
* - if true, it returns an entire form around the selector.
/**
* Constructor
*
- * @param $format String: feed's format (either 'rss' or 'atom')
- * @param $type String: type of feed (for cache keys)
+ * @param string $format feed's format (either 'rss' or 'atom')
+ * @param string $type type of feed (for cache keys)
*/
public function __construct( $format, $type ) {
$this->format = $format;
/**
* Get a ChannelFeed subclass object to use
*
- * @param $title String: feed's title
- * @param $description String: feed's description
- * @param $url String: url of origin page
+ * @param string $title feed's title
+ * @param string $description feed's description
+ * @param string $url url of origin page
* @return ChannelFeed subclass or false on failure
*/
public function getFeedObject( $title, $description, $url ) {
/**
* Save to feed result to $messageMemc
*
- * @param $feed String: feed's content
- * @param $timekey String: memcached key of the last modification
- * @param $key String: memcached key of the content
+ * @param string $feed feed's content
+ * @param string $timekey memcached key of the last modification
+ * @param string $key memcached key of the content
*/
public function saveToCache( $feed, $timekey, $key ) {
global $messageMemc;
* Try to load the feed result from $messageMemc
*
* @param $lastmod Integer: timestamp of the last item in the recentchanges table
- * @param $timekey String: memcached key of the last modification
- * @param $key String: memcached key of the content
+ * @param string $timekey memcached key of the last modification
+ * @param string $key memcached key of the content
* @return string|bool feed's content on cache hit or false on cache miss
*/
public function loadFromCache( $lastmod, $timekey, $key ) {
* This first argument used to be an User object.
*
* @deprecated in 1.18; use newFromContext() instead
- * @param $unused string|User Unused
+ * @param string|User $unused Unused
* @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
public static function newFromUser( $unused ) {
/**
* Returns the appropriate flags for new page, minor change and patrolling
- * @param $flags Array Associative array of 'flag' => Bool
- * @param $nothing String to use for empty space
+ * @param array $flags Associative array of 'flag' => Bool
+ * @param string $nothing to use for empty space
* @return String
*/
protected function recentChangesFlags( $flags, $nothing = ' ' ) {
* unpatrolled edit. By default in English it will contain "N", "m", "b",
* "!" respectively, plus it will have an appropriate title and class.
*
- * @param $flag String: 'newpage', 'unpatrolled', 'minor', or 'bot'
+ * @param string $flag 'newpage', 'unpatrolled', 'minor', or 'bot'
* @return String: Raw HTML
*/
public static function flag( $flag ) {
}
/**
- * @param $s string HTML to update
+ * @param string $s HTML to update
* @param $rc_timestamp mixed
*/
public function insertDateHeader( &$s, $rc_timestamp ) {
}
/**
- * @param $s string HTML to update
+ * @param string $s HTML to update
* @param $title Title
* @param $logtype string
*/
}
/**
- * @param $s string HTML to update
+ * @param string $s HTML to update
* @param $rc RecentChange
* @param $unpatrolled
*/
}
/**
- * @param $s string HTML to update
+ * @param string $s HTML to update
* @param $rc RecentChange
* @param $unpatrolled
* @param $watched
/**
* Insert time timestamp string from $rc into $s
*
- * @param $s string HTML to update
+ * @param string $s HTML to update
* @param $rc RecentChange
*/
public function insertTimestamp( &$s, $rc ) {
* Format a line using the old system (aka without any javascript).
*
* @param $rc RecentChange, passed by reference
- * @param $watched Bool (default false)
- * @param $linenumber Int (default null)
+ * @param bool $watched (default false)
+ * @param int $linenumber (default null)
*
* @return string|bool
*/
/**
* Generate HTML for an arrow or placeholder graphic
- * @param $dir String: one of '', 'd', 'l', 'r'
- * @param $alt String: text
- * @param $title String: text
+ * @param string $dir one of '', 'd', 'l', 'r'
+ * @param string $alt text
+ * @param string $title text
* @return String: HTML "<img>" tag
*/
protected function arrow( $dir, $alt = '', $title = '' ) {
* Do a binary search, and return the index of the largest item that sorts
* less than or equal to the target value.
*
- * @param $valueCallback array A function to call to get the value with
+ * @param array $valueCallback A function to call to get the value with
* a given array index.
- * @param $valueCount int The number of items accessible via $valueCallback,
+ * @param int $valueCount The number of items accessible via $valueCallback,
* indexed from 0 to $valueCount - 1
- * @param $comparisonCallback array A callback to compare two values, returning
+ * @param array $comparisonCallback A callback to compare two values, returning
* -1, 0 or 1 in the style of strcmp().
- * @param $target string The target value to find.
+ * @param string $target The target value to find.
*
* @return int|bool The item index of the lower bound, or false if the target value
* sorts before all items.
/**
* Edit the text. Returns the edited text.
- * @param $ops Array of operations.
+ * @param array $ops of operations.
*
* Operations are given as an associative array, with members:
* type: One of delete, set, append or insert (required)
* setVar( $arr, 'foo/bar', 'baz', 3 ); will set
* $arr['foo']['bar']['baz'] = 3;
* @param $array array
- * @param $path string slash-delimited path
+ * @param string $path slash-delimited path
* @param $key mixed Key
* @param $value mixed Value
*/
* cookies. Used internally after a request to parse the
* Set-Cookie headers.
*
- * @param $value String: the value of the cookie
- * @param $attr Array: possible key/values:
+ * @param string $value the value of the cookie
+ * @param array $attr possible key/values:
* expires A date string
* path The path this cookie is used on
* domain Domain this cookie is used on
* @todo fixme fails to detect 3-letter top-level domains
* @todo fixme fails to detect 2-letter top-level domains for single-domain use (probably not a big problem in practice, but there are test cases)
*
- * @param $domain String: the domain to validate
- * @param $originDomain String: (optional) the domain the cookie originates from
+ * @param string $domain the domain to validate
+ * @param string $originDomain (optional) the domain the cookie originates from
* @return Boolean
*/
public static function validateCookieDomain( $domain, $originDomain = null ) {
/**
* Serialize the cookie jar into a format useful for HTTP Request headers.
*
- * @param $path String: the path that will be used. Required.
- * @param $domain String: the domain that will be used. Required.
+ * @param string $path the path that will be used. Required.
+ * @param string $domain the domain that will be used. Required.
* @return String
*/
public function serializeToHttpRequest( $path, $domain ) {
* Parse the content of an Set-Cookie HTTP Response header.
*
* @param $cookie String
- * @param $domain String: cookie's domain
+ * @param string $domain cookie's domain
* @return null
*/
public function parseCookieResponseHeader ( $cookie, $domain ) {
/**
* Randomly hash data while mixing in clock drift data for randomness
*
- * @param $data string The data to randomly hash.
+ * @param string $data The data to randomly hash.
* @return String The hashed bytes
* @author Tim Starling
*/
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param $bytes int the number of bytes of random data to generate
- * @param $forceStrong bool Pass true if you want generate to prefer cryptographically
+ * @param int $bytes the number of bytes of random data to generate
+ * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @return String Raw binary random data
* You can use MWCryptRand::wasStrong() if you wish to know if the source used
* was cryptographically strong.
*
- * @param $chars int the number of hex chars of random data to generate
- * @param $forceStrong bool Pass true if you want generate to prefer cryptographically
+ * @param int $chars the number of hex chars of random data to generate
+ * @param bool $forceStrong Pass true if you want generate to prefer cryptographically
* strong sources of entropy even if reading from them may steal
* more entropy from the system than optimal.
* @return String Hexadecimal random data
* This allows for limited transactional logic across multiple backends for storing
* secondary data.
*
- * @param $updates array a list of DataUpdate instances
+ * @param array $updates a list of DataUpdate instances
* @throws Exception|null
*/
public static function runUpdates( $updates ) {
/**
* Do any deferred updates and clear the list
*
- * @param $commit String: set to 'commit' to commit after every update to
+ * @param string $commit set to 'commit' to commit after every update to
* prevent lock contention
*/
public static function doUpdates( $commit = '' ) {
* "View source for ..." page displaying the source code after the error message.
*
* @since 1.19
- * @param $permErrors Array of permissions errors, as returned by
+ * @param array $permErrors of permissions errors, as returned by
* Title::getUserPermissionsErrors().
* @throws PermissionsError
*/
* Get the contents to be preloaded into the box, either set by
* an earlier setPreloadText() or by loading the given page.
*
- * @param $preload String: representing the title to preload from.
+ * @param string $preload representing the title to preload from.
*
* @return String
*
* Get the contents to be preloaded into the box, either set by
* an earlier setPreloadText() or by loading the given page.
*
- * @param $preload String: representing the title to preload from.
+ * @param string $preload representing the title to preload from.
*
* @return Content
*
* an exception will be raised. Set $this->allowNonTextContent to true to allow editing of non-textual
* content.
*
- * @param String|null|bool $text Text to unserialize
+ * @param string|null|bool $text Text to unserialize
* @return Content The content object created from $text. If $text was false or null, false resp. null will be
* returned instead.
*
* inferred by the id given to the input. You can remove them both by
* passing array( 'id' => false ) to $userInputAttrs.
*
- * @param $summary string The value of the summary input
- * @param $labelText string The html to place inside the label
- * @param $inputAttrs array of attrs to use on the input
- * @param $spanLabelAttrs array of attrs to use on the span inside the label
+ * @param string $summary The value of the summary input
+ * @param string $labelText The html to place inside the label
+ * @param array $inputAttrs of attrs to use on the input
+ * @param array $spanLabelAttrs of attrs to use on the span inside the label
*
* @return array An array in the format array( $label, $input )
*/
* @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 $summary String: The text of the summary to display
+ * @param string $summary The text of the summary to display
* @return String
*/
protected function showSummaryInput( $isSubjectPreview, $summary = "" ) {
* @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 $summary String: the text of the summary to display
+ * @param string $summary the text of the summary to display
* @return String
*/
protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) {
* The $textoverride method can be used by subclasses overriding showContentForm
* to pass back to this method.
*
- * @param $customAttribs array of html attributes to use in the textarea
- * @param $textoverride String: optional text to override $this->textarea1 with
+ * @param array $customAttribs of html attributes to use in the textarea
+ * @param string $textoverride optional text to override $this->textarea1 with
*/
protected function showTextbox1( $customAttribs = null, $textoverride = null ) {
if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) {
* Append preview output to $wgOut.
* Includes category rendering if this is a category page.
*
- * @param $text String: the HTML to be output for the preview.
+ * @param string $text the HTML to be output for the preview.
*/
protected function showPreview( $text ) {
global $wgOut;
* Returns an array of html code of the following checkboxes:
* minor and watch
*
- * @param $tabindex int Current tabindex
- * @param $checked Array of checkbox => bool, where bool indicates the checked
+ * @param int $tabindex Current tabindex
+ * @param array $checked of checkbox => bool, where bool indicates the checked
* status of the checkbox
*
* @return array
* Returns an array of html code of the following buttons:
* save, diff, preview and live
*
- * @param $tabindex int Current tabindex
+ * @param int $tabindex Current tabindex
*
* @return array
*/
/**
* Produce the stock "your edit contains spam" page
*
- * @param $match string|bool Text which triggered one or more filters
+ * @param string|bool $match Text which triggered one or more filters
* @deprecated since 1.17 Use method spamPageWithContent() instead
*/
static function spamPage( $match = false ) {
/**
* Run hook to allow extensions to modify the text of the exception
*
- * @param $name string: class name of the exception
- * @param $args array: arguments to pass to the callback functions
+ * @param string $name class name of the exception
+ * @param array $args arguments to pass to the callback functions
* @return string|null string to output or null if any hook has been called
*/
function runHooks( $name, $args = array() ) {
/**
* Get a message from i18n
*
- * @param $key string: message name
- * @param $fallback string: default message if the message cache can't be
+ * @param string $key message name
+ * @param string $fallback default message if the message cache can't be
* called by the exception
* The function also has other parameters that are arguments for the message
* @return string message with arguments replaced
/**
* Note: these arguments are keys into wfMessage(), not text!
*
- * @param $title string|Message Message key (string) for page title, or a Message object
- * @param $msg string|Message Message key (string) for error text, or a Message object
- * @param $params array with parameters to wfMessage()
+ * @param string|Message $title Message key (string) for page title, or a Message object
+ * @param string|Message $msg Message key (string) for error text, or a Message object
+ * @param array $params with parameters to wfMessage()
*/
function __construct( $title, $msg, $params = null ) {
$this->title = $title;
*/
class BadTitleError extends ErrorPageError {
/**
- * @param $msg string|Message A message key (default: 'badtitletext')
- * @param $params Array parameter to wfMessage()
+ * @param string|Message $msg A message key (default: 'badtitletext')
+ * @param array $params parameter to wfMessage()
*/
function __construct( $msg = 'badtitletext', $params = null ) {
parent::__construct( 'badtitle', $msg, $params );
* Constructor
*
* @param $httpCode Integer: HTTP status code to send to the client
- * @param $content String|Message: content of the message
- * @param $header String|Message: content of the header (\<title\> and \<h1\>)
+ * @param string|Message $content content of the message
+ * @param string|Message $header content of the header (\<title\> and \<h1\>)
*/
public function __construct( $httpCode, $content, $header = null ) {
parent::__construct( $content );
* Print a message, if possible to STDERR.
* Use this in command line mode only (see isCommandLine)
*
- * @param $message string Failure text
+ * @param string $message Failure text
*/
public static function printError( $message ) {
# NOTE: STDERR may not be available, especially if php-cgi is used from the command line (bug #15602).
* offset: non-inclusive offset at which to start the query
* limit: maximum number of rows to return
* dir: "asc" or "desc" timestamp order
- * @param $buffer Int: one of WikiExporter::BUFFER or WikiExporter::STREAM
- * @param $text Int: one of WikiExporter::TEXT or WikiExporter::STUB
+ * @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 $start Int: inclusive lower limit (this id is included)
+ * @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.
*/
/**
* Dumps a series of page and revision records for those pages
* in the database with revisions falling within the rev_id range given.
- * @param $start Int: inclusive lower limit (this id is included)
+ * @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 $timestamp string
- * @param $indent string Default to six spaces
+ * @param string $indent Default to six spaces
* @return string
*/
function writeTimestamp( $timestamp, $indent = " " ) {
/**
* @param $id
* @param $text string
- * @param $indent string Default to six spaces
+ * @param string $indent Default to six spaces
* @return string
*/
function writeContributor( $id, $text, $indent = " " ) {
* Use this for the last piece of a file written out
* at specified checkpoints (e.g. every n hours).
* @param $newname mixed File name. May be a string or an array with one element
- * @param $open bool If true, a new file with the old filename will be opened again for writing (default: false)
+ * @param bool $open If true, a new file with the old filename will be opened again for writing (default: false)
*/
function closeAndRename( $newname, $open = false ) {
}
* Check whether external edit or diff should be used.
*
* @param $context IContextSource context to use
- * @param $type String can be either 'edit' or 'diff'
+ * @param string $type can be either 'edit' or 'diff'
* @return Bool
*/
public static function useExternalEngine( IContextSource $context, $type ) {
* This is part of the core code and is not overridable by specific
* plugins. It's in this class only for convenience.
*
- * @param $id int user_id
+ * @param int $id user_id
*/
final public function linkToLocal( $id ) {
$dbw = wfGetDB( DB_MASTER );
* Fallback implementation of mb_strpos, hardcoded to UTF-8.
* @param $haystack String
* @param $needle String
- * @param $offset String: optional start position
- * @param $encoding String: optional encoding; ignored
+ * @param string $offset optional start position
+ * @param string $encoding optional encoding; ignored
* @return int
*/
public static function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
* Fallback implementation of mb_strrpos, hardcoded to UTF-8.
* @param $haystack String
* @param $needle String
- * @param $offset String: optional start position
- * @param $encoding String: 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 = '' ) {
/**
* Constructor
*
- * @param $title String|Title Item's title
+ * @param string|Title $title Item's title
* @param $description String
- * @param $url String: URL uniquely designating the item.
- * @param $date String: Item's date
- * @param $author String: Author's user name
+ * @param string $url URL uniquely designating the item.
+ * @param string $date Item's date
+ * @param string $author Author's user name
* @param $comments String
*/
function __construct( $title, $description, $url, $date = '', $author = '', $comments = '' ) {
/**
* Encode $string so that it can be safely embedded in a XML document
*
- * @param $string String: string to encode
+ * @param string $string string to encode
* @return String
*/
public function xmlEncode( $string ) {
/**
* set the unique id of an item
*
- * @param $uniqueId String: unique id for the item
+ * @param string $uniqueId unique id for the item
* @param $rssIsPermalink Boolean: set to true if the guid (unique id) is a permalink (RSS feeds only)
*/
public function setUniqueId( $uniqueId, $rssIsPermalink = false ) {
/**
* Quickie hack... strip out wikilinks to more legible form from the comment.
*
- * @param $text String: wikitext
+ * @param string $text wikitext
* @return String
*/
public static function stripComment( $text ) {
* If the feed should be purged; $timekey and $key will be removed from
* $messageMemc
*
- * @param $timekey String: cache key of the timestamp of the last item
- * @param $key String: cache key of feed's content
+ * @param string $timekey cache key of the timestamp of the last item
+ * @param string $key cache key of feed's content
*/
public static function checkPurge( $timekey, $key ) {
global $wgRequest, $wgUser, $messageMemc;
/**
* Check whether feeds can be used and that $type is a valid feed type
*
- * @param $type String: feed type, as requested by the user
+ * @param string $type feed type, as requested by the user
* @return Boolean
*/
public static function checkFeedOutput( $type ) {
* @param $oldid Integer: old revision's id
* @param $newid Integer: new revision's id
* @param $timestamp Integer: new revision's timestamp
- * @param $comment String: new revision's comment
- * @param $actiontext String: text of the action; in case of log event
+ * @param string $comment new revision's comment
+ * @param string $actiontext text of the action; in case of log event
* @return String
*/
public static function formatDiffRow( $title, $oldid, $newid, $timestamp, $comment, $actiontext = '' ) {
* Might be 'cleaner' to use DOM or XSLT or something,
* but *gack* it's a pain in the ass.
*
- * @param $text String: diff's HTML output
+ * @param string $text diff's HTML output
* @return String: modified HTML
*/
public static function applyDiffStyle( $text ) {
*
* @param $title Title object
* @param File $file: file object
- * @param $oldimage String: archive name
- * @param $reason String: reason of the deletion
+ * @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
* @throws MWException
* showing an appropriate message depending upon whether
* it's a current file or an old version
*
- * @param $message String: message base
+ * @param string $message message base
* @return String
*/
private function prepareMessage( $message ) {
/**
* Verify the given option name exist.
*
- * @param $name String: option name
+ * @param string $name option name
* @param $strict Boolean: throw an exception when the option does not exist (default false)
* @throws MWException
* @return Boolean: true if option exist, false otherwise
/**
* Use to set the value of an option.
*
- * @param $name String: option name
+ * @param string $name option name
* @param $value Mixed: value for the option
* @param $force Boolean: whether to set the value when it is equivalent to the default value for this option (default false).
* @return null
* Get the value for the given option name.
* Internally use getValueReal()
*
- * @param $name String: option name
+ * @param string $name option name
* @return Mixed
*/
public function getValue( $name ) {
/**
* @todo Document
- * @param $option Array: array structure describing the option
+ * @param array $option array structure describing the option
* @return Mixed. Value or the default value if it is null
*/
protected function getValueReal( $option ) {
/**
* Delete the option value.
* This will make future calls to getValue() return the default value.
- * @param $name String: option name
+ * @param string $name option name
* @return null
*/
public function reset( $name ) {
/**
* @todo Document
- * @param $names Array: array of option names
+ * @param array $names array of option names
* @return null
*/
public function consumeValues( /*Array*/ $names ) {
* Validate and set an option integer value
* The value will be altered to fit in the range.
*
- * @param $name String: option name
- * @param $min Int: minimum value
- * @param $max Int: maximum value
+ * @param string $name option name
+ * @param int $min minimum value
+ * @param int $max maximum value
* @throws MWException
* @exception MWException Option is not of type int
* @return null
private static $viewers = false;
/**
- * @param $dir string The root directory of the repo where the .git dir can be found
+ * @param string $dir The root directory of the repo where the .git dir can be found
*/
public function __construct( $dir ) {
$this->basedir = "{$dir}/.git";
/**
* Check if a string looks like a hex encoded SHA1 hash
*
- * @param $str string The string to check
+ * @param string $str The string to check
* @return bool Whether or not the string looks like a SHA1
*/
public static function isSHA1( $str ) {
* @param $key String|Int
* @param $value Mixed
* @param $default Mixed
- * @param $changed Array to alter
+ * @param array $changed to alter
* @throws MWException
*/
function wfAppendToArrayIfNotDefault( $key, $value, $default, &$changed ) {
/**
* Insert array into another array after the specified *KEY*
*
- * @param $array Array: The array.
- * @param $insert Array: The array to insert.
+ * @param array $array The array.
+ * @param array $insert The array to insert.
* @param $after Mixed: The key to insert after
* @return Array
*/
* @note This is not secure, if you are trying to generate some sort
* of token please use MWCryptRand instead.
*
- * @param $length int The length of the string to generate
+ * @param int $length The length of the string to generate
* @return String
* @since 1.20
*/
* "days=7&limit=100". Options in the first array override options in the second.
* Options set to null or false will not be output.
*
- * @param $array1 Array ( String|Array )
- * @param $array2 Array ( String|Array )
+ * @param array $array1 ( String|Array )
+ * @param array $array2 ( String|Array )
* @param $prefix String
* @return String
*/
* tibility with legacy functions that accept raw query strings instead of nice
* arrays. Of course, keys and values are urldecode()d.
*
- * @param $query String: query string
+ * @param string $query query string
* @return array Array version of input
*/
function wfCgiToArray( $query ) {
* @todo this won't work with current-path-relative URLs
* like "subdir/foo.html", etc.
*
- * @param $url String: either fully-qualified or a local path + query
+ * @param string $url either fully-qualified or a local path + query
* @param $defaultProto Mixed: one of the PROTO_* constants. Determines the
* protocol to use if $url or $wgServer is
* protocol-relative
* @todo Need to integrate this into wfExpandUrl (bug 32168)
*
* @since 1.19
- * @param $urlParts Array URL parts, as output from wfParseUrl
+ * @param array $urlParts URL parts, as output from wfParseUrl
* @return string URL assembled from its component parts
*/
function wfAssembleUrl( $urlParts ) {
*
* @todo Need to integrate this into wfExpandUrl (bug 32168)
*
- * @param $urlPath String URL path, potentially containing dot-segments
+ * @param string $urlPath URL path, potentially containing dot-segments
* @return string URL path with all dot-segments removed
*/
function wfRemoveDotSegments( $urlPath ) {
/**
* Returns a regular expression of url protocols
*
- * @param $includeProtocolRelative bool If false, remove '//' from the returned protocol list.
+ * @param bool $includeProtocolRelative If false, remove '//' from the returned protocol list.
* DO NOT USE this directly, use wfUrlProtocolsWithoutProtRel() instead
* @return String
*/
* 2) Handles protocols that don't use :// (e.g., mailto: and news: , as well as protocol-relative URLs) correctly
* 3) Adds a "delimiter" element to the array, either '://', ':' or '//' (see (2))
*
- * @param $url String: a URL to parse
+ * @param string $url a URL to parse
* @return Array: bits of the URL in an associative array, per PHP docs
*/
function wfParseUrl( $url ) {
/**
* Check whether a given URL has a domain that occurs in a given set of domains
- * @param $url string URL
- * @param $domains array Array of domains (strings)
+ * @param string $url URL
+ * @param array $domains Array of domains (strings)
* @return bool True if the host part of $url ends in one of the strings in $domains
*/
function wfMatchesDomainList( $url, $domains ) {
* $wgDebugComments - if on, some debug items may appear in comments in the HTML output.
*
* @param $text String
- * @param $logonly Bool: set true to avoid appearing in HTML when $wgDebugComments is set
+ * @param bool $logonly set true to avoid appearing in HTML when $wgDebugComments is set
*/
function wfDebug( $text, $logonly = false ) {
global $wgDebugLogFile, $wgProfileOnly, $wgDebugRawPage, $wgDebugLogPrefix;
/**
* Send a line giving PHP memory usage.
*
- * @param $exact Bool: print exact values instead of kilobytes (default: false)
+ * @param bool $exact print exact values instead of kilobytes (default: false)
*/
function wfDebugMem( $exact = false ) {
$mem = memory_get_usage();
*
* @param $logGroup String
* @param $text String
- * @param $public Bool: whether to log the event in the public log if no private
+ * @param bool $public whether to log the event in the public log if no private
* log file is specified, (default true)
*/
function wfDebugLog( $logGroup, $text, $public = true ) {
/**
* Log for database errors
*
- * @param $text String: database error message.
+ * @param string $text database error message.
*/
function wfLogDBError( $text ) {
global $wgDBerrorLog, $wgDBerrorLogTZ;
* Throws a warning that $function is deprecated
*
* @param $function String
- * @param $version String|bool: Version of MediaWiki that the function was deprecated in (Added in 1.19).
- * @param $component String|bool: Added in 1.19.
+ * @param string|bool $version Version of MediaWiki that the function was deprecated in (Added in 1.19).
+ * @param string|bool $component Added in 1.19.
* @param $callerOffset integer: How far up the callstack is the original
* caller. 2 = function that called the function that called
* wfDeprecated (Added in 1.20)
* Send a warning either to the debug log or in a PHP error depending on
* $wgDevelopmentWarnings
*
- * @param $msg String: message to send
+ * @param string $msg message to send
* @param $callerOffset Integer: number of items to go back in the backtrace to
* find the correct caller (1 = function calling wfWarn, ...)
* @param $level Integer: PHP error level; only used when $wgDevelopmentWarnings
* send lines to the specified port, prefixed by the specified prefix and a space.
*
* @param $text String
- * @param $file String filename
+ * @param string $file filename
* @throws MWException
*/
function wfErrorLog( $text, $file ) {
*
* @deprecated since 1.18
*
- * @param $key String: 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 $key String: lookup key for the message, usually
+ * @param string $key lookup key for the message, usually
* defined in languages/Language.php
* @return String
*/
*
* @deprecated since 1.18
*
- * @param $key String: key to get.
+ * @param string $key key to get.
* @param $args
* @param $useDB Boolean
* @param $forContent Mixed: Language code, or false for user lang, true for content lang.
*
* @param $key String
* @param $useDB Bool
- * @param $langCode String: Code of the language to get the message for, or
+ * @param string $langCode Code of the language to get the message for, or
* behaves as a content language switch if it is a boolean.
* @param $transform Boolean: whether to parse magic words, etc.
* @return string
*
* @deprecated since 1.18
*
- * @param $key String: key of the message
- * @param $options Array: processing rules. Can take the following options:
+ * @param string $key key of the message
+ * @param array $options processing rules. Can take the following options:
* <i>parse</i>: parses wikitext to HTML
* <i>parseinline</i>: parses wikitext to HTML and removes the surrounding
* p's added by parser or tidy
* Throw a debugging exception. This function previously once exited the process,
* but now throws an exception instead, with similar results.
*
- * @param $msg String: message shown when dying.
+ * @param string $msg message shown when dying.
* @throws MWException
*/
function wfDebugDieBacktrace( $msg = '' ) {
* debug_backtrace is disabled, otherwise the output from
* debug_backtrace() (trimmed).
*
- * @param $limit int This parameter can be used to limit the number of stack frames returned
+ * @param int $limit This parameter can be used to limit the number of stack frames returned
*
* @return array of backtrace information
*/
* Return a string consisting of callers in the stack. Useful sometimes
* for profiling specific points.
*
- * @param $limit int The maximum depth of the stack frame to return, or false for
+ * @param int $limit The maximum depth of the stack frame to return, or false for
* the entire stack.
* @return String
*/
* @param $offset String
* @param $limit Integer
* @param $link String
- * @param $query String: optional URL query parameter string
- * @param $atend Bool: optional param for specified if this is the last page
+ * @param string $query optional URL query parameter string
+ * @param bool $atend optional param for specified if this is the last page
* @return String
* @deprecated in 1.19; use Language::viewPrevNext() instead
*/
/**
* Make a list item, used by various special pages
*
- * @param $page String Page link
- * @param $details String Text between brackets
+ * @param string $page Page link
+ * @param string $details Text between brackets
* @param $oppositedm Boolean Add the direction mark opposite to your
* language, to display text properly
* @return String
* Obtain the offset and limit values from the request string;
* used in special pages
*
- * @param $deflimit Int default limit if none supplied
- * @param $optionname String Name of a user preference to check against
+ * @param int $deflimit default limit if none supplied
+ * @param string $optionname Name of a user preference to check against
* @return array
*
*/
* is achieved by substituting certain characters with HTML entities.
* As required by the callers, "<nowiki>" is not used.
*
- * @param $text String: text to be escaped
+ * @param string $text text to be escaped
* @return String
*/
function wfEscapeWikiText( $text ) {
* factors
*
* @param $accept String
- * @param $def String default
+ * @param string $def default
* @return Array
*/
function wfAcceptToPrefs( $accept, $def = '*/*' ) {
* array of type to preference (preference is a float between 0.0 and 1.0).
* Wildcards in the types are acceptable.
*
- * @param $cprefs Array: client's acceptable type list
- * @param $sprefs Array: server's offered types
+ * @param array $cprefs client's acceptable type list
+ * @param array $sprefs server's offered types
* @return string
*
* @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
/**
* Make directory, and make all parent directories if they don't exist
*
- * @param $dir String: full path to directory to create
+ * @param string $dir full path to directory to create
* @param $mode Integer: chmod value to use, default is $wgDirectoryMode
- * @param $caller String: optional caller param for debugging.
+ * @param string $caller optional caller param for debugging.
* @throws MWException
* @return bool
*/
* Wrapper function for PHP's dl(). This doesn't work in most situations from
* PHP 5.3 onward, and is usually disabled in shared environments anyway.
*
- * @param $extension String A PHP extension. The file suffix (.so or .dll)
+ * @param string $extension A PHP extension. The file suffix (.so or .dll)
* should be omitted
- * @param $fileName String Name of the library, if not $extension.suffix
+ * @param string $fileName Name of the library, if not $extension.suffix
* @return Bool - Whether or not the extension is loaded
*/
function wfDl( $extension, $fileName = null ) {
/**
* Execute a shell command, with time and memory limits mirrored from the PHP
* configuration if supported.
- * @param $cmd String Command line, properly escaped for shell.
+ * @param string $cmd Command line, properly escaped for shell.
* @param &$retval null|Mixed optional, will receive the program's exit code.
* (non-zero is usually failure)
- * @param $environ Array optional environment variables which should be
+ * @param array $environ optional environment variables which should be
* added to the executed command environment.
- * @param $limits Array optional array with limits(filesize, memory, time, walltime)
+ * @param array $limits optional array with limits(filesize, memory, time, walltime)
* this overwrites the global wgShellMax* limits.
* @return string collected stdout as a string (trailing newlines stripped)
*/
* Generate a shell-escaped command line string to run a MediaWiki cli script.
* Note that $parameters should be a flat array and an option with an argument
* should consist of two consecutive items in the array (do not use "--option value").
- * @param $script string MediaWiki cli script path
- * @param $parameters Array Arguments and options to the script
- * @param $options Array Associative array of options:
+ * @param string $script MediaWiki cli script path
+ * @param array $parameters Arguments and options to the script
+ * @param array $options Associative array of options:
* 'php': The path to the php executable
* 'wrapper': Path to a PHP wrapper to handle the maintenance script
* @return Array
* Returns unified plain-text diff of two texts.
* Useful for machine processing of diffs.
*
- * @param $before String: the text before the changes.
- * @param $after String: the text after the changes.
- * @param $params String: command-line options for the diff command.
+ * @param string $before the text before the changes.
+ * @param string $after the text after the changes.
+ * @param string $params command-line options for the diff command.
* @return String: unified diff of $before and $after
*/
function wfDiff( $before, $after, $params = '-u' ) {
* We'll consider it so always, as we don't want '\s' in our Unix paths either.
*
* @param $path String
- * @param $suffix String: to remove if present
+ * @param string $suffix to remove if present
* @return String
*/
function wfBaseName( $path, $suffix = '' ) {
* May explode on non-matching case-insensitive paths,
* funky symlinks, etc.
*
- * @param $path String: absolute destination path including target filename
- * @param $from String: Absolute source path, directory only
+ * @param string $path absolute destination path including target filename
+ * @param string $from Absolute source path, directory only
* @return String
*/
function wfRelativePath( $path, $from ) {
* Create an object with a given name and an array of construct parameters
*
* @param $name String
- * @param $p Array: parameters
+ * @param array $p parameters
* @return object
* @deprecated since 1.18, warnings in 1.18, removal in 1.20
*/
* belongs to. May contain a single string if the query is only
* in one group.
*
- * @param $wiki String: the wiki ID, or false for the current wiki
+ * @param string $wiki the wiki ID, or false for the current wiki
*
* Note: multiple calls to wfGetDB(DB_SLAVE) during the course of one request
* will always return the same object, unless the underlying connection or load
/**
* Get a load balancer object.
*
- * @param $wiki String: wiki ID, or false for the current wiki
+ * @param string $wiki wiki ID, or false for the current wiki
* @return LoadBalancer
*/
function wfGetLB( $wiki = false ) {
* Find a file.
* Shortcut for RepoGroup::singleton()->findFile()
*
- * @param $title String or Title object
- * @param $options array Associative array of options:
+ * @param string $title 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
* created at the specified time.
* extensions; this is a wrapper around $wgScriptExtension etc.
* except for 'index' and 'load' which use $wgScript/$wgLoadScript
*
- * @param $script String: script filename, sans extension
+ * @param string $script script filename, sans extension
* @return String
*/
function wfScript( $script = 'index' ) {
* Get the normalised IETF language tag
* See unit test for examples.
*
- * @param $code String: The language code.
+ * @param string $code The language code.
* @return String: The language code which complying with BCP 47 standards.
*/
function wfBCP47( $code ) {
/**
* Call hook functions defined in $wgHooks
*
- * @param $event String: event name
- * @param $args Array: parameters passed to hook functions
+ * @param string $event event name
+ * @param array $args parameters passed to hook functions
* @return Boolean True if no handler aborted the hook
*/
function wfRunHooks( $event, $args = array() ) {
/**
* Wrapper around php's unpack.
*
- * @param $format String: The format string (See php's docs)
+ * @param string $format The format string (See php's docs)
* @param $data: A binary string of binary data
* @param $length integer or false: The minimun length of $data. This is to
* prevent reading beyond the end of $data. false to disable the check.
* * Any subsequent links on the same line are considered to be exceptions,
* i.e. articles where the image may occur inline.
*
- * @param $name string the image name to check
+ * @param string $name the image name to check
* @param $contextTitle Title|bool the page on which the image occurs, if known
- * @param $blacklist string wikitext of a file blacklist
+ * @param string $blacklist wikitext of a file blacklist
* @return bool
*/
function wfIsBadImage( $name, $contextTitle = false, $blacklist = null ) {
/**
* Build a new HTMLForm from an array of field attributes
- * @param $descriptor Array of Field constructs, as described above
+ * @param array $descriptor of Field constructs, as described above
* @param $context IContextSource available since 1.18, will become compulsory in 1.18.
* Obviates the need to call $form->setTitle()
- * @param $messagePrefix String a prefix to go in front of default messages
+ * @param string $messagePrefix a prefix to go in front of default messages
*/
public function __construct( $descriptor, /*IContextSource*/ $context = null, $messagePrefix = '' ) {
if ( $context instanceof IContextSource ) {
/**
* Set format in which to display the form
- * @param $format String the name of the format to use, must be one of
+ * @param string $format the name of the format to use, must be one of
* $this->availableDisplayFormats
* @throws MWException
* @since 1.20
/**
* Initialise a new Object for the field
* @param $fieldname string
- * @param $descriptor string input Descriptor, as described above
+ * @param string $descriptor input Descriptor, as described above
* @throws MWException
* @return HTMLFormField subclass
*/
/**
* Set a callback to a function to do something with the form
* once it's been successfully validated.
- * @param $cb String function name. The function will be passed
+ * @param string $cb function name. The function will be passed
* the output from HTMLForm::filterDataForSubmit, and must
* return Bool true on success, Bool false if no submission
* was attempted, or String HTML output to display on error.
/**
* Set the introductory message, overwriting any existing message.
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function setIntro( $msg ) {
/**
* Set the introductory message, overwriting any existing message.
* @since 1.19
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function setPreText( $msg ) {
/**
* Add introductory text.
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function addPreText( $msg ) {
/**
* Add header text, inside the form.
- * @param $msg String complete text of message to display
- * @param $section string The section to add the header to
+ * @param string $msg complete text of message to display
+ * @param string $section The section to add the header to
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function addHeaderText( $msg, $section = null ) {
/**
* Set header text, inside the form.
* @since 1.19
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @param $section The section to add the header to
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add footer text, inside the form.
- * @param $msg String complete text of message to display
- * @param $section string The section to add the footer text to
+ * @param string $msg complete text of message to display
+ * @param string $section The section to add the footer text to
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function addFooterText( $msg, $section = null ) {
/**
* Set footer text, inside the form.
* @since 1.19
- * @param $msg String complete text of message to display
- * @param $section string The section to add the footer text to
+ * @param string $msg complete text of message to display
+ * @param string $section The section to add the footer text to
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function setFooterText( $msg, $section = null ) {
/**
* Add text to the end of the display.
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function addPostText( $msg ) {
/**
* Set text at the end of the display.
- * @param $msg String complete text of message to display
+ * @param string $msg complete text of message to display
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function setPostText( $msg ) {
/**
* Add a hidden field to the output
- * @param $name String field name. This will be used exactly as entered
- * @param $value String field value
+ * @param string $name field name. This will be used exactly as entered
+ * @param string $value field value
* @param $attribs Array
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Add a button to the form
- * @param $name String field name.
- * @param $value String field value
- * @param $id String DOM id for the button (default: null)
+ * @param string $name field name.
+ * @param string $value field value
+ * @param string $id DOM id for the button (default: null)
* @param $attribs Array
* @return HTMLForm $this for chaining calls (since 1.20)
*/
/**
* Wrap the form innards in an actual "<form>" element
- * @param $html String HTML contents to wrap.
+ * @param string $html HTML contents to wrap.
* @return String wrapped HTML.
*/
function wrapForm( $html ) {
/**
* Format a stack of error messages into a single HTML string
- * @param $errors Array of message keys/values
+ * @param array $errors of message keys/values
* @return String HTML, a "<ul>" list of errors
*/
public static function formatErrors( $errors ) {
/**
* Set the text for the submit button
- * @param $t String plaintext.
+ * @param string $t plaintext.
* @return HTMLForm $this for chaining calls (since 1.20)
*/
function setSubmitText( $t ) {
/**
* Set the text for the submit button to a message
* @since 1.19
- * @param $msg String message key
+ * @param string $msg message key
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function setSubmitTextMsg( $msg ) {
}
/**
- * @param $name String Submit button name
+ * @param string $name Submit button name
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function setSubmitName( $name ) {
}
/**
- * @param $name String Tooltip for the submit button
+ * @param string $name Tooltip for the submit button
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function setSubmitTooltip( $name ) {
}
/**
- * @param $id String DOM id for the form
+ * @param string $id DOM id for the form
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function setId( $id ) {
/**
* Prompt the whole form to be wrapped in a "<fieldset>", with
* this text as its "<legend>" element.
- * @param $legend String HTML to go inside the "<legend>" element.
+ * @param string $legend HTML to go inside the "<legend>" element.
* Will be escaped
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* Prompt the whole form to be wrapped in a "<fieldset>", with
* this message as its "<legend>" element.
* @since 1.19
- * @param $msg String message key
+ * @param string $msg message key
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function setWrapperLegendMsg( $msg ) {
/**
* @todo Document
* @param $fields array[]|HTMLFormField[] array of fields (either arrays or objects)
- * @param $sectionName string ID attribute of the "<table>" tag for this section, ignored if empty
- * @param $fieldsetIDPrefix string ID prefix for the "<fieldset>" tag of each subsection, ignored if empty
+ * @param string $sectionName ID attribute of the "<table>" tag for this section, ignored if empty
+ * @param string $fieldsetIDPrefix ID prefix for the "<fieldset>" tag of each subsection, ignored if empty
* @return String
*/
public function displaySection( $fields, $sectionName = '', $fieldsetIDPrefix = '' ) {
/**
* Stop a reset button being shown for this form
- * @param $suppressReset Bool set to false to re-enable the
+ * @param bool $suppressReset set to false to re-enable the
* button again
* @return HTMLForm $this for chaining calls (since 1.20)
*/
* This function must be implemented to return the HTML to generate
* the input object itself. It should not implement the surrounding
* table cells/rows, or labels/help messages.
- * @param $value String the value to set the input to; eg a default
+ * @param string $value the value to set the input to; eg a default
* text for a text input.
* @return String valid HTML.
*/
* Override this function to add specific validation checks on the
* field input. Don't forget to call parent::validate() to ensure
* that the user-defined callback mValidationCallback is still run
- * @param $value String the value the field was submitted with
- * @param $alldata Array the data collected from the form
+ * @param string $value the value the field was submitted with
+ * @param array $alldata the data collected from the form
* @return Mixed Bool true on success, or String error to display.
*/
function validate( $value, $alldata ) {
/**
* Initialise the object
- * @param $params array Associative Array. See HTMLForm doc for syntax.
+ * @param array $params Associative Array. See HTMLForm doc for syntax.
* @throws MWException
*/
function __construct( $params ) {
/**
* Get the complete table row for the input, including help text,
* labels, and whatever.
- * @param $value String the value to set the input to.
+ * @param string $value the value to set the input to.
* @return String complete HTML table row.
*/
function getTableRow( $value ) {
* Get the complete div for the input, including help text,
* labels, and whatever.
* @since 1.20
- * @param $value String the value to set the input to.
+ * @param string $value the value to set the input to.
* @return String complete HTML table row.
*/
public function getDiv( $value ) {
* Get the complete raw fields for the input, including help text,
* labels, and whatever.
* @since 1.20
- * @param $value String the value to set the input to.
+ * @param string $value the value to set the input to.
* @return String complete HTML table row.
*/
public function getRaw( $value ) {
/**
* Determine form errors to display and their classes
* @since 1.20
- * @param $value String the value of the input
+ * @param string $value the value of the input
* @return Array
*/
public function getErrorsAndErrorClass( $value ) {
/**
* flatten an array of options to a single array, for instance,
* a set of "<options>" inside "<optgroups>".
- * @param $options array Associative Array with values either Strings
+ * @param array $options Associative Array with values either Strings
* or Arrays
* @return Array flattened input
*/
* The value of each option is a combination of the row tag and column tag.
* mParams['rows'] is an array with row labels as keys and row tags as values.
* mParams['columns'] is an array with column labels as keys and column tags as values.
- * @param $value Array of the options that should be checked
+ * @param array $value of the options that should be checked
* @return String
*/
function getInputHTML( $value ) {
* We override this function since the label should always be on a separate
* line above the options in the case of a checkbox matrix, i.e. it's always
* a "vertical-label".
- * @param $value String the value to set the input to
+ * @param string $value the value to set the input to
* @return String complete HTML table row
*/
function getTableRow( $value ) {
/**
* Build a drop-down box from a textual list.
- * @param $string String message text
- * @param $otherName String name of "other reason" option
+ * @param string $string message text
+ * @param string $otherName name of "other reason" option
* @return Array
* TODO: this is copied from Xml::listDropDown(), deprecate/avoid duplication?
*/
var $mOldId, $mHash, $mRef;
/**
- * @param $hash string the content hash of the text
+ * @param string $hash the content hash of the text
* @param $oldid Integer the old_id for the CGZ object
*/
function __construct( $hash = '', $oldid = 0 ) {
*
* @since 1.21
*
- * @param $name String: the name of the hook to clear.
+ * @param string $name the name of the hook to clear.
*
* @throws MWException if not in testing mode.
*/
*
* @since 1.18
*
- * @param $name String: name of hook
+ * @param string $name name of hook
* @param $callback Mixed: callback function to attach
*/
public static function register( $name, $callback ) {
*
* @since 1.18
*
- * @param $name String: name of hook
+ * @param string $name name of hook
* @return Boolean: true if the hook has a function registered to it
*/
public static function isRegistered( $name ) {
*
* @throws MWException
* @throws FatalError
- * @param $name String: name of the hook
+ * @param string $name name of the hook
*
* @return array
*/
/**
* Call hook functions defined in Hooks::register
*
- * @param $event String: event name
+ * @param string $event event name
* @param $args Array: parameters passed to hook functions
*
* @throws MWException
*
* @since 1.18
*
- * @param $errno int Unused
- * @param $errstr String: error message
+ * @param int $errno Unused
+ * @param string $errstr error message
* @throws MWHookException
* @return Boolean: false
*/
* content model. If $wgWellFormedXml is false, then a few bytes will be
* shaved off the HTML output as well.
*
- * @param $element string The element's name, e.g., 'a'
- * @param $attribs array Associative array of attributes, e.g., array(
+ * @param string $element The element's name, e.g., 'a'
+ * @param array $attribs Associative array of attributes, e.g., array(
* 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
* further documentation.
- * @param $contents string The raw HTML contents of the element: *not*
+ * @param string $contents The raw HTML contents of the element: *not*
* escaped!
* @return string Raw HTML
*/
* it returns the empty string when that's guaranteed to be safe.
*
* @since 1.17
- * @param $element string Name of the element, e.g., 'a'
+ * @param string $element Name of the element, e.g., 'a'
* @return string A closing tag, if required
*/
public static function closeElement( $element ) {
* only guarantees that the output array should be functionally identical
* to the input array (currently per the HTML 5 draft as of 2009-09-06).
*
- * @param $element string Name of the element, e.g., 'a'
- * @param $attribs array Associative array of attributes, e.g., array(
+ * @param string $element Name of the element, e.g., 'a'
+ * @param array $attribs Associative array of attributes, e.g., array(
* 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for
* further documentation.
* @return array An array of attributes functionally identical to $attribs
* // gives '<em class="bar quux"></em>'
* @endcode
*
- * @param $attribs array Associative array of attributes, e.g., array(
+ * @param array $attribs Associative array of attributes, e.g., array(
* 'href' => 'http://www.mediawiki.org/' ). Values will be HTML-escaped.
* A value of false means to omit the attribute. For boolean attributes,
* you can omit the key, e.g., array( 'checked' ) instead of
* @todo do some useful escaping as well, like if $contents contains
* literal "</script>" or (for XML) literal "]]>".
*
- * @param $contents string JavaScript
+ * @param string $contents JavaScript
* @return string Raw HTML
*/
public static function inlineScript( $contents ) {
* (if any). TODO: do some useful escaping as well, like if $contents
* contains literal "</style>" (admittedly unlikely).
*
- * @param $contents string CSS
+ * @param string $contents CSS
* @param $media mixed A media type string, like 'screen'
* @return string Raw HTML
*/
* @param $name string name attribute
* @param $value mixed value attribute
* @param $type string type attribute
- * @param $attribs array Associative array of miscellaneous extra
+ * @param array $attribs Associative array of miscellaneous extra
* attributes, passed to Html::element()
* @return string Raw HTML
*/
*
* @param $name string name attribute
* @param $value string value attribute
- * @param $attribs array Associative array of miscellaneous extra
+ * @param array $attribs Associative array of miscellaneous extra
* attributes, passed to Html::element()
* @return string Raw HTML
*/
*
* @param $name string name attribute
* @param $value string value attribute
- * @param $attribs array Associative array of miscellaneous extra
+ * @param array $attribs Associative array of miscellaneous extra
* attributes, passed to Html::element()
* @return string Raw HTML
*/
* - label: text for label to add before the field
* - exclude: [optional] Array of namespace ids to exclude
* - disable: [optional] Array of namespace ids for which the option should be disabled in the selector
- * @param $selectAttribs array HTML attributes for the generated select element.
+ * @param array $selectAttribs HTML attributes for the generated select element.
* - id: [optional], default: 'namespace'
* - name: [optional], default: 'namespace'
* @return string HTML code to select a namespace.
* Constructs the opening html-tag with necessary doctypes depending on
* global variables.
*
- * @param $attribs array 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
*/
/**
* Get HTML for an info box with an icon.
*
- * @param $text String: wikitext, get this with wfMessage()->plain()
- * @param $icon String: icon name, file in skins/common/images
- * @param $alt String: alternate text for the icon
- * @param $class String: additional class name to add to the wrapper div
+ * @param string $text wikitext, get this with wfMessage()->plain()
+ * @param string $icon icon name, file in skins/common/images
+ * @param string $alt alternate text for the icon
+ * @param string $class additional class name to add to the wrapper div
* @param $useStylePath
*
* @return string
/**
* Perform an HTTP request
*
- * @param $method String: HTTP method. Usually GET/POST
- * @param $url String: full URL to act on. If protocol-relative, will be expanded to an http:// URL
- * @param $options Array: options to pass to MWHttpRequest object.
+ * @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.
* Possible keys for the array:
* - timeout Timeout length in seconds
* - postData An array of key-value pairs or a url-encoded form data
/**
* Check if the URL can be served by localhost
*
- * @param $url String: full url to check
+ * @param string $url full url to check
* @return Boolean
*/
public static function isLocalURL( $url ) {
public $status;
/**
- * @param $url String: url to use. If protocol-relative, will be expanded to an http:// URL
- * @param $options Array: (optional) extra params to pass (see Http::request())
+ * @param string $url url to use. If protocol-relative, will be expanded to an http:// URL
+ * @param array $options (optional) extra params to pass (see Http::request())
*/
protected function __construct( $url, $options = array() ) {
global $wgHTTPTimeout;
/**
* Generate a new request object
- * @param $url String: url to use
- * @param $options Array: (optional) extra params to pass (see Http::request())
+ * @param string $url url to use
+ * @param array $options (optional) extra params to pass (see Http::request())
* @throws MWException
* @return CurlHttpRequest|PhpHttpRequest
* @see MWHttpRequest::__construct
* SIIT IPv4-translated addresses are rejected.
* Note: canonicalize() tries to convert translated addresses to IPv4.
*
- * @param $ip String: possible IP address
+ * @param string $ip possible IP address
* @return Boolean
*/
public static function isIPAddress( $ip ) {
* Given a string, determine if it as valid IP in IPv6 only.
* Note: Unlike isValid(), this looks for networks too.
*
- * @param $ip String: possible IP address
+ * @param string $ip possible IP address
* @return Boolean
*/
public static function isIPv6( $ip ) {
* Given a string, determine if it as valid IP in IPv4 only.
* Note: Unlike isValid(), this looks for networks too.
*
- * @param $ip String: possible IP address
+ * @param string $ip possible IP address
* @return Boolean
*/
public static function isIPv4( $ip ) {
* IPv6 addresses in octet notation are expanded to 8 words.
* IPv4 addresses are just trimmed.
*
- * @param $ip String: IP address in quad or octet form (CIDR or not).
+ * @param string $ip IP address in quad or octet form (CIDR or not).
* @return String
*/
public static function sanitizeIP( $ip ) {
*
* A bare IPv6 address is accepted despite the lack of square brackets.
*
- * @param $both string The string with the host and port
+ * @param string $both The string with the host and port
* @return array
*/
public static function splitHostAndPort( $both ) {
/**
* Convert an IPv4 or IPv6 hexadecimal representation back to readable format
*
- * @param $hex String: number, with "v6-" prefix if it is IPv6
+ * @param string $hex number, with "v6-" prefix if it is IPv6
* @return String: quad-dotted (IPv4) or octet notation (IPv6)
*/
public static function formatHex( $hex ) {
* function for an IPv6 address will be prefixed with "v6-", a non-
* hexadecimal string which sorts after the IPv4 addresses.
*
- * @param $ip String: quad dotted/octet IP address.
+ * @param string $ip quad dotted/octet IP address.
* @return String
*/
public static function toHex( $ip ) {
/**
* Given an IPv6 address in octet notation, returns a pure hex string.
*
- * @param $ip String: octet ipv6 IP address.
+ * @param string $ip octet ipv6 IP address.
* @return String: pure hex (uppercase)
*/
private static function IPv6ToRawHex( $ip ) {
* Like ip2long() except that it actually works and has a consistent error return value.
* Comes from ProxyTools.php
*
- * @param $ip String: quad dotted IP address.
+ * @param string $ip quad dotted IP address.
* @return Mixed: string/int/false
*/
public static function toUnsigned( $ip ) {
* Convert a network specification in CIDR notation
* to an integer network and a number of bits
*
- * @param $range String: IP with CIDR prefix
+ * @param string $range IP with CIDR prefix
* @return array(int or string, int)
*/
public static function parseCIDR( $range ) {
* 2001:0db8:85a3::7344/96 CIDR
* 2001:0db8:85a3::7344 - 2001:0db8:85a3::7344 Explicit range
* 2001:0db8:85a3::7344 Single IP
- * @param $range String: IP range
+ * @param string $range IP range
* @return array(string, string)
*/
public static function parseRange( $range ) {
/**
* Determine if a given IPv4/IPv6 address is in a given CIDR network
*
- * @param $addr String: the address to check against the given range.
- * @param $range String: the range to check the given address against.
+ * @param string $addr the address to check against the given range.
+ * @param string $range the range to check the given address against.
* @return Boolean: whether or not the given address is in the given range.
*/
public static function isInRange( $addr, $range ) {
* This currently only checks a few IPV4-to-IPv6 related cases. More
* unusual representations may be added later.
*
- * @param $addr String: something that might be an IP address
+ * @param string $addr something that might be an IP address
* @return String: valid dotted quad IPv4 address or null
*/
public static function canonicalize( $addr ) {
/**
* Gets rid of uneeded numbers in quad-dotted/octet IP strings
* For example, 127.111.113.151/24 -> 127.111.113.0/24
- * @param $range String: IP address to normalize
+ * @param string $range IP address to normalize
* @return string
*/
public static function sanitizeRange( $range ) {
/**
* Set the caption (as plain text)
*
- * @param $caption string Caption
+ * @param string $caption Caption
*/
function setCaption( $caption ) {
$this->mCaption = htmlspecialchars( $caption );
/**
* Set the caption (as HTML)
*
- * @param $caption String: Caption
+ * @param string $caption Caption
*/
public function setCaptionHtml( $caption ) {
$this->mCaption = $caption;
* Note -- if taking from user input, you should probably run through
* Sanitizer::validateAttributes() first.
*
- * @param $attribs Array of HTML attribute pairs
+ * @param array $attribs of HTML attribute pairs
*/
function setAttributes( $attribs ) {
$this->mAttribs = $attribs;
/**
* Constructor from a page id
- * @param $id Int article ID to load
+ * @param int $id article ID to load
* @return ImagePage|null
*/
public static function newFromID( $id ) {
*
* @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata().
*
- * @param $metadata Array: the array containing the EXIF data
+ * @param array $metadata the array containing the EXIF data
* @return String The metadata table. This is treated as Wikitext (!)
*/
protected function makeMetadataTable( $metadata ) {
/**
* Creates an thumbnail of specified size and returns an HTML link to it
- * @param $params array Scaler parameters
+ * @param array $params Scaler parameters
* @param $width int
* @param $height int
* @return string
* Returns the corrosponding $wgImageLimits entry for the selected user option
*
* @param $user User
- * @param $optionName string Name of a option to check, typically imagesize or thumbsize
+ * @param string $optionName Name of a option to check, typically imagesize or thumbsize
* @return array
* @since 1.21
*/
* @param $title Title
* @param $origTitle Title
* @param $revCount Integer
- * @param $sucCount Int: number of revisions for which callback returned true
- * @param $pageInfo Array: associative array of page information
+ * @param int $sucCount number of revisions for which callback returned true
+ * @param array $pageInfo associative array of page information
*/
private function pageOutCallback( $title, $origTitle, $revCount, $sucCount, $pageInfo ) {
if( isset( $this->mPageOutCallback ) ) {
*
* require( MWInit::extSetupPath( 'ParserFunctions/ParserFunctions.php' ) );
*
- * @param $extRel string The path relative to the extensions directory, as defined by
+ * @param string $extRel The path relative to the extensions directory, as defined by
* $wgExtensionsDirectory.
*
* @return string
/**
* Constructor
*
- * @param $str String: license name??
+ * @param string $str license name??
*/
function __construct( $str ) {
list( $text, $template ) = explode( '|', strrev( $str ), 2 );
* Check whether $content contains a link to $filterEntry
*
* @param $content Content: content to check
- * @param $filterEntry String: domainparts, see makeRegex() for more details
+ * @param string $filterEntry domainparts, see makeRegex() for more details
* @return Integer: 0 if no match or 1 if there's at least one match
*/
static function matchEntry( Content $content, $filterEntry ) {
/**
* Builds a regex pattern for $filterEntry.
*
- * @param $filterEntry String: URL, if it begins with "*.", it'll be
+ * @param string $filterEntry URL, if it begins with "*.", it'll be
* replaced to match any subdomain
* @return String: regex pattern, for preg_match()
*/
*
* Asterisks in any other location are considered invalid.
*
- * @param $filterEntry String: domainparts
+ * @param string $filterEntry domainparts
* @param $prot String: protocol
* @return Array to be passed to DatabaseBase::buildLike() or false on error
*/
/**
* Filters an array returned by makeLikeArray(), removing everything past first pattern placeholder.
*
- * @param $arr array: array to filter
+ * @param array $arr array to filter
* @return array filtered array
*/
public static function keepOneWildcard( $arr ) {
* Get the appropriate HTML attributes to add to the "a" element of an ex-
* ternal link, as created by [wikisyntax].
*
- * @param $class String: the contents of the class attribute; if an empty
+ * @param string $class the contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
* @return string
* @deprecated since 1.18 Just pass the external class directly to something using Html::expandAttributes
* Get the appropriate HTML attributes to add to the "a" element of an in-
* terwiki link.
*
- * @param $title String: the title text for the link, URL-encoded (???) but
+ * @param string $title the title text for the link, URL-encoded (???) but
* not HTML-escaped
- * @param $unused String: unused
- * @param $class String: the contents of the class attribute; if an empty
+ * @param string $unused unused
+ * @param string $class the contents of the class attribute; if an empty
* string is passed, which is the default value, defaults to 'external'.
* @return string
*/
* Get the appropriate HTML attributes to add to the "a" element of an in-
* ternal link.
*
- * @param $title String: the title text for the link, URL-encoded (???) but
+ * @param string $title the title text for the link, URL-encoded (???) but
* not HTML-escaped
- * @param $unused String: unused
- * @param $class String: the contents of the class attribute, default none
+ * @param string $unused unused
+ * @param string $class the contents of the class attribute, default none
* @return string
*/
static function getInternalLinkAttributes( $title, $unused = null, $class = '' ) {
* ternal link, given the Title object for the page we want to link to.
*
* @param $nt Title
- * @param $unused String: unused
- * @param $class String: the contents of the class attribute, default none
+ * @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
* attribute; if false, default to the name of the page we're linking to
* @return string
* 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 $customAttribs array A key => value array of extra HTML attri-
+ * @param array $customAttribs A key => value array of extra HTML attri-
* butes, 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.
* @param $query array 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 $options string|array 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",
* Returns the Url used to link to a Title
*
* @param $target Title
- * @param $query Array: query parameters
+ * @param array $query query parameters
* @param $options Array
* @return String
*/
* despite $query not being used.
*
* @param $nt Title
- * @param $html String [optional]
- * @param $query String [optional]
- * @param $trail String [optional]
- * @param $prefix String [optional]
+ * @param string $html [optional]
+ * @param string $query [optional]
+ * @param string $trail [optional]
+ * @param string $prefix [optional]
*
*
* @return string
* a value indicating that the title object is invalid.
*
* @param $context IContextSource context to use to get the messages
- * @param $namespace int Namespace number
- * @param $title string Text of the title, without the namespace part
+ * @param int $namespace Namespace number
+ * @param string $title Text of the title, without the namespace part
* @return string
*/
public static function getInvalidTitleDescription( IContextSource $context, $namespace, $title ) {
* @param $parser Parser object
* @param $title Title object of the file (not the currently viewed page)
* @param $file File object, or false if it doesn't exist
- * @param $frameParams Array: associative array of parameters external to the media handler.
+ * @param array $frameParams associative array of parameters external to the media handler.
* Boolean parameters are indicated by presence or absence, the value is arbitrary and
* will often be false.
* thumbnail If present, downscale and frame
* link-target Value for the target attribue, only with link-url
* no-link Boolean, suppress description link
*
- * @param $handlerParams Array: 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 $time String: timestamp of the file, set as false for current
- * @param $query String: query params for desc url
+ * @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
* @since 1.20
* @return String: HTML for an image, with links, wrappers, etc.
/**
* Get the link parameters for MediaTransformOutput::toHtml() from given
* frame parameters supplied by the Parser.
- * @param $frameParams array The frame parameters
- * @param $query string An optional query string to add to description page links
+ * @param array $frameParams The frame parameters
+ * @param string $query An optional query string to add to description page links
* @return array
*/
private static function getImageLinkMTOParams( $frameParams, $query = '', $parser = null ) {
* Make a "broken" link to an image
*
* @param $title Title object
- * @param $label String: link label (plain text)
- * @param $query String: query string
+ * @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
* Get the URL to upload a certain file
*
* @param $destFile Title object of the file to upload
- * @param $query String: urlencoded query string to prepend
+ * @param string $query urlencoded query string to prepend
* @return String: urlencoded URL
*/
protected static function getUploadUrl( $destFile, $query = '' ) {
* Create a direct link to a given uploaded file.
*
* @param $title Title object.
- * @param $html String: pre-sanitized HTML
- * @param $time string: MW timestamp of file creation time
+ * @param string $html pre-sanitized HTML
+ * @param string $time MW timestamp of file creation time
* @return String: HTML
*/
public static function makeMediaLinkObj( $title, $html = '', $time = false ) {
*
* @param $title Title object.
* @param $file File|bool mixed File object or false
- * @param $html String: pre-sanitized HTML
+ * @param string $html pre-sanitized HTML
* @return String: HTML
*
* @todo Handle invalid or missing images better.
/**
* Make an external link
- * @param $url String: URL to link to
- * @param $text String: text of link
+ * @param string $url URL to link to
+ * @param string $text text of link
* @param $escape Boolean: do we escape the link text?
- * @param $linktype String: type of external link. Gets added to the classes
- * @param $attribs Array of extra attributes to <a>
+ * @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
* @return string
*/
/**
* Make user link (or user contributions for unregistered users)
* @param $userId Integer: user id in database.
- * @param $userName String: user name in database.
- * @param $altUserName String: text to display instead of the user name (optional)
+ * @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.
*/
* Generate standard user tool links (talk, contributions, block link, etc.)
*
* @param $userId Integer: user identifier
- * @param $userText String: user name or IP address
+ * @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)
/**
* Alias for userToolLinks( $userId, $userText, true );
* @param $userId Integer: user identifier
- * @param $userText String: user name or IP address
+ * @param string $userText user name or IP address
* @param $edits Integer: user edit count (optional, for performance)
* @return String
*/
/**
* @param $userId Integer: user id in database.
- * @param $userText String: user name in database.
+ * @param string $userText user name in database.
* @return String: HTML fragment with user talk link
*/
public static function userTalkLink( $userId, $userText ) {
/**
* @param $userId Integer: userid
- * @param $userText String: user name in database.
+ * @param string $userText user name in database.
* @return String: HTML fragment with block link
*/
public static function blockLink( $userId, $userText ) {
/**
* @param $userId Integer: userid
- * @param $userText String: user name in database.
+ * @param string $userText user name in database.
* @return String: HTML fragment with e-mail user link
*/
public static function emailLink( $userId, $userText ) {
* add a separator where needed and format the comment itself with CSS
* Called by Linker::formatComment.
*
- * @param $comment String: comment text
+ * @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
* is ignored
*
* @todo FIXME: Doesn't handle sub-links as in image thumb texts like the main parser
- * @param $comment String: text to format links in
+ * @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
/**
* Wraps the TOC in a table and provides the hide/collapse javascript.
*
- * @param $toc String: html of the Table Of Contents
+ * @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
*/
* Generate a table of contents from a section tree
* Currently unused.
*
- * @param $tree array Return value of ParserOutput::getSections()
+ * @param array $tree Return value of ParserOutput::getSections()
* @return String: HTML fragment
*/
public static function generateTOC( $tree ) {
* Create a headline for content
*
* @param $level Integer: the level of the headline (1-6)
- * @param $attribs String: any attributes for the headline, starting with
+ * @param string $attribs any attributes for the headline, starting with
* a space and ending with '>'
* This *must* be at least '>' for no attribs
- * @param $anchor String: the anchor to give the headline (the bit after the #)
- * @param $html String: html for the text of the header
- * @param $link String: HTML to add for the section edit link
+ * @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
* backward compatibility (false to omit)
*
* is set and the user is the only contributor of the page.
*
* @param $rev Revision object
- * @param $verify Bool Try to verfiy that this revision can really be rolled back
+ * @param bool $verify Try to verfiy that this revision can really be rolled back
* @return integer|bool|null
*/
public static function getRollbackEditCount( $rev, $verify ) {
/**
* Returns HTML for the "hidden categories on this page" list.
*
- * @param $hiddencats Array of hidden categories from Article::getHiddenCategories
+ * @param array $hiddencats of hidden categories from Article::getHiddenCategories
* or similar
* @return String: HTML output
*/
* Format a size in bytes for output, using an appropriate
* unit (B, KB, MB or GB) according to the magnitude in question
*
- * @param $size int Size to format
+ * @param int $size Size to format
* @return String
*/
public static function formatSize( $size ) {
* isn't always, because sometimes the accesskey needs to go on a different
* element than the id, for reverse-compatibility, etc.)
*
- * @param $name String: id of the element, minus prefixes.
+ * @param string $name id of the element, minus prefixes.
* @param $options Mixed: null or the string 'withaccess' to add an access-
* key hint
* @return String: contents of the title attribute (which you must HTML-
* 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 $name String: id of the element, minus prefixes.
+ * @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
*/
/**
* Creates a (show/hide) link for deleting revisions/log entries
*
- * @param $query Array: query parameters to be passed to link()
+ * @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)
*
* This function is a shortcut to makeBrokenLinkObj(Title::newFromText($title),...). Do not call
* it if you already have a title object handy. See makeBrokenLinkObj for further documentation.
*
- * @param $title String: The text of the title
- * @param $text String: Link text
- * @param $query String: Optional query part
- * @param $trail String: Optional trail. Alphabetic characters at the start of this string will
+ * @param string $title The text of the title
+ * @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.
* @return string
* @param $nt Title: the title object to make the link from, e.g. from
* Title::newFromText.
* @param $text String: link text
- * @param $query String: optional query part
- * @param $trail String: optional trail. Alphabetic characters at the start of this string will
+ * @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.
- * @param $prefix String: optional prefix. As trail, only before instead of after.
+ * @param string $prefix optional prefix. As trail, only before instead of after.
* @return string
*/
static function makeLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
* @param $text String: text to replace the title
* @param $query String: link target
* @param $trail String: text after link
- * @param $prefix String: text before link text
- * @param $aprops String: extra attributes to the a-element
+ * @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 object of the target page
* @param $text String: Link text
- * @param $query String: Optional query part
- * @param $trail String: Optional trail. Alphabetic characters at the start of this string will
+ * @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.
- * @param $prefix String: Optional prefix
+ * @param string $prefix Optional prefix
* @return string
*/
static function makeBrokenLinkObj( $title, $text = '', $query = '', $trail = '', $prefix = '' ) {
* @param $trail String: 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.
- * @param $prefix String: Optional prefix
+ * @param string $prefix Optional prefix
* @return string
*/
static function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
* Use PHP's magic __call handler to transform instance calls to a dummy instance
* into static calls to the new Linker for backwards compatibility.
*
- * @param $fname String Name of called method
- * @param $args Array Arguments to the method
+ * @param string $fname Name of called method
+ * @param array $args Arguments to the method
* @return mixed
*/
public function __call( $fname, $args ) {
/**
* Update all the appropriate counts in the category table.
- * @param $added array associative array of category name => sort key
- * @param $deleted array associative array of category name => sort key
+ * @param array $added associative array of category name => sort key
+ * @param array $deleted associative array of category name => sort key
*/
function updateCategoryCounts( $added, $deleted ) {
$a = WikiPage::factory( $this->mTitle );
/**
* Get an array of category insertions
*
- * @param $existing array mapping existing category names to sort keys. If both
+ * @param array $existing mapping existing category names to sort keys. If both
* match a link in $this, the link will be omitted from the output
*
* @return array
/**
* Get an array of interlanguage link insertions
*
- * @param $existing Array mapping existing language codes to titles
+ * @param array $existing mapping existing language codes to titles
*
* @return array
*/
/**
* Update all the appropriate counts in the category table.
- * @param $added array associative array of category name => sort key
- * @param $deleted array associative array of category name => sort key
+ * @param array $added associative array of category name => sort key
+ * @param array $deleted associative array of category name => sort key
*/
function updateCategoryCounts( $added, $deleted ) {
$a = WikiPage::factory( $this->mTitle );
* Constructor.
* @since 1.17
* @param $key: message key, or array of message keys to try and use the first non-empty message for
- * @param $params Array message parameters
+ * @param array $params message parameters
* @return Message: $this
*/
public function __construct( $key, $params = array() ) {
* intented to be used instead of the real constructor, because it allows
* chaining method calls, while new objects don't.
* @since 1.17
- * @param $key String: message key
+ * @param string $key message key
* @param Varargs: parameters as Strings
* @return Message: $this
*/
/**
* Substitutes any paramaters into the message text.
* @since 1.17
- * @param $message String: the message text
- * @param $type String: either before or after
+ * @param string $message the message text
+ * @param string $type either before or after
* @return String
*/
protected function replaceParameters( $message, $type = 'before' ) {
/**
* Extracts the parameter type and preprocessed the value if needed.
* @since 1.18
- * @param $param String|Array: Parameter as defined in this class.
+ * @param string|array $param Parameter as defined in this class.
* @return Tuple(type, value)
*/
protected function extractParam( $param ) {
/**
* Wrapper for what ever method we use to parse wikitext.
* @since 1.17
- * @param $string String: Wikitext message contents
+ * @param string $string Wikitext message contents
* @return string Wikitext parsed into HTML
*/
protected function parseText( $string ) {
/**
* Wrapper for what ever method we use to {{-transform wikitext.
* @since 1.17
- * @param $string String: Wikitext message contents
+ * @param string $string Wikitext message contents
* @return string Wikitext with {{-constructs replaced with their values.
*/
protected function transformText( $string ) {
* Call the parent constructor, then store the key as
* the message.
*
- * @param $key string Message to use
- * @param $params array Parameters for the message
+ * @param string $key Message to use
+ * @param array $params Parameters for the message
* @see Message::__construct
*/
public function __construct( $key, $params = array() ) {
* Get the message blobs for a set of modules
*
* @param $resourceLoader ResourceLoader object
- * @param $modules array Array of module objects keyed by module name
- * @param $lang string Language code
+ * @param array $modules Array of module objects keyed by module name
+ * @param string $lang Language code
* @return array An array mapping module names to message blobs
*/
public static function get( ResourceLoader $resourceLoader, $modules, $lang ) {
* present, it is not regenerated; instead, the preexisting blob
* is fetched and returned.
*
- * @param $name String: module name
+ * @param string $name module name
* @param $module ResourceLoaderModule object
- * @param $lang String: language code
+ * @param string $lang language code
* @return mixed Message blob or false if the module has no messages
*/
public static function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
/**
* Update the message blob for a given module in a given language
*
- * @param $name String: module name
+ * @param string $name module name
* @param $module ResourceLoaderModule object
- * @param $lang String: language code
+ * @param string $lang language code
* @return String Regenerated message blob, or null if there was no blob for the given module/language pair
*/
public static function updateModule( $name, ResourceLoaderModule $module, $lang ) {
/**
* Update a single message in all message blobs it occurs in.
*
- * @param $key String: message key
+ * @param string $key message key
*/
public static function updateMessage( $key ) {
try {
/**
* Create an update queue for updateMessage()
*
- * @param $key String: message key
- * @param $prevUpdates Array: updates queue to refresh or null to build a fresh update queue
+ * @param string $key message key
+ * @param array $prevUpdates updates queue to refresh or null to build a fresh update queue
* @return Array: updates queue
*/
private static function getUpdatesForMessage( $key, $prevUpdates = null ) {
/**
* Reencode a message blob with the updated value for a message
*
- * @param $blob String: message blob (JSON object)
- * @param $key String: message key
- * @param $lang String: language code
+ * @param string $blob message blob (JSON object)
+ * @param string $key message key
+ * @param string $lang language code
* @return Message blob with $key replaced with its new value
*/
private static function reencodeBlob( $blob, $key, $lang ) {
* Modules whose blobs are not in the database are silently dropped.
*
* @param $resourceLoader ResourceLoader object
- * @param $modules Array of module names
- * @param $lang String: language code
+ * @param array $modules of module names
+ * @param string $lang language code
* @throws MWException
* @return array Array mapping module names to blobs
*/
* Generate the message blob for a given module in a given language.
*
* @param $module ResourceLoaderModule object
- * @param $lang String: language code
+ * @param string $lang language code
* @return String: JSON object
*/
private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
* If $mime is "application/x-opc+zip" and isMatchingExtension( $ext, $mime )
* gives true, return the result of guessTypesForExtension($ext).
*
- * @param $mime String: the mime type, typically guessed from a file's content.
- * @param $ext String: the file extension, as taken from the file name
+ * @param string $mime the mime type, typically guessed from a file's content.
+ * @param string $ext the file extension, as taken from the file name
*
* @return string the mime type
*/
* detection (namely XML based formats like XHTML or SVG, as well as ZIP
* based formats like OPC/ODF files).
*
- * @param $file String: the file to check
+ * @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.
* header data. Currently works for OpenDocument and OpenXML types...
* If can't tell, returns 'application/zip'.
*
- * @param $header String: some reasonably-sized chunk of file header
+ * @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,
* mime type if the file is an image. If no mime type can be determined,
* this function returns 'unknown/unknown'.
*
- * @param $file String: the file to check
+ * @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.
* @todo analyse file if need be
* @todo look at multiple extension, separately and together.
*
- * @param $path String: full path to the image file, in case we have to look at the contents
+ * @param string $path full path to the image file, in case we have to look at the contents
* (if null, only the mime type is used to determine the media type code).
- * @param $mime String: mime type. If null it will be guessed using guessMimeType.
+ * @param string $mime mime type. If null it will be guessed using guessMimeType.
*
* @return (int?string?) a value to be used with the MEDIATYPE_xxx constants.
*/
* Get the MIME types that various versions of Internet Explorer would
* detect from a chunk of the content.
*
- * @param $fileName String: the file name (unused at present)
- * @param $chunk String: the first 256 bytes of the file
- * @param $proposed String: the MIME type proposed by the server
+ * @param string $fileName the file name (unused at present)
+ * @param string $chunk the first 256 bytes of the file
+ * @param string $proposed the MIME type proposed by the server
* @return Array
*/
public function getIEMimeTypes( $fileName, $chunk, $proposed ) {
/**
* Can pages in the given namespace be moved?
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return bool
*/
public static function isMovable( $index ) {
/**
* Is the given namespace is a subject (non-talk) namespace?
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return bool
* @since 1.19
*/
/**
* Is the given namespace a talk namespace?
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return bool
*/
public static function isTalk( $index ) {
/**
* Get the talk namespace index for a given namespace
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return int
*/
public static function getTalk( $index ) {
* Get the subject namespace index for a given namespace
* Special namespaces (NS_MEDIA, NS_SPECIAL) are always the subject.
*
- * @param $index Int: Namespace index
+ * @param int $index Namespace index
* @return int
*/
public static function getSubject( $index ) {
* For talk namespaces, returns the subject (non-talk) namespace
* For subject (non-talk) namespaces, returns the talk namespace
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return int or null if no associated namespace could be found
*/
public static function getAssociated( $index ) {
* of this function rather than directly doing comparison will make
* sure that code will not potentially break.
*
- * @param $ns1 int The first namespace index
- * @param $ns2 int The second namespae index
+ * @param int $ns1 The first namespace index
+ * @param int $ns2 The second namespae index
*
* @return bool
* @since 1.19
* eg: NS_USER and NS_USER wil return true, as well
* NS_USER and NS_USER_TALK will return true.
*
- * @param $ns1 int The first namespace index
- * @param $ns2 int The second namespae index
+ * @param int $ns1 The first namespace index
+ * @param int $ns2 The second namespae index
*
* @return bool
* @since 1.19
/**
* Returns the canonical (English) name for a given index
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return string or false if no canonical definition.
*/
public static function getCanonicalName( $index ) {
* Returns the index for a given canonical name, or NULL
* The input *must* be converted to lower case first
*
- * @param $name String: namespace name
+ * @param string $name namespace name
* @return int
*/
public static function getCanonicalIndex( $name ) {
/**
* Can this namespace ever have a talk namespace?
*
- * @param $index Int: namespace index
+ * @param int $index namespace index
* @return bool
*/
public static function canTalk( $index ) {
* Does this namespace contain content, for the purposes of calculating
* statistics, etc?
*
- * @param $index Int: index to check
+ * @param int $index index to check
* @return bool
*/
public static function isContent( $index ) {
/**
* Does the namespace allow subpages?
*
- * @param $index int Index to check
+ * @param int $index Index to check
* @return bool
*/
public static function hasSubpages( $index ) {
/**
* Is the namespace first-letter capitalized?
*
- * @param $index int Index to check
+ * @param int $index Index to check
* @return bool
*/
public static function isCapitalized( $index ) {
* genders. Not all languages make a distinction here.
*
* @since 1.18
- * @param $index int Index to check
+ * @param int $index Index to check
* @return bool
*/
public static function hasGenderDistinction( $index ) {
* It is not possible to use pages from this namespace as template?
*
* @since 1.20
- * @param $index int Index to check
+ * @param int $index Index to check
* @return bool
*/
public static function isNonincludable( $index ) {
* This does not mean that all pages in that namespace have the model
*
* @since 1.21
- * @param $index int Index to check
+ * @param int $index Index to check
* @return null|string default model name for the given namespace, if set
*/
public static function getNamespaceContentModel( $index ) {
/**
* Redirect to $url rather than displaying the normal page
*
- * @param $url String: URL
- * @param $responsecode String: HTTP status code
+ * @param string $url URL
+ * @param string $responsecode HTTP status code
*/
public function redirect( $url, $responsecode = '302' ) {
# Strip newlines as a paranoia check for header injection in PHP<5.1.2
* Add a new "<meta>" tag
* To add an http-equiv meta tag, precede the name with "http:"
*
- * @param $name String tag name
- * @param $val String tag value
+ * @param string $name tag name
+ * @param string $val tag value
*/
function addMeta( $name, $val ) {
array_push( $this->mMetatags, array( $name, $val ) );
/**
* Add a keyword or a list of keywords in the page header
*
- * @param $text String or array of strings
+ * @param string $text or array of strings
*/
function addKeyword( $text ) {
if( is_array( $text ) ) {
*
* Note: use setCanonicalUrl() for rel=canonical.
*
- * @param $linkarr Array: 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 $linkarr Array: 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 $script String: raw HTML
+ * @param string $script raw HTML
*/
function addScript( $script ) {
$this->mScripts .= $script . "\n";
/**
* Register and add a stylesheet from an extension directory.
*
- * @param $url String 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 $file String: 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 $version String: 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;
/**
* Add a self-contained script tag with the given contents
*
- * @param $script String: JavaScript text, no "<script>" tags
+ * @param string $script JavaScript text, no "<script>" tags
*/
public function addInlineScript( $script ) {
$this->mScripts .= Html::inlineScript( "\n$script\n" ) . "\n";
* 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 $modules Array
- * @param $position String if not null, only return modules with this position
+ * @param string $position if not null, only return modules with this position
* @param $type string
* @return Array
*/
/**
* Get the list of modules to include on this page
*
- * @param $filter Bool whether to filter out insufficiently trustworthy modules
- * @param $position String if not null, only return modules with this position
+ * @param bool $filter whether to filter out insufficiently trustworthy modules
+ * @param string $position if not null, only return modules with this position
* @param $param string
* @return Array of module names
*/
/**
* Add or replace an header item to the output
*
- * @param $name String: item name
- * @param $value String: raw HTML
+ * @param string $name item name
+ * @param string $value raw HTML
*/
public function addHeadItem( $name, $value ) {
$this->mHeadItems[$name] = $value;
/**
* Check if the header item $name is already set
*
- * @param $name String: item name
+ * @param string $name item name
* @return Boolean
*/
public function hasHeadItem( $name ) {
/**
* Set the value of the ETag HTTP header, only used if $wgUseETag is true
*
- * @param $tag String: value of "ETag" header
+ * @param string $tag value of "ETag" header
*/
function setETag( $tag ) {
$this->mETag = $tag;
/**
* Override the last modified timestamp
*
- * @param $timestamp String: 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 $policy String: 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 index policy for the page, but leave the follow policy un-
* touched.
*
- * @param $policy string Either 'index' or 'noindex'.
+ * @param string $policy Either 'index' or 'noindex'.
* @return null
*/
public function setIndexPolicy( $policy ) {
* Set the follow policy for the page, but leave the index policy un-
* touched.
*
- * @param $policy String: 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 $text String: new value of the "action text"
+ * @param string $text new value of the "action text"
*/
public function setPageTitleActionText( $text ) {
$this->mPageTitleActionText = $text;
/**
* Replace the subtile with $str
*
- * @param $str String|Message: 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 in 1.19; use addSubtitle() instead
- * @param $str String|Message to add to the subtitle
+ * @param string|Message $str to add to the subtitle
*/
public function appendSubtitle( $str ) {
$this->addSubtitle( $str );
/**
* Add $str to the subtitle
*
- * @param $str String|Message to add to the subtitle. String should be safe HTML.
+ * @param string|Message $str 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 $val String: 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 $format String: feed type, should be a key of $wgFeedClasses
- * @param $href String: URL
+ * @param string $format feed type, should be a key of $wgFeedClasses
+ * @param string $href URL
*/
public function addFeedLink( $format, $href ) {
global $wgAdvertisedFeedTypes;
/**
* Add new language links
*
- * @param $newLinkArray array Associative array mapping language code to the page
+ * @param array $newLinkArray Associative array mapping language code to the page
* name
*/
public function addLanguageLinks( $newLinkArray ) {
/**
* Reset the language links and add new language links
*
- * @param $newLinkArray array Associative array mapping language code to the page
+ * @param array $newLinkArray Associative array mapping language code to the page
* name
*/
public function setLanguageLinks( $newLinkArray ) {
/**
* Add an array of categories, with names in the keys
*
- * @param $categories Array 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 $categories Array mapping category name => sort key
+ * @param array $categories mapping category name => sort key
*/
public function setCategoryLinks( $categories ) {
$this->mCategoryLinks = array();
/**
* Show what level of JavaScript / CSS untrustworthiness is allowed on this page
* @see ResourceLoaderModule::$origin
- * @param $type String ResourceLoaderModule TYPE_ constant
+ * @param string $type ResourceLoaderModule TYPE_ constant
* @return Int ResourceLoaderModule ORIGIN_ class constant
*/
public function getAllowedModules( $type ) {
/**
* Prepend $text to the body HTML
*
- * @param $text String: HTML
+ * @param string $text HTML
*/
public function prependHTML( $text ) {
$this->mBodytext = $text . $this->mBodytext;
/**
* Append $text to the body HTML
*
- * @param $text String: HTML
+ * @param string $text HTML
*/
public function addHTML( $text ) {
$this->mBodytext .= $text;
/**
* Add wikitext with a custom Title object
*
- * @param $text String: wikitext
+ * @param string $text wikitext
* @param $title Title object
* @param $linestart Boolean: is this the start of a line?
*/
/**
* Add wikitext with a custom Title object and tidy enabled.
*
- * @param $text String: wikitext
+ * @param string $text wikitext
* @param $title Title object
* @param $linestart Boolean: is this the start of a line?
*/
/**
* Add wikitext with tidy enabled
*
- * @param $text String: wikitext
+ * @param string $text wikitext
* @param $linestart Boolean: is this the start of a line?
*/
public function addWikiTextTidy( $text, $linestart = true ) {
/**
* Add wikitext with a custom Title object
*
- * @param $text String: wikitext
+ * @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
/**
* Add an HTTP header that will influence on the cache
*
- * @param $header String: header name
+ * @param string $header header name
* @param $option Array|null
* @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 $ins String: the string to output
+ * @param string $ins the string to output
*/
public function out( $ins ) {
print $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 $pageTitle String|Message will be passed directly to setPageTitle()
- * @param $htmlTitle String|Message 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
*/
*
* @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 $params Array: message parameters; ignored if $msg is 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 ) {
/**
* Output a standard permission error page
*
- * @param $errors Array: error message keys
- * @param $action String: 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 $permission String: key required
+ * @param string $permission key required
* @throws PermissionsError
*/
public function permissionRequired( $permission ) {
/**
* Format a list of error messages
*
- * @param $errors Array of arrays returned by Title::getUserPermissionsErrors
- * @param $action String: action that was denied or null if unknown
+ * @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.
*/
public function formatPermissionsErrorMessage( $errors, $action = null ) {
* Add a "return to" link pointing to a specified title
*
* @param $title Title to link
- * @param $query Array query string parameters
- * @param $text String text of the link (input is not escaped)
+ * @param array $query query string parameters
+ * @param string $text text of the link (input is not escaped)
* @param $options Options array to pass to Linker
*/
public function addReturnTo( $title, $query = array(), $text = null, $options = array() ) {
*
* @param $unused
* @param $returnto Title or String to return to
- * @param $returntoquery String: query string for the return to link
+ * @param string $returntoquery query string for the return to link
*/
public function returnToMain( $unused = null, $returnto = null, $returntoquery = null ) {
if ( $returnto == null ) {
/**
* TODO: Document
* @param $modules Array/string with the module name(s)
- * @param $only String ResourceLoaderModule TYPE_ class constant
+ * @param string $only ResourceLoaderModule TYPE_ class constant
* @param $useESI boolean
- * @param $extraQuery Array with extra query parameters to add to each request. array( param => value )
+ * @param array $extraQuery with extra query parameters to add to each request. array( param => value )
* @param $loadCall boolean If true, output an (asynchronous) mw.loader.load() call rather than a "<script src='...'>" tag
* @return string html "<script>" and "<style>" tags
*/
}
/**
- * @param $addContentType bool: Whether "<meta>" specifying content type should be returned
+ * @param bool $addContentType Whether "<meta>" specifying content type should be returned
*
* @return array in format "link name or number => 'link html'".
*/
/**
* @param $unused
- * @param $addContentType bool: Whether "<meta>" specifying content type should be returned
+ * @param bool $addContentType Whether "<meta>" specifying content type should be returned
*
* @return string HTML tag links to be put in the header.
*/
/**
* Generate a "<link rel/>" for a feed.
*
- * @param $type String: feed type
- * @param $url String: URL to the feed
- * @param $text String: value of the "title" attribute
+ * @param string $type feed type
+ * @param string $url URL to the feed
+ * @param string $text value of the "title" attribute
* @return String: HTML fragment
*/
private function feedLink( $type, $url, $text ) {
* Add a local or specified stylesheet, with the given media options.
* Meant primarily for internal use...
*
- * @param $style String: URL to the file
- * @param $media String: to specify a media type, 'screen', 'printable', 'handheld' or any.
- * @param $condition String: for IE conditional comments, specifying an IE version
- * @param $dir String: set to 'rtl' or 'ltr' for direction-specific sheets
+ * @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
*/
public function addStyle( $style, $media = '', $condition = '', $dir = '' ) {
$options = array();
/**
* Adds inline CSS styles
* @param $style_css Mixed: inline CSS
- * @param $flip String: Set to 'flip' to flip the CSS if needed
+ * @param string $flip Set to 'flip' to flip the CSS if needed
*/
public function addInlineStyle( $style_css, $flip = 'noflip' ) {
if( $flip === 'flip' && $this->getLanguage()->isRTL() ) {
/**
* Generate \<link\> tags for stylesheets
*
- * @param $style String: URL to the file
- * @param $options Array: option, can contain 'condition', 'dir', 'media'
+ * @param string $style URL to the file
+ * @param array $options option, can contain 'condition', 'dir', 'media'
* keys
* @return String: HTML fragment
*/
/**
* Transform "media" attribute based on request parameters
*
- * @param $media String: current value of the "media" attribute
+ * @param string $media current value of the "media" attribute
* @return String: modified value of the "media" attribute, or null to skip
* this stylesheet
*/
* Include jQuery core. Use this to avoid loading it multiple times
* before we get a usable script loader.
*
- * @param $modules Array: list of jQuery modules which should be 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
*
* Calling this function kills execution immediately.
*
- * @param $type String Which entry point we are protecting. One of:
+ * @param string $type Which entry point we are protecting. One of:
* - index.php
* - load.php
* - api.php
* Extract some useful data from the result object for use by
* the navigation bar, put it into $this
*
- * @param $offset String: index offset, inclusive
+ * @param string $offset index offset, inclusive
* @param $limit Integer: exact query limit
* @param $res ResultWrapper
*/
* Do a query with specified parameters, rather than using the object
* context
*
- * @param $offset String: index offset, inclusive
+ * @param string $offset index offset, inclusive
* @param $limit Integer: exact query limit
* @param $descending Boolean: query direction, false for ascending, true for descending
* @return ResultWrapper
/**
* Build variables to use by the database wrapper.
*
- * @param $offset String: index offset, inclusive
+ * @param string $offset index offset, inclusive
* @param $limit Integer: exact query limit
* @param $descending Boolean: query direction, false for ascending, true for descending
* @return array
/**
* Make a self-link
*
- * @param $text String: text displayed on the link
- * @param $query Array: associative array of paramter to be in the query string
- * @param $type String: value of the "rel" attribute
+ * @param string $text text displayed on the link
+ * @param array $query associative array of paramter to be in the query string
+ * @param string $type value of the "rel" attribute
*
* @return String: HTML fragment
*/
*
* @protected
*
- * @param $field String The column
- * @param $value String The cell contents
+ * @param string $field The column
+ * @param string $value The cell contents
* @return Array of attr => value
*/
function getCellAttrs( $field, $value ) {
* Resubmits all defined elements of the query string, except for a
* blacklist, passed in the $blacklist parameter.
*
- * @param $blacklist Array parameters from the request query which should not be resubmitted
+ * @param array $blacklist parameters from the request query which should not be resubmitted
* @return String: HTML fragment
*/
function getHiddenFields( $blacklist = array() ) {
*
* @protected
*
- * @param $name String: the database field name
- * @param $value String: the value retrieved from the database
+ * @param string $name the database field name
+ * @param string $value the value retrieved from the database
*/
abstract function formatValue( $name, $value );
/**
* Add a new path pattern to the path router
*
- * @param $path string|array The path pattern to add
- * @param $params array The params for this path pattern
- * @param $options array The options for this path pattern
+ * @param string|array $path The path pattern to add
+ * @param array $params The params for this path pattern
+ * @param array $options The options for this path pattern
*/
public function add( $path, $params = array(), $options = array() ) {
if ( is_array( $path ) ) {
/**
* Parse a path and return the query matches for the path
*
- * @param $path string The path to parse
+ * @param string $path The path to parse
* @return Array The array of matches for the path
*/
public function parse( $path ) {
* @param $user User
* @param $context IContextSource
* @param $formClass string
- * @param $remove Array: array of items to remove
+ * @param array $remove array of items to remove
* @return HtmlForm
*/
static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
*
* @deprecated in 1.20; use User::setEmailWithConfirmation() instead.
* @param $user User
- * @param $newaddr string New email address
+ * @param string $newaddr New email address
* @return Array (true on success or Status on failure, info string)
*/
public static function trySetUserEmail( User $user, $newaddr ) {
*
* @param $search String
* @param $limit Integer
- * @param $namespaces Array: used if query is not explicitely prefixed
+ * @param array $namespaces used if query is not explicitely prefixed
* @return Array of strings
*/
public static function titleSearch( $search, $limit, $namespaces = array() ) {
/**
* Prefix search special-case for Special: namespace.
*
- * @param $search String: term
+ * @param string $search term
* @param $limit Integer: max number of items to return
* @return Array
*/
* be automatically capitalized by Title::secureAndSpit()
* later on depending on $wgCapitalLinks)
*
- * @param $namespaces Array: namespaces to search in
- * @param $search String: term
+ * @param array $namespaces namespaces to search in
+ * @param string $search term
* @param $limit Integer: max number of items to return
* @return Array of title strings
*/
/**
* Show the input form with optional error message
*
- * @param $err String: error message or null if there's no error
+ * @param string $err error message or null if there's no error
*/
function show( $err = null ) {
global $wgOut;
/**
* Build protection level selector
*
- * @param $action String: action to protect
- * @param $selected String: current protection level
+ * @param string $action action to protect
+ * @param string $selected current protection level
* @return String: HTML fragment
*/
function buildSelector( $action, $selected ) {
/**
* Prepare the label for a protection selector option
*
- * @param $permission String: permission required
+ * @param string $permission permission required
* @return String
*/
private function getOptionLabel( $permission ) {
/**
* Obtain the recent change with a given rc_id value
*
- * @param $rcid Int rc_id value to retrieve
+ * @param int $rcid rc_id value to retrieve
* @return RecentChange
*/
public static function newFromId( $rcid ) {
/**
* Find the first recent change matching some specific conditions
*
- * @param $conds Array of conditions
+ * @param array $conds of conditions
* @param $fname Mixed: override the method name in profiling/logs
* @return RecentChange
*/
/**
* Send some text to UDP.
* @see RecentChange::cleanupForIRC
- * @param $line String: text to send
- * @param $address String: defaults to $wgRC2UDPAddress.
- * @param $prefix String: defaults to $wgRC2UDPPrefix.
- * @param $port Int: defaults to $wgRC2UDPPort. (Since 1.17)
+ * @param string $line text to send
+ * @param string $address defaults to $wgRC2UDPAddress.
+ * @param string $prefix defaults to $wgRC2UDPPrefix.
+ * @param int $port defaults to $wgRC2UDPPort. (Since 1.17)
* @return Boolean: success
*/
public static function sendToUDP( $line, $address = '', $prefix = '', $port = '' ) {
/**
* Get an attribute value
*
- * @param $name String Attribute name
+ * @param string $name Attribute name
* @return mixed
*/
public function getAttribute( $name ) {
}
/**
- * @param $field int one of DELETED_* bitfield constants
+ * @param int $field one of DELETED_* bitfield constants
*
* @return Boolean
*/
* field must be included
*
* @param $row Object: the text data
- * @param $prefix String: table prefix (default 'old_')
- * @param $wiki String|false: the name of the wiki to load the revision text from
+ * @param string $prefix table prefix (default 'old_')
+ * @param string|false $wiki the name of the wiki to load the revision text from
* (same as the the wiki $row was loaded from) or false to indicate the local
* wiki (this is the default). Otherwise, it must be a symbolic wiki database
* identifier as understood by the LoadBalancer class.
*
* @param $dbw DatabaseBase
* @param $pageId Integer: ID number of the page to read from
- * @param $summary String: revision's summary
+ * @param string $summary revision's summary
* @param $minor Boolean: whether the revision should be considered as minor
* @return Revision|null on error
*/
* @private
* @param $text String
* @param $processCallback Callback to do any variable or parameter replacements in HTML attribute values
- * @param $args Array for the processing callback
- * @param $extratags Array for any extra tags to include
- * @param $removetags Array for any tags (default or extra) to exclude
+ * @param array $args for the processing callback
+ * @param array $extratags for any extra tags to include
+ * @param array $removetags for any tags (default or extra) to exclude
* @return string
*/
static function removeHTMLtags( $text, $processCallback = null, $args = array(), $extratags = array(), $removetags = array() ) {
* - Invalid id attributes are reencoded
*
* @param $attribs Array
- * @param $whitelist Array: 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/specs/web-apps/current-work/multipage/elements.html#the-id-attribute
* HTML5 definition of id attribute
*
- * @param $id String: id to escape
+ * @param string $id id to escape
* @param $options Mixed: 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
* Given HTML input, escape with htmlspecialchars but un-escape entites.
* This allows (generally harmless) entities like   to survive.
*
- * @param $html String to escape
+ * @param string $html to escape
* @return String: escaped input
*/
static function escapeHtmlAllowEntities( $html ) {
* This is useful for page titles, not for text to be displayed,
* MediaWiki allows HTML entities to escape normalization as a feature.
*
- * @param $text String (already normalized, containing entities)
+ * @param string $text (already normalized, containing entities)
* @return String (still normalized, without entities)
*/
public static function decodeCharReferencesAndNormalize( $text ) {
* Warning: this return value must be further escaped for literal
* inclusion in HTML output as of 1.10!
*
- * @param $text String: HTML fragment
+ * @param string $text HTML fragment
* @return String
*/
static function stripAllTags( $text ) {
*
* @since 1.18
*
- * @param $addr String E-mail address
+ * @param string $addr E-mail address
* @return Bool
*/
public static function validateEmail( $addr ) {
/**
* Retrieves a configuration setting for a given wiki.
- * @param $settingName String ID of the setting name to retrieve
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $params Array List of parameters. $.'key' is replaced by $value in all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $settingName ID of the setting name to retrieve
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
+ * @param array $wikiTags The tags assigned to the wiki.
* @return Mixed the value of the setting requested.
*/
public function get( $settingName, $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
/**
* Really retrieves a configuration setting for a given wiki.
*
- * @param $settingName String ID of the setting name to retrieve.
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $params Array: array of parameters.
+ * @param string $settingName ID of the setting name to retrieve.
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param array $params array of parameters.
* @return Mixed the value of the setting requested.
*/
protected function getSetting( $settingName, $wiki, /*array*/ $params ) {
/**
* Gets all settings for a wiki
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $params Array List of parameters. $.'key' is replaced by $value in all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
+ * @param array $wikiTags The tags assigned to the wiki.
* @return Array Array of settings requested.
*/
public function getAll( $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
/**
* Retrieves a configuration setting for a given wiki, forced to a boolean.
- * @param $setting String ID of the setting name to retrieve
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $setting ID of the setting name to retrieve
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $wikiTags The tags assigned to the wiki.
* @return bool The value of the setting requested.
*/
public function getBool( $setting, $wiki, $suffix = null, $wikiTags = array() ) {
/**
* Retrieves the value of a given setting, and places it in a variable passed by reference.
- * @param $setting String ID of the setting name to retrieve
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $var array Reference The variable to insert the value into.
- * @param $params Array List of parameters. $.'key' is replaced by $value in all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $setting ID of the setting name to retrieve
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $var Reference The variable to insert the value into.
+ * @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
+ * @param array $wikiTags The tags assigned to the wiki.
*/
public function extractVar( $setting, $wiki, $suffix, &$var, $params = array(), $wikiTags = array() ) {
$value = $this->get( $setting, $wiki, $suffix, $params, $wikiTags );
/**
* Retrieves the value of a given setting, and places it in its corresponding global variable.
- * @param $setting String ID of the setting name to retrieve
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $params Array List of parameters. $.'key' is replaced by $value in all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $setting ID of the setting name to retrieve
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
+ * @param array $wikiTags The tags assigned to the wiki.
*/
public function extractGlobal( $setting, $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
$params = $this->mergeParams( $wiki, $suffix, $params, $wikiTags );
/**
* Retrieves the values of all settings, and places them in their corresponding global variables.
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $params Array List of parameters. $.'key' is replaced by $value in all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $params List of parameters. $.'key' is replaced by $value in all returned data.
+ * @param array $wikiTags The tags assigned to the wiki.
*/
public function extractAllGlobals( $wiki, $suffix = null, $params = array(), $wikiTags = array() ) {
$params = $this->mergeParams( $wiki, $suffix, $params, $wikiTags );
* by self::$siteParamsCallback for backward compatibility
* Values returned by self::getWikiParams() have the priority.
*
- * @param $wiki String Wiki ID of the wiki in question.
- * @param $suffix String The suffix of the wiki in question.
- * @param $params Array List of parameters. $.'key' is replaced by $value in
+ * @param string $wiki Wiki ID of the wiki in question.
+ * @param string $suffix The suffix of the wiki in question.
+ * @param array $params List of parameters. $.'key' is replaced by $value in
* all returned data.
- * @param $wikiTags Array The tags assigned to the wiki.
+ * @param array $wikiTags The tags assigned to the wiki.
* @return array
*/
protected function mergeParams( $wiki, $suffix, /*array*/ $params, /*array*/ $wikiTags ) {
/**
* Find the number of users in a given user group.
- * @param $group String: name of group
+ * @param string $group name of group
* @return Integer
*/
static function numberingroup( $group ) {
/**
* @param $type string
- * @param $sign string ('+' or '-')
+ * @param string $sign ('+' or '-')
* @return string
*/
private function getTypeCacheKey( $type, $sign ) {
/**
* Reduce pending delta counters after updates have been applied
- * @param Array $pd Result of getPendingDeltas(), used for DB update
+ * @param array $pd Result of getPendingDeltas(), used for DB update
* @return void
*/
protected function removePendingDeltas( array $pd ) {
* @param $database DatabaseBase|bool
* - Boolean: whether to use the master DB
* - DatabaseBase: database connection to use
- * @param $options Array of options, may contain the following values
+ * @param array $options of options, may contain the following values
* - update Boolean: whether to update the current stats (true) or write fresh (false) (default: false)
* - 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)
* Normalize a skin preference value to a form that can be loaded.
* If a skin can't be found, it will fall back to the configured
* default (or the old 'Classic' skin if that's broken).
- * @param $key String: 'monobook', 'standard', etc.
+ * @param string $key 'monobook', 'standard', etc.
* @return string
*/
static function normalizeKey( $key ) {
/**
* Factory method for loading a skin of a given type
- * @param $key String: 'monobook', 'standard', etc.
+ * @param string $key 'monobook', 'standard', etc.
* @return Skin
*/
static function &newFromKey( $key ) {
/**
* Render the array as a serie of links.
- * @param $tree Array: categories tree returned by Title::getParentCategoryTree
+ * @param array $tree categories tree returned by Title::getParentCategoryTree
* @return String separated by >, terminate with "\n"
*/
function drawCategoryBrowser( $tree ) {
/**
* Renders a $wgFooterIcons icon acording to the method's arguments
- * @param $icon Array: The icon to build the html for, see $wgFooterIcons for the format of this array
- * @param $withImage Bool|String: Whether to use the icon's image or output a text-only footericon
+ * @param array $icon The icon to build the html for, see $wgFooterIcons for the format of this array
+ * @param bool|String $withImage Whether to use the icon's image or output a text-only footericon
* @return String HTML
*/
function makeFooterIcon( $icon, $withImage = 'withImage' ) {
* Return a fully resolved style path url to images or styles stored in the common folder.
* This method returns a url resolved using the configured skin style path
* and includes the style version inside of the url.
- * @param $name String: The name or path of a skin resource file
+ * @param string $name The name or path of a skin resource file
* @return String The fully resolved style path url including styleversion
*/
function getCommonStylePath( $name ) {
* Return a fully resolved style path url to images or styles stored in the curent skins's folder.
* This method returns a url resolved using the configured skin style path
* and includes the style version inside of the url.
- * @param $name String: The name or path of a skin resource file
+ * @param string $name The name or path of a skin resource file
* @return String The fully resolved style path url including styleversion
*/
function getSkinStylePath( $name ) {
* If $proto is set to null, make a local URL. Otherwise, make a full
* URL with the protocol specified.
*
- * @param $name string Name of the Special page
- * @param $urlaction string Query to append
+ * @param string $name Name of the Special page
+ * @param string $urlaction Query to append
* @param $proto Protocol to use or null for a local URL
* @return String
*/
/**
* Make URL details where the article exists (or at least it's convenient to think so)
- * @param $name String Article name
+ * @param string $name Article name
* @param $urlaction String
* @return Array
*/
/**
* Get a cached notice
*
- * @param $name String: message name, or 'default' for $wgSiteNotice
+ * @param string $name message name, or 'default' for $wgSiteNotice
* @return String: HTML fragment
*/
private function getCachedNotice( $name ) {
*
* @param $nt Title The title being linked to (may not be the same as
* $wgTitle, if the section is included from a template)
- * @param $section string The designation of the section being pointed to,
+ * @param string $section The designation of the section being pointed to,
* to be included in the link, like "§ion=$section"
- * @param $tooltip string The tooltip to use for the link: will be escaped
+ * @param string $tooltip The tooltip to use for the link: will be escaped
* and wrapped in the 'editsectionhint' message
* @param $lang string Language code
* @return string HTML to use for edit link
* Use PHP's magic __call handler to intercept legacy calls to the linker
* for backwards compatibility.
*
- * @param $fname String Name of called method
- * @param $args Array Arguments to the method
+ * @param string $fname Name of called method
+ * @param array $args Arguments to the method
* @throws MWException
* @return mixed
*/
* roughly equivalent to PHPTAL 0.7.
*
* @param $classname String
- * @param $repository string: subdirectory where we keep template files
+ * @param string $repository subdirectory where we keep template files
* @param $cache_dir string
* @return QuickTemplate
* @private
* Format language name for use in sidebar interlanguage links list.
* By default it is capitalized.
*
- * @param $name string Language name, e.g. "English" or "español"
+ * @param string $name Language name, e.g. "English" or "español"
* @return string
* @private
*/
/**
* Get a Message object with its context set
*
- * @param $name string message name
+ * @param string $name message name
* @return Message
*/
public function getMsg( $name ) {
* 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 $key string 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 $item array 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 $options array 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
* preferred method is now to add a SpecialPage_initList hook.
* @deprecated since 1.18
*
- * @param $name String the page to remove
+ * @param string $name the page to remove
*/
static function removePage( $name ) {
wfDeprecated( __METHOD__, '1.18' );
/**
* Check if a given name exist as a special page or as a special page alias
*
- * @param $name String: name of a special page
+ * @param string $name name of a special page
* @return Boolean: true if a special page exists with this name
* @deprecated since 1.18 call SpecialPageFactory method directly
*/
* Get a localised Title object for a specified special page name
*
* @param $name String
- * @param $subpage String|Bool subpage string, or false to not use a subpage
- * @param $fragment String the link fragment (after the "#")
+ * @param string|Bool $subpage subpage string, or false to not use a subpage
+ * @param string $fragment the link fragment (after the "#")
* @throws MWException
* @return Title object
*/
* Get a localised Title object for a page name with a possibly unvalidated subpage
*
* @param $name String
- * @param $subpage String|Bool subpage string, or false to not use a subpage
+ * @param string|Bool $subpage subpage string, or false to not use a subpage
* @return Title object or null if the page doesn't exist
*/
public static function getSafeTitleFor( $name, $subpage = false ) {
* If you override execute(), you can recover the default behavior with userCanExecute()
* and displayRestrictionError()
*
- * @param $name String: name of the special page, as seen in links and URLs
- * @param $restriction String: user right required, e.g. "block" or "delete"
- * @param $listed Bool: whether the page is listed in Special:Specialpages
+ * @param string $name name of the special page, as seen in links and URLs
+ * @param string $restriction user right required, e.g. "block" or "delete"
+ * @param bool $listed whether the page is listed in Special:Specialpages
* @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
- * @param $file String: file which is included by execute(). It is also constructed from $name by default
- * @param $includable Bool: whether the page can be included in normal pages
+ * @param string $file file which is included by execute(). It is also constructed from $name by default
+ * @param bool $includable whether the page can be included in normal pages
*/
public function __construct(
$name = '', $restriction = '', $listed = true,
/**
* Do the real work for the constructor, mainly so __call() can intercept
* calls to SpecialPage()
- * @param $name String: name of the special page, as seen in links and URLs
- * @param $restriction String: user right required, e.g. "block" or "delete"
- * @param $listed Bool: whether the page is listed in Special:Specialpages
+ * @param string $name name of the special page, as seen in links and URLs
+ * @param string $restriction user right required, e.g. "block" or "delete"
+ * @param bool $listed whether the page is listed in Special:Specialpages
* @param $function Callback|Bool: function called by execute(). By default it is constructed from $name
- * @param $file String: file which is included by execute(). It is also constructed from $name by default
- * @param $includable Bool: whether the page can be included in normal pages
+ * @param string $file file which is included by execute(). It is also constructed from $name by default
+ * @param bool $includable whether the page can be included in normal pages
*/
private function init( $name, $restriction, $listed, $function, $file, $includable ) {
$this->mName = $name;
* Use PHP's magic __call handler to get calls to the old PHP4 constructor
* because PHP E_STRICT yells at you for having __construct() and SpecialPage()
*
- * @param $fName String Name of called method
- * @param $a Array Arguments to the method
+ * @param string $fName Name of called method
+ * @param array $a Arguments to the method
* @throws MWException
* @deprecated since 1.17, call parent::__construct()
*/
* May be overriden, i.e. by extensions to stick with the naming conventions
* for message keys: 'extensionname-xxx'
*
- * @param $summaryMessageKey String: message key of the summary
+ * @param string $summaryMessageKey message key of the summary
*/
function outputHeader( $summaryMessageKey = '' ) {
global $wgContLang;
/**
* Basic SpecialPage workflow: get a form, send it to the user; get some data back,
*
- * @param $par String Subpage string if one was specified
+ * @param string $par Subpage string if one was specified
*/
public function execute( $par ) {
$this->setParameter( $par );
* If the special page is a redirect, then get the Title object it redirects to.
* False otherwise.
*
- * @param $par String Subpage string
+ * @param string $par Subpage string
* @return Title|bool
*/
abstract public function getRedirect( $par );
/**
* Check if a given name exist as a special page or as a special page alias
*
- * @param $name String: name of a special page
+ * @param string $name name of a special page
* @return Boolean: true if a special page exists with this name
*/
public static function exists( $name ) {
/**
* Find the object with a given name and return it (or NULL)
*
- * @param $name String Special page name, may be localised and/or an alias
+ * @param string $name Special page name, may be localised and/or an alias
* @return SpecialPage|null SpecialPage object or null if the page doesn't exist
*/
public static function getPage( $name ) {
/**
* Factory function for fatal errors
*
- * @param $message String|Message: message name or object
+ * @param string|Message $message message name or object
* @return Status
*/
static function newFatal( $message /*, parameters...*/ ) {
/**
* Add a new warning
*
- * @param $message String|Message: message name or object
+ * @param string|Message $message message name or object
*/
function warning( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
* Add an error, do not set fatal flag
* This can be used for non-fatal errors
*
- * @param $message String|Message: message name or object
+ * @param string|Message $message message name or object
*/
function error( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
* Add an error and set OK to false, indicating that the operation
* as a whole was fatal
*
- * @param $message String|Message: message name or object
+ * @param string|Message $message message name or object
*/
function fatal( $message /*, parameters... */ ) {
$params = array_slice( func_get_args(), 1 );
/**
* Get the error list as a wikitext formatted list
*
- * @param $shortContext String: a short enclosing context message name, to
+ * @param string $shortContext a short enclosing context message name, to
* be used when there is a single error
- * @param $longContext String: a long enclosing context message name, for a list
+ * @param string $longContext a long enclosing context message name, for a list
* @return String
*/
function getWikiText( $shortContext = false, $longContext = false ) {
* Note, due to the lack of tools for comparing Message objects, this
* function will not work when using a Message object as a parameter.
*
- * @param $msg String: message name
+ * @param string $msg message name
* @return Boolean
*/
function hasMessage( $msg ) {
* Headers sent include: Content-type, Content-Length, Last-Modified,
* and Content-Disposition.
*
- * @param $fname string Full name and path of the file to stream
- * @param $headers array Any additional headers to send
- * @param $sendErrors bool Send error messages if errors occur (like 404)
+ * @param string $fname Full name and path of the file to stream
+ * @param array $headers Any additional headers to send
+ * @param bool $sendErrors Send error messages if errors occur (like 404)
* @throws MWException
* @return bool Success
*/
* (b) cancels any PHP output buffering and automatic gzipping of output
* (c) sends Content-Length header based on HTTP_IF_MODIFIED_SINCE check
*
- * @param $path string Storage path or file system path
- * @param $info Array|bool File stat info with 'mtime' and 'size' fields
- * @param $headers Array Additional headers to send
- * @param $sendErrors bool Send error messages if errors occur (like 404)
+ * @param string $path Storage path or file system path
+ * @param array|bool $info File stat info with 'mtime' and 'size' fields
+ * @param array $headers Additional headers to send
+ * @param bool $sendErrors Send error messages if errors occur (like 404)
* @return int|bool READY_STREAM, NOT_MODIFIED, or false on failure
*/
public static function prepareForStream(
/**
* Determine the file type of a file based on the path
*
- * @param $filename string Storage path or file system path
- * @param $safe bool Whether to do retroactive upload blacklist checks
+ * @param string $filename Storage path or file system path
+ * @param bool $safe Whether to do retroactive upload blacklist checks
* @return null|string
*/
public static function contentTypeFromPath( $filename, $safe = true ) {
* start, so e.g. /*\/ is not considered to be both the start and end of a
* comment. /*\/xy/*\/ is considered to be a single comment with contents /xy/.
*
- * @param $startDelim String: start delimiter
- * @param $endDelim String: end delimiter
+ * @param string $startDelim start delimiter
+ * @param string $endDelim end delimiter
* @param $callback Callback: function to call on each match
* @param $subject String
- * @param $flags String: regular expression flags
+ * @param string $flags regular expression flags
* @throws MWException
* @return string
*/
*
* preg_replace( "!$startDelim(.*)$endDelim!$flags", $replace, $subject )
*
- * @param $startDelim String: start delimiter regular expression
- * @param $endDelim String: end delimiter regular expression
- * @param $replace String: replacement string. May contain $1, which will be
+ * @param string $startDelim start delimiter regular expression
+ * @param string $endDelim end delimiter regular expression
+ * @param string $replace replacement string. May contain $1, which will be
* replaced by the text between the delimiters
- * @param $subject String to search
- * @param $flags String: regular expression flags
+ * @param string $subject to search
+ * @param string $flags regular expression flags
* @return String: The string with the matches replaced
*/
static function delimiterReplace( $startDelim, $endDelim, $replace, $subject, $flags = '' ) {
/**
* Constructor.
*
- * @param $global String: name of the global variable.
- * @param $class String: name of the class of the real object.
- * @param $params Array: parameters to pass to contructor of the real
+ * @param string $global name of the global variable.
+ * @param string $class name of the class of the real object.
+ * @param array $params parameters to pass to contructor of the real
* object.
*/
function __construct( $global = null, $class = null, $params = array() ) {
* This function will also call the function with the same name in the real
* object.
*
- * @param $name String: name of the function called
- * @param $args Array: arguments
+ * @param string $name name of the function called
+ * @param array $args arguments
* @return mixed
*/
function _call( $name, $args ) {
* Function called by PHP if no function with that name exists in this
* object.
*
- * @param $name String: name of the function called
- * @param $args Array: arguments
+ * @param string $name name of the function called
+ * @param array $args arguments
* @return mixed
*/
function __call( $name, $args ) {
* This is public, for the convenience of external callers wishing to access
* properties, e.g. eval.php
*
- * @param $name String: name of the method called in this object.
+ * @param string $name name of the method called in this object.
* @param $level Integer: level to go in the stact trace to get the function
* who called this function.
* @throws MWException
*
* @since 1.20
*
- * @param $timestamp bool|string Timestamp to set, or false for current time
+ * @param bool|string $timestamp Timestamp to set, or false for current time
*/
public function __construct( $timestamp = false ) {
$this->setTimestamp( $timestamp );
*
* @since 1.20
*
- * @param $ts string|bool Timestamp to store, or false for now
+ * @param string|bool $ts Timestamp to store, or false for now
* @throws TimestampException
*/
public function setTimestamp( $ts = false ) {
*
* @since 1.20
*
- * @param $style int Constant Output format for timestamp
+ * @param int $style Constant Output format for timestamp
* @throws TimestampException
* @return string The formatted timestamp
*/
/**
* Create a new Title from a prefixed DB key
*
- * @param $key String the database key, which has underscores
+ * @param string $key the database key, which has underscores
* instead of spaces, possibly including namespace and
* interwiki prefixes
* @return Title, or NULL on an error
* Create a new Title from text, such as what one would find in a link. De-
* codes any HTML entities in the text.
*
- * @param $text String the link text; spaces, prefixes, and an
+ * @param string $text the link text; spaces, prefixes, and an
* initial ':' indicating the main namespace are accepted.
- * @param $defaultNamespace Int the namespace to use if none is speci-
+ * @param int $defaultNamespace the namespace to use if none is speci-
* fied by a prefix. If you want to force a specific namespace even if
* $text might begin with a namespace prefix, use makeTitle() or
* makeTitleSafe().
* Create a new Title from URL-encoded text. Ensures that
* the given title's length does not exceed the maximum.
*
- * @param $url String the title, as might be taken from a URL
+ * @param string $url the title, as might be taken from a URL
* @return Title the new object, or NULL on an error
*/
public static function newFromURL( $url ) {
/**
* Create a new Title from an article ID
*
- * @param $id Int the page_id corresponding to the Title to create
- * @param $flags Int use Title::GAID_FOR_UPDATE to use master
+ * @param int $id the page_id corresponding to the Title to create
+ * @param int $flags use Title::GAID_FOR_UPDATE to use master
* @return Title the new object, or NULL on an error
*/
public static function newFromID( $id, $flags = 0 ) {
/**
* Make an array of titles from an array of IDs
*
- * @param $ids Array of Int Array of IDs
+ * @param array $ids of Int Array of IDs
* @return Array of Titles
*/
public static function newFromIDs( $ids ) {
* For convenience, spaces are converted to underscores so that
* eg user_text fields can be used directly.
*
- * @param $ns Int the namespace of the article
- * @param $title String the unprefixed database key form
- * @param $fragment String the link fragment (after the "#")
- * @param $interwiki String the interwiki prefix
+ * @param int $ns the namespace of the article
+ * @param string $title the unprefixed database key form
+ * @param string $fragment the link fragment (after the "#")
+ * @param string $interwiki the interwiki prefix
* @return Title the new object
*/
public static function &makeTitle( $ns, $title, $fragment = '', $interwiki = '' ) {
* The parameters will be checked for validity, which is a bit slower
* than makeTitle() but safer for user-provided data.
*
- * @param $ns Int the namespace of the article
- * @param $title String database key form
- * @param $fragment String the link fragment (after the "#")
- * @param $interwiki String interwiki prefix
+ * @param int $ns the namespace of the article
+ * @param string $title database key form
+ * @param string $fragment the link fragment (after the "#")
+ * @param string $interwiki interwiki prefix
* @return Title the new object, or NULL on an error
*/
public static function makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' ) {
* This will only return the very next target, useful for
* the redirect table and other checks that don't need full recursion
*
- * @param $text String: Text with possible redirect
+ * @param string $text Text with possible redirect
* @return Title: The corresponding Title
* @deprecated since 1.21, use Content::getRedirectTarget instead.
*/
* This will recurse down $wgMaxRedirects times or until a non-redirect target is hit
* in order to provide (hopefully) the Title of the final destination instead of another redirect
*
- * @param $text String Text with possible redirect
+ * @param string $text Text with possible redirect
* @return Title
* @deprecated since 1.21, use Content::getUltimateRedirectTarget instead.
*/
* The last element in the array is the final destination after all redirects
* have been resolved (up to $wgMaxRedirects times)
*
- * @param $text String Text with possible redirect
+ * @param string $text Text with possible redirect
* @return Array of Titles, with the destination last
* @deprecated since 1.21, use Content::getRedirectChain instead.
*/
/**
* Get the prefixed DB key associated with an ID
*
- * @param $id Int the page_id of the article
+ * @param int $id the page_id of the article
* @return Title an object representing the article, or NULL if no such article was found
*/
public static function nameOf( $id ) {
* Get a string representation of a title suitable for
* including in a search index
*
- * @param $ns Int a namespace index
- * @param $title String text-form main part
+ * @param int $ns a namespace index
+ * @param string $title text-form main part
* @return String a stripped-down title string ready for the search index
*/
public static function indexTitle( $ns, $title ) {
/**
* Make a prefixed DB key from a DB key and a namespace index
*
- * @param $ns Int numerical representation of the namespace
- * @param $title String the DB key form the title
- * @param $fragment String The link fragment (after the "#")
- * @param $interwiki String The interwiki prefix
+ * @param int $ns numerical representation of the namespace
+ * @param string $title the DB key form the title
+ * @param string $fragment The link fragment (after the "#")
+ * @param string $interwiki The interwiki prefix
* @return String the prefixed form of the title
*/
public static function makeName( $ns, $title, $fragment = '', $interwiki = '' ) {
/**
* Escape a text fragment, say from a link, for a URL
*
- * @param $fragment string containing a URL or link fragment (after the "#")
+ * @param string $fragment containing a URL or link fragment (after the "#")
* @return String: escaped string
*/
static function escapeFragmentForURL( $fragment ) {
/**
* Convenience method for checking a title's content model name
*
- * @param String $id The content model ID (use the CONTENT_MODEL_XXX constants).
+ * @param string $id The content model ID (use the CONTENT_MODEL_XXX constants).
* @return Boolean true if $this->getContentModel() == $id
*/
public function hasContentModel( $id ) {
/**
* Returns true if this title resolves to the named special page
*
- * @param $name String The special page name
+ * @param string $name The special page name
* @return boolean
*/
public function isSpecial( $name ) {
* Please make use of this instead of comparing to getNamespace()
* This function is much more resistant to changes we may make
* to namespaces than code that makes direct comparisons.
- * @param $ns int The namespace
+ * @param int $ns The namespace
* @return bool
* @since 1.19
*/
* Deprecated for public use, use Title::makeTitle() with fragment parameter.
* Still in active use privately.
*
- * @param $fragment String text
+ * @param string $fragment text
*/
public function setFragment( $fragment ) {
$this->mFragment = str_replace( '_', ' ', substr( $fragment, 1 ) );
* Prefix some arbitrary text with the namespace or interwiki prefix
* of this object
*
- * @param $name String the text
+ * @param string $name the text
* @return String the prefixed text
* @private
*/
* # returns: Title{User:Foo/Bar/Baz/Asdf}
* @endcode
*
- * @param $text String The subpage name to add to the title
+ * @param string $text The subpage name to add to the title
* @return Title Subpage title
* @since 1.20
*/
* with action=render, $wgServer is prepended.
*
- * @param $query string|array 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.
*
* May provide false positives, but should never provide a false negative.
*
- * @param $action String action that permission needs to be checked for
+ * @param string $action action that permission needs to be checked for
* @param $user User to check (since 1.19); $wgUser will be used if not
* provided.
* @return Bool
/**
* Can $user perform $action on this page?
*
- * @param $action String action that permission needs to be checked for
+ * @param string $action action that permission needs to be checked for
* @param $user User to check (since 1.19); $wgUser will be used if not
* provided.
- * @param $doExpensiveQueries Bool Set this to false to avoid doing
+ * @param bool $doExpensiveQueries Set this to false to avoid doing
* unnecessary queries.
* @return Bool
*/
*
* @todo FIXME: This *does not* check throttles (User::pingLimiter()).
*
- * @param $action String action that permission needs to be checked for
+ * @param string $action action that permission needs to be checked for
* @param $user User to check
- * @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary
+ * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary
* queries by skipping checks for cascading protections and user blocks.
- * @param $ignoreErrors Array of Strings Set this to a list of message keys
+ * @param array $ignoreErrors of Strings Set this to a list of message keys
* whose corresponding errors may be ignored.
* @return Array of arguments to wfMessage to explain permissions problems.
*/
/**
* Permissions checks that fail most often, and which are easiest to test.
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User user to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Add the resulting error code to the errors array
*
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $result Mixed result of errors
*
* @return Array list of errors
/**
* Check various permission hooks
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User user to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check permissions on special pages & namespaces
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User user to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check CSS/JS sub-page permissions
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User user to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
* page. The user must possess all required rights for this
* action.
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User user to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check restrictions on cascading pages.
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check action permissions not already checked in checkQuickPermissions
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check that the user isn't blocked from editting.
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
/**
* Check that the user is allowed to read this page.
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $user User to check
- * @param $errors Array list of current errors
+ * @param array $errors list of current errors
* @param $doExpensiveQueries Boolean whether or not to perform expensive queries
* @param $short Boolean short circuit on first error
*
* Get a description array when the user doesn't have the right to perform
* $action (i.e. when User::isAllowed() returns false)
*
- * @param $action String the action to check
+ * @param string $action the action to check
* @param $short Boolean short circuit on first error
* @return Array list of errors
*/
* which checks ONLY that previously checked by userCan (i.e. it leaves out
* checks on wfReadOnly() and blocks)
*
- * @param $action String action that permission needs to be checked for
+ * @param string $action action that permission needs to be checked for
* @param $user User to check
- * @param $doExpensiveQueries Bool Set this to false to avoid doing unnecessary queries.
- * @param $short Bool Set this to true to stop after the first permission error.
+ * @param bool $doExpensiveQueries Set this to false to avoid doing unnecessary queries.
+ * @param bool $short Set this to true to stop after the first permission error.
* @return Array of arrays of the arguments to wfMessage to explain permissions problems.
*/
protected function getUserPermissionsErrorsInternal( $action, $user, $doExpensiveQueries = true, $short = false ) {
*
* @deprecated in 1.19; will be removed in 1.20. Use WikiPage::doUpdateRestrictions() instead.
* @param $create_perm String Permission required for creation
- * @param $reason String Reason for protection
- * @param $expiry String Expiry timestamp
+ * @param string $reason Reason for protection
+ * @param string $expiry Expiry timestamp
* @return boolean true
*/
public function updateTitleProtection( $create_perm, $reason, $expiry ) {
/**
* Is this page "semi-protected" - the *only* protection is autoconfirm?
*
- * @param $action String Action to check (default: edit)
+ * @param string $action Action to check (default: edit)
* @return Bool
*/
public function isSemiProtected( $action = 'edit' ) {
/**
* Does the title correspond to a protected article?
*
- * @param $action String the action the page is protected from,
+ * @param string $action the action the page is protected from,
* by default checks all actions.
* @return Bool
*/
/**
* Cascading protection: Get the source of any cascading restrictions on this page.
*
- * @param $getPages Bool Whether or not to retrieve the actual pages
+ * @param bool $getPages Whether or not to retrieve the actual pages
* that the restrictions have come from.
* @return Mixed Array of Title objects of the pages from which cascading restrictions
* have come, false for none, or true if such restrictions exist, but $getPages
/**
* Accessor/initialisation for mRestrictions
*
- * @param $action String action that permission needs to be checked for
+ * @param string $action action that permission needs to be checked for
* @return Array of Strings the array of groups allowed to edit this article
*/
public function getRestrictions( $action ) {
* Loads a string into mRestrictions array
*
* @param $res Resource restrictions as an SQL result.
- * @param $oldFashionedRestrictions String comma-separated list of page
+ * @param string $oldFashionedRestrictions comma-separated list of page
* restrictions from page table (pre 1.10)
*/
private function loadRestrictionsFromResultWrapper( $res, $oldFashionedRestrictions = null ) {
* and page_restrictions table for this existing page.
* Public for usage by LiquidThreads.
*
- * @param $rows array of db result objects
- * @param $oldFashionedRestrictions string comma-separated list of page
+ * @param array $rows of db result objects
+ * @param string $oldFashionedRestrictions comma-separated list of page
* restrictions from page table (pre 1.10)
*/
public function loadRestrictionsFromRows( $rows, $oldFashionedRestrictions = null ) {
/**
* Load restrictions from the page_restrictions table
*
- * @param $oldFashionedRestrictions String comma-separated list of page
+ * @param string $oldFashionedRestrictions comma-separated list of page
* restrictions from page table (pre 1.10)
*/
public function loadRestrictions( $oldFashionedRestrictions = null ) {
/**
* Get all subpages of this page.
*
- * @param $limit Int maximum number of subpages to fetch; -1 for no limit
+ * @param int $limit maximum number of subpages to fetch; -1 for no limit
* @return mixed TitleArray, or empty array if this page's namespace
* doesn't allow subpages
*/
* Get the article ID for this Title from the link cache,
* adding it if necessary
*
- * @param $flags Int a bit field; may be Title::GAID_FOR_UPDATE to select
+ * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select
* for update
* @return Int the ID
*/
* Is this an article that is a redirect page?
* Uses link cache, adding it if necessary
*
- * @param $flags Int a bit field; may be Title::GAID_FOR_UPDATE to select for update
+ * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
* @return Bool
*/
public function isRedirect( $flags = 0 ) {
* What is the length of this page?
* Uses link cache, adding it if necessary
*
- * @param $flags Int a bit field; may be Title::GAID_FOR_UPDATE to select for update
+ * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
* @return Int
*/
public function getLength( $flags = 0 ) {
/**
* What is the page_latest field for this page?
*
- * @param $flags Int a bit field; may be Title::GAID_FOR_UPDATE to select for update
+ * @param int $flags a bit field; may be Title::GAID_FOR_UPDATE to select for update
* @throws MWException
* @return Int or 0 if the page doesn't exist
*/
* loading of the new page_id. It's also called from
* WikiPage::doDeleteArticleReal()
*
- * @param $newid Int the new Article ID
+ * @param int $newid the new Article ID
*/
public function resetArticleID( $newid ) {
$linkCache = LinkCache::singleton();
/**
* Capitalize a text string for a title if it belongs to a namespace that capitalizes
*
- * @param $text String containing title to capitalize
- * @param $ns int namespace index, defaults to NS_MAIN
+ * @param string $text containing title to capitalize
+ * @param int $ns namespace index, defaults to NS_MAIN
* @return String containing capitalized title
*/
public static function capitalize( $text, $ns = NS_MAIN ) {
* WARNING: do not use this function on arbitrary user-supplied titles!
* On heavily-used templates it will max out the memory.
*
- * @param $options Array: may be FOR UPDATE
- * @param $table String: table name
- * @param $prefix String: fields prefix
+ * @param array $options may be FOR UPDATE
+ * @param string $table table name
+ * @param string $prefix fields prefix
* @return Array of Title objects linking here
*/
public function getLinksTo( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
* WARNING: do not use this function on arbitrary user-supplied titles!
* On heavily-used templates it will max out the memory.
*
- * @param $options Array: may be FOR UPDATE
+ * @param array $options may be FOR UPDATE
* @return Array of Title the Title objects linking here
*/
public function getTemplateLinksTo( $options = array() ) {
* WARNING: do not use this function on arbitrary user-supplied titles!
* On heavily-used templates it will max out the memory.
*
- * @param $options Array: may be FOR UPDATE
- * @param $table String: table name
- * @param $prefix String: fields prefix
+ * @param array $options may be FOR UPDATE
+ * @param string $table table name
+ * @param string $prefix fields prefix
* @return Array of Title objects linking here
*/
public function getLinksFrom( $options = array(), $table = 'pagelinks', $prefix = 'pl' ) {
* WARNING: do not use this function on arbitrary user-supplied titles!
* On heavily-used templates it will max out the memory.
*
- * @param $options Array: may be FOR UPDATE
+ * @param array $options may be FOR UPDATE
* @return Array of Title the Title objects used here
*/
public function getTemplateLinksFrom( $options = array() ) {
* Returns true if ok, or a getUserPermissionsErrors()-like array otherwise
*
* @param $nt Title the new title
- * @param $auth Bool indicates whether $wgUser's permissions
+ * @param bool $auth indicates whether $wgUser's permissions
* should be checked
- * @param $reason String is the log summary of the move, used for spam checking
+ * @param string $reason is the log summary of the move, used for spam checking
* @return Mixed True on success, getUserPermissionsErrors()-like array on failure
*/
public function isValidMoveOperation( &$nt, $auth = true, $reason = '' ) {
* Move a title to a new location
*
* @param $nt Title the new title
- * @param $auth Bool indicates whether $wgUser's permissions
+ * @param bool $auth indicates whether $wgUser's permissions
* should be checked
- * @param $reason String the reason for the move
- * @param $createRedirect Bool Whether to create a redirect from the old title to the new title.
+ * @param string $reason the reason for the move
+ * @param bool $createRedirect Whether to create a redirect from the old title to the new title.
* Ignored if the user doesn't have the suppressredirect right.
* @return Mixed true on success, getUserPermissionsErrors()-like array on failure
*/
* source page or nonexistent
*
* @param $nt Title the page to move to, which should be a redirect or nonexistent
- * @param $reason String The reason for the move
- * @param $createRedirect Bool Whether to leave a redirect at the old title. Does not check
+ * @param string $reason The reason for the move
+ * @param bool $createRedirect Whether to leave a redirect at the old title. Does not check
* if the user has the suppressredirect right
* @throws MWException
*/
* Move this page's subpages to be subpages of $nt
*
* @param $nt Title Move target
- * @param $auth bool Whether $wgUser's permissions should be checked
- * @param $reason string The reason for the move
- * @param $createRedirect bool Whether to create redirects from the old subpages to
+ * @param bool $auth Whether $wgUser's permissions should be checked
+ * @param string $reason The reason for the move
+ * @param bool $createRedirect Whether to create redirects from the old subpages to
* the new ones Ignored if the user doesn't have the 'suppressredirect' right
* @return mixed array with old page titles as keys, and strings (new page titles) or
* arrays (errors) as values, or an error array with numeric indices if no pages
/**
* Get a tree of parent categories
*
- * @param $children Array with the children in the keys, to check for circular refs
+ * @param array $children with the children in the keys, to check for circular refs
* @return Array Tree of parent categories
*/
public function getParentCategoryTree( $children = array() ) {
/**
* Get the revision ID of the previous revision
*
- * @param $revId Int Revision ID. Get the revision that was before this one.
- * @param $flags Int Title::GAID_FOR_UPDATE
+ * @param int $revId Revision ID. Get the revision that was before this one.
+ * @param int $flags Title::GAID_FOR_UPDATE
* @return Int|Bool Old revision ID, or FALSE if none exists
*/
public function getPreviousRevisionID( $revId, $flags = 0 ) {
/**
* Get the revision ID of the next revision
*
- * @param $revId Int Revision ID. Get the revision that was after this one.
- * @param $flags Int Title::GAID_FOR_UPDATE
+ * @param int $revId Revision ID. Get the revision that was after this one.
+ * @param int $flags Title::GAID_FOR_UPDATE
* @return Int|Bool Next revision ID, or FALSE if none exists
*/
public function getNextRevisionID( $revId, $flags = 0 ) {
/**
* Get the first revision of the page
*
- * @param $flags Int Title::GAID_FOR_UPDATE
+ * @param int $flags Title::GAID_FOR_UPDATE
* @return Revision|Null if page doesn't exist
*/
public function getFirstRevision( $flags = 0 ) {
/**
* Get the oldest revision timestamp of this page
*
- * @param $flags Int Title::GAID_FOR_UPDATE
+ * @param int $flags Title::GAID_FOR_UPDATE
* @return String: MW timestamp
*/
public function getEarliestRevTime( $flags = 0 ) {
* Get the number of revisions between the given revision.
* Used for diffs and other things that really need it.
*
- * @param $old int|Revision Old revision or rev ID (first before range)
- * @param $new int|Revision New revision or rev ID (first after range)
+ * @param int|Revision $old Old revision or rev ID (first before range)
+ * @param int|Revision $new New revision or rev ID (first after range)
* @return Int Number of revisions between these revisions.
*/
public function countRevisionsBetween( $old, $new ) {
* Get the number of authors between the given revisions or revision IDs.
* Used for diffs and other things that really need it.
*
- * @param $old int|Revision Old revision or rev ID (first before range by default)
- * @param $new int|Revision New revision or rev ID (first after range by default)
- * @param $limit int Maximum number of authors
- * @param $options string|array (Optional): Single option, or an array of options:
+ * @param int|Revision $old Old revision or rev ID (first before range by default)
+ * @param int|Revision $new New revision or rev ID (first after range by default)
+ * @param int $limit Maximum number of authors
+ * @param string|array $options (Optional): Single option, or an array of options:
* 'include_old' Include $old in the range; $new is excluded.
* 'include_new' Include $new in the range; $old is excluded.
* 'include_both' Include both $old and $new in the range.
/**
* Generate strings used for xml 'id' names in monobook tabs
*
- * @param $prepend string defaults to 'nstab-'
+ * @param string $prepend defaults to 'nstab-'
* @return String XML 'id' name
*/
public function getNamespaceKey( $prepend = 'nstab-' ) {
/**
* Get all extant redirects to this Title
*
- * @param $ns Int|Null Single namespace to consider; NULL to consider all namespaces
+ * @param int|Null $ns Single namespace to consider; NULL to consider all namespaces
* @return Array of Title redirects to this title
*/
public function getRedirectsHere( $ns = null ) {
* prefix. This will be fed to Collation::getSortKey() to get a
* binary sortkey that can be used for actual sorting.
*
- * @param $prefix string The prefix to be used, specified using
+ * @param string $prefix The prefix to be used, specified using
* {{defaultsort:}} or like [[Category:Foo|prefix]]. Empty for no
* prefix.
* @return string
}
/**
- * @param $time array (UIDGenerator::millitime(), clock sequence)
+ * @param array $time (UIDGenerator::millitime(), clock sequence)
* @return string 88 bits
*/
protected function getTimestampedID88( array $info ) {
}
/**
- * @param $info array (UIDGenerator::milltime(), counter, clock sequence)
+ * @param array $info (UIDGenerator::milltime(), counter, clock sequence)
* @return string 128 bits
*/
protected function getTimestampedID128( array $info ) {
* than any previous (time,counter) value for the given clock sequence.
* This is useful for making UIDs sequential on a per-node bases.
*
- * @param $lockFile string Name of a local lock file
+ * @param string $lockFile Name of a local lock file
* @param $clockSeqSize integer The number of possible clock sequence values
* @param $counterSize integer The number of possible counter values
* @return Array (result of UIDGenerator::millitime(), counter, clock sequence)
* Wait till the current timestamp reaches $time and return the current
* timestamp. This returns false if it would have to wait more than 10ms.
*
- * @param $time array Result of UIDGenerator::millitime()
+ * @param array $time Result of UIDGenerator::millitime()
* @return Array|bool UIDGenerator::millitime() result or false
*/
protected function timeWaitUntil( array $time ) {
}
/**
- * @param $time array Result of UIDGenerator::millitime()
+ * @param array $time Result of UIDGenerator::millitime()
* @return string 46 MSBs of "milliseconds since epoch" in binary (rolls over in 4201)
*/
protected function millisecondsSinceEpochBinary( array $time ) {
* This is slightly less efficient than newFromId(), so use newFromId() if
* you have both an ID and a name handy.
*
- * @param $name String Username, validated by Title::newFromText()
- * @param $validate String|Bool Validate username. Takes the same parameters as
+ * @param string $name Username, validated by Title::newFromText()
+ * @param string|Bool $validate Validate username. Takes the same parameters as
* User::getCanonicalName(), except that true is accepted as an alias
* for 'valid', for BC.
*
/**
* Static factory method for creation from a given user ID.
*
- * @param $id Int Valid user ID
+ * @param int $id Valid user ID
* @return User The corresponding User object
*/
public static function newFromId( $id ) {
*
* If the code is invalid or has expired, returns NULL.
*
- * @param $code String Confirmation code
+ * @param string $code Confirmation code
* @return User object, or null
*/
public static function newFromConfirmationCode( $code ) {
* user_name and user_real_name are not provided because the whole row
* will be loaded once more from the database when accessing them.
*
- * @param $row Array A row from the user table
- * @param $data Array Further data to load into the object (see User::loadFromRow for valid keys)
+ * @param array $row A row from the user table
+ * @param array $data Further data to load into the object (see User::loadFromRow for valid keys)
* @return User
*/
public static function newFromRow( $row, $data = null ) {
/**
* Get the username corresponding to a given user ID
- * @param $id Int User ID
+ * @param int $id User ID
* @return String|bool The corresponding username
*/
public static function whoIs( $id ) {
/**
* Get the real name of a user given their user ID
*
- * @param $id Int User ID
+ * @param int $id User ID
* @return String|bool The corresponding user's real name
*/
public static function whoIsReal( $id ) {
/**
* Get database id given a user name
- * @param $name String Username
+ * @param string $name Username
* @return Int|Null The corresponding user's ID, or null if user is nonexistent
*/
public static function idFromName( $name ) {
* addresses like this, if we allowed accounts like this to be created
* new users could get the old edits of these anonymous users.
*
- * @param $name String to match
+ * @param string $name to match
* @return Bool
*/
public static function isIP( $name ) {
* is longer than the maximum allowed username size or doesn't begin with
* a capital letter.
*
- * @param $name String to match
+ * @param string $name to match
* @return Bool
*/
public static function isValidUserName( $name ) {
* If an account already exists in this form, login will be blocked
* by a failure to pass this function.
*
- * @param $name String to match
+ * @param string $name to match
* @return Bool
*/
public static function isUsableName( $name ) {
* Additional blacklisting may be added here rather than in
* isValidUserName() to avoid disrupting existing accounts.
*
- * @param $name String to match
+ * @param string $name to match
* @return Bool
*/
public static function isCreatableName( $name ) {
/**
* Is the input a valid password for this user?
*
- * @param $password String Desired password
+ * @param string $password Desired password
* @return Bool
*/
public function isValidPassword( $password ) {
/**
* Given unvalidated password input, return error message on failure.
*
- * @param $password String Desired password
+ * @param string $password Desired password
* @return mixed: true on success, string or array of error message on failure
*/
public function getPasswordValidity( $password ) {
* to be liberal enough for wide use. Some invalid addresses will still
* pass validation here.
*
- * @param $addr String E-mail address
+ * @param string $addr E-mail address
* @return Bool
* @deprecated since 1.18 call Sanitizer::isValidEmail() directly
*/
/**
* Given unvalidated user input, return a canonical username, or false if
* the username is invalid.
- * @param $name String User input
- * @param $validate String|Bool type of validation to use:
+ * @param string $name User input
+ * @param string|Bool $validate type of validation to use:
* - false No validation
* - 'valid' Valid for batch processes
* - 'usable' Valid for batch processes and login
/**
* Count the number of edits of a user
*
- * @param $uid Int User ID to check
+ * @param int $uid User ID to check
* @return Int the user's edit count
*
* @deprecated since 1.21 in favour of User::getEditCount
/**
* Return whether an item has been loaded.
*
- * @param $item String: item to check. Current possibilities:
+ * @param string $item item to check. Current possibilities:
* - id
* - name
* - realname
- * @param $all String: 'all' to check if the whole object has been loaded
+ * @param string $all 'all' to check if the whole object has been loaded
* or any other string to check if only the item is available (e.g.
* for optimisation)
* @return Boolean
/**
* Initialize this object from a row from the user table.
*
- * @param $row Array Row from the user table to load.
- * @param $data Array Further user data to load into the object
+ * @param array $row Row from the user table to load.
+ * @param array $data Further user data to load into the object
*
* user_groups Array with groups out of the user_groups table
* user_properties Array with properties out of the user_properties table
* will not be re-added automatically. The user will also not lose the
* group if they no longer meet the criteria.
*
- * @param $event String key in $wgAutopromoteOnce (each one has groups/criteria)
+ * @param string $event key in $wgAutopromoteOnce (each one has groups/criteria)
*
* @return array Array of groups the user has been promoted to.
*
* Clear various cached data stored in this object. The cache of the user table
* data (i.e. self::$mCacheVars) is not cleared unless $reloadFrom is given.
*
- * @param $reloadFrom bool|String Reload user and user_groups table data from a
+ * @param bool|String $reloadFrom Reload user and user_groups table data from a
* given source. May be "name", "id", "defaults", "session", or false for
* no reload.
*/
/**
* Get a given default option value.
*
- * @param $opt String Name of option to retrieve
+ * @param string $opt Name of option to retrieve
* @return String Default option value
*/
public static function getDefaultOption( $opt ) {
/**
* Get blocking information
- * @param $bFromSlave Bool Whether to check the slave database first. To
+ * @param bool $bFromSlave Whether to check the slave database first. To
* improve performance, non-critical checks are done
* against slaves. Check when actually saving should be
* done against master.
/**
* Whether the given IP is in a DNS blacklist.
*
- * @param $ip String IP to check
- * @param $checkWhitelist Bool: whether to check the whitelist first
+ * @param string $ip IP to check
+ * @param bool $checkWhitelist whether to check the whitelist first
* @return Bool True if blacklisted.
*/
public function isDnsBlacklisted( $ip, $checkWhitelist = false ) {
/**
* Whether the given IP is in a given DNS blacklist.
*
- * @param $ip String IP to check
- * @param $bases String|Array of Strings: URL of the DNS blacklist
+ * @param string $ip IP to check
+ * @param string|array $bases of Strings: URL of the DNS blacklist
* @return Bool True if blacklisted.
*/
public function inDnsBlacklist( $ip, $bases ) {
* @note When using a shared cache like memcached, IP-address
* last-hit counters will be shared across wikis.
*
- * @param $action String Action to enforce; 'edit' if unspecified
+ * @param string $action Action to enforce; 'edit' if unspecified
* @return Bool True if a rate limiter was tripped
*/
public function pingLimiter( $action = 'edit' ) {
/**
* Check if user is blocked
*
- * @param $bFromSlave Bool Whether to check the slave database instead of the master
+ * @param bool $bFromSlave Whether to check the slave database instead of the master
* @return Bool True if blocked, false otherwise
*/
public function isBlocked( $bFromSlave = true ) { // hacked from false due to horrible probs on site
/**
* Get the block affecting the user, or null if the user is not blocked
*
- * @param $bFromSlave Bool Whether to check the slave database instead of the master
+ * @param bool $bFromSlave Whether to check the slave database instead of the master
* @return Block|null
*/
public function getBlock( $bFromSlave = true ) {
* Check if user is blocked from editing a particular article
*
* @param $title Title to check
- * @param $bFromSlave Bool whether to check the slave database instead of the master
+ * @param bool $bFromSlave whether to check the slave database instead of the master
* @return Bool
*/
function isBlockedFrom( $title, $bFromSlave = false ) {
* Do not use for actual edit permission checks!
* This is intented for quick UI checks.
*
- * @param $ip String IP address, uses current client if none given
+ * @param string $ip IP address, uses current client if none given
* @return Bool True if blocked, false otherwise
*/
public function isBlockedGlobally( $ip = '' ) {
/**
* Set the user and reload all fields according to a given ID
- * @param $v Int User ID to reload
+ * @param int $v User ID to reload
*/
public function setId( $v ) {
$this->mId = $v;
*
* @note User::newFromName() has rougly the same function, when the named user
* does not exist.
- * @param $str String New user name to set
+ * @param string $str New user name to set
*/
public function setName( $str ) {
$this->load();
* Internal uncached check for new messages
*
* @see getNewtalk()
- * @param $field String 'user_ip' for anonymous users, 'user_id' otherwise
- * @param $id String|Int User's IP address for anonymous users, User ID otherwise
- * @param $fromMaster Bool true to fetch from the master, false for a slave
+ * @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
* @return Bool True if the user has new messages
*/
protected function checkNewtalk( $field, $id, $fromMaster = false ) {
/**
* Add or update the new messages flag
- * @param $field String 'user_ip' for anonymous users, 'user_id' otherwise
- * @param $id String|Int User's IP address for anonymous users, User ID otherwise
+ * @param string $field 'user_ip' for anonymous users, 'user_id' otherwise
+ * @param string|Int $id User's IP address for anonymous users, User ID otherwise
* @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null.
* @return Bool True if successful, false otherwise
*/
/**
* Clear the new messages flag for the given user
- * @param $field String 'user_ip' for anonymous users, 'user_id' otherwise
- * @param $id String|Int User's IP address for anonymous users, User ID otherwise
+ * @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
* @return Bool True if successful, false otherwise
*/
protected function deleteNewtalk( $field, $id ) {
/**
* Update the 'You have new messages!' status.
- * @param $val Bool Whether the user has new messages
+ * @param bool $val Whether the user has new messages
* @param $curRev Revision new, as yet unseen revision of the user talk page. Ignored if null or !$val.
*/
public function setNewtalk( $val, $curRev = null ) {
/**
* Validate the cache for this account.
- * @param $timestamp String A timestamp in TS_MW format
+ * @param string $timestamp A timestamp in TS_MW format
*
* @return bool
*/
* wipes it, so the account cannot be logged in until
* a new password is set, for instance via e-mail.
*
- * @param $str String New password to set
+ * @param string $str New password to set
* @throws PasswordError on failure
*
* @return bool
/**
* Set the password and reset the random token unconditionally.
*
- * @param $str string|null New password to set or null to set an invalid
+ * @param string|null $str New password to set or null to set an invalid
* password hash meaning that the user will not be able to log in
* through the web interface.
*/
/**
* Get the user's current token.
- * @param $forceCreation bool Force the generation of a new token if the user doesn't have one (default=true for backwards compatibility)
+ * @param bool $forceCreation Force the generation of a new token if the user doesn't have one (default=true for backwards compatibility)
* @return String Token
*/
public function getToken( $forceCreation = true ) {
* Set the random token (used for persistent authentication)
* Called from loadDefaults() among other places.
*
- * @param $token String|bool If specified, set the token to this value
+ * @param string|bool $token If specified, set the token to this value
*/
public function setToken( $token = false ) {
$this->load();
/**
* Set the password for a password reminder or new account email
*
- * @param $str String New password to set
- * @param $throttle Bool If true, reset the throttle timestamp to the present
+ * @param string $str New password to set
+ * @param bool $throttle If true, reset the throttle timestamp to the present
*/
public function setNewpassword( $str, $throttle = true ) {
$this->load();
/**
* Set the user's e-mail address
- * @param $str String New e-mail address
+ * @param string $str New e-mail address
*/
public function setEmail( $str ) {
$this->load();
* Set the user's e-mail address and a confirmation mail if needed.
*
* @since 1.20
- * @param $str String New e-mail address
+ * @param string $str New e-mail address
* @return Status
*/
public function setEmailWithConfirmation( $str ) {
/**
* Set the user's real name
- * @param $str String New real name
+ * @param string $str New real name
*/
public function setRealName( $str ) {
$this->load();
/**
* Get the user's current setting for a given option.
*
- * @param $oname String The option to check
- * @param $defaultOverride String A default value returned if the option does not exist
- * @param $ignoreHidden Bool = whether to ignore the effects of $wgHiddenPrefs
+ * @param string $oname The option to check
+ * @param string $defaultOverride A default value returned if the option does not exist
+ * @param bool $ignoreHidden = whether to ignore the effects of $wgHiddenPrefs
* @return String User's current value for the option
* @see getBoolOption()
* @see getIntOption()
/**
* Get the user's current setting for a given option, as a boolean value.
*
- * @param $oname String The option to check
+ * @param string $oname The option to check
* @return Bool User's current value for the option
* @see getOption()
*/
/**
* Get the user's current setting for a given option, as a boolean value.
*
- * @param $oname String The option to check
- * @param $defaultOverride Int A default value returned if the option does not exist
+ * @param string $oname The option to check
+ * @param int $defaultOverride A default value returned if the option does not exist
* @return Int User's current value for the option
* @see getOption()
*/
/**
* Set the given option for a user.
*
- * @param $oname String The option to set
+ * @param string $oname The option to set
* @param $val mixed New value to set
*/
public function setOption( $oname, $val ) {
*
* @see User::listOptionKinds
* @param $context IContextSource
- * @param $options array assoc. array with options keys to check as keys. Defaults to $this->mOptions.
+ * @param array $options assoc. array with options keys to check as keys. Defaults to $this->mOptions.
* @return array the key => kind mapping data
*/
public function getOptionKinds( IContextSource $context, $options = null ) {
* Supported values are everything that can be reported by getOptionKinds()
* and 'all', which forces a reset of *all* preferences and overrides everything else.
*
- * @param $resetKinds array|string which kinds of preferences to reset. Defaults to
+ * @param array|string $resetKinds which kinds of preferences to reset. Defaults to
* array( 'registered', 'registered-multiselect', 'registered-checkmatrix', 'unused' )
* for backwards-compatibility.
* @param $context IContextSource|null context source used when $resetKinds
* Get the list of implicit group memberships this user has.
* This includes all explicit groups, plus 'user' if logged in,
* '*' for all accounts, and autopromoted groups
- * @param $recache Bool Whether to avoid the cache
+ * @param bool $recache Whether to avoid the cache
* @return Array of String internal group names
*/
public function getEffectiveGroups( $recache = false ) {
* Get the list of implicit group memberships this user has.
* This includes 'user' if logged in, '*' for all accounts,
* and autopromoted groups
- * @param $recache Bool Whether to avoid the cache
+ * @param bool $recache Whether to avoid the cache
* @return Array of String internal group names
*/
public function getAutomaticGroups( $recache = false ) {
/**
* Add the user to the given group.
* This takes immediate effect.
- * @param $group String Name of the group to add
+ * @param string $group Name of the group to add
*/
public function addGroup( $group ) {
if( wfRunHooks( 'UserAddGroup', array( $this, &$group ) ) ) {
/**
* Remove the user from the given group.
* This takes immediate effect.
- * @param $group String Name of the group to remove
+ * @param string $group Name of the group to remove
*/
public function removeGroup( $group ) {
$this->load();
/**
* Set this user's options from an encoded string
- * @param $str String Encoded options to import
+ * @param string $str Encoded options to import
*
* @deprecated in 1.19 due to removal of user_options from the user table
*/
/**
* Set a cookie on the user's client. Wrapper for
* WebResponse::setCookie
- * @param $name String Name of the cookie to set
- * @param $value String Value to set
- * @param $exp Int Expiration time, as a UNIX time value;
+ * @param string $name Name of the cookie to set
+ * @param string $value Value to set
+ * @param int $exp Expiration time, as a UNIX time value;
* if 0 or not specified, use the default $wgCookieExpiration
* @param $secure Bool
* true: Force setting the secure attribute when setting the cookie
/**
* Clear a cookie on the user's client
- * @param $name String Name of the cookie to clear
+ * @param string $name Name of the cookie to clear
*/
protected function clearCookie( $name ) {
$this->setCookie( $name, '', time() - 86400 );
*
* @param $request WebRequest object to use; $wgRequest will be used if null
* is passed.
- * @param $secure bool Whether to force secure/insecure cookies or use default
+ * @param bool $secure Whether to force secure/insecure cookies or use default
*/
public function setCookies( $request = null, $secure = null ) {
if ( $request === null ) {
/**
* Add a user to the database, return the user object
*
- * @param $name String Username to add
- * @param $params Array of Strings Non-default parameters to save to the database as user_* fields:
+ * @param string $name Username to add
+ * @param array $params of Strings Non-default parameters to save to the database as user_* fields:
* - password The user's password hash. Password logins will be disabled if this is omitted.
* - newpassword Hash for a temporary password that has been mailed to the user
* - email The user's email address
/**
* Check to see if the given clear-text password is one of the accepted passwords
- * @param $password String: user password.
+ * @param string $password user password.
* @return Boolean: True if the given password is correct, otherwise False.
*/
public function checkPassword( $password ) {
* Alias for getEditToken.
* @deprecated since 1.19, use getEditToken instead.
*
- * @param $salt String|Array of Strings Optional function-specific data for hashing
+ * @param string|array $salt of Strings Optional function-specific data for hashing
* @param $request WebRequest object to use or null to use $wgRequest
* @return String The new edit token
*/
*
* @since 1.19
*
- * @param $salt String|Array of Strings Optional function-specific data for hashing
+ * @param string|array $salt of Strings Optional function-specific data for hashing
* @param $request WebRequest object to use or null to use $wgRequest
* @return String The new edit token
*/
* user's own login session, not a form submission from a third-party
* site.
*
- * @param $val String Input value to compare
- * @param $salt String Optional function-specific data for hashing
+ * @param string $val Input value to compare
+ * @param string $salt Optional function-specific data for hashing
* @param $request WebRequest object to use or null to use $wgRequest
* @return Boolean: Whether the token matches
*/
* Check given value against the token value stored in the session,
* ignoring the suffix.
*
- * @param $val String Input value to compare
- * @param $salt String Optional function-specific data for hashing
+ * @param string $val Input value to compare
+ * @param string $salt Optional function-specific data for hashing
* @param $request WebRequest object to use or null to use $wgRequest
* @return Boolean: Whether the token matches
*/
* Generate a new e-mail confirmation token and send a confirmation/invalidation
* mail to the user's given address.
*
- * @param $type String: message to send, either "created", "changed" or "set"
+ * @param string $type message to send, either "created", "changed" or "set"
* @return Status object
*/
public function sendConfirmationMail( $type = 'created' ) {
* Send an e-mail to this user's account. Does not check for
* confirmed status or validity.
*
- * @param $subject String Message subject
- * @param $body String Message body
- * @param $from String Optional From address; if unspecified, default $wgPasswordSender will be used
- * @param $replyto String Reply-To address
+ * @param string $subject Message subject
+ * @param string $body Message body
+ * @param string $from Optional From address; if unspecified, default $wgPasswordSender will be used
+ * @param string $replyto Reply-To address
* @return Status
*/
public function sendMail( $subject, $body, $from = null, $replyto = null ) {
/**
* Return a URL the user can use to confirm their email address.
- * @param $token String Accepts the email confirmation token
+ * @param string $token Accepts the email confirmation token
* @return String New token URL
*/
private function confirmationTokenUrl( $token ) {
/**
* Return a URL the user can use to invalidate their email address.
- * @param $token String Accepts the email confirmation token
+ * @param string $token Accepts the email confirmation token
* @return String New token URL
*/
private function invalidationTokenUrl( $token ) {
* also sometimes can get corrupted in some browsers/mailers
* (bug 6957 with Gmail and Internet Explorer).
*
- * @param $page String Special page
- * @param $token String Token
+ * @param string $page Special page
+ * @param string $token Token
* @return String Formatted URL
*/
protected function getTokenUrl( $page, $token ) {
/**
* Set the e-mail authentication timestamp.
- * @param $timestamp String TS_MW timestamp
+ * @param string $timestamp TS_MW timestamp
*/
function setEmailAuthenticationTimestamp( $timestamp ) {
$this->load();
/**
* Get the permissions associated with a given list of groups
*
- * @param $groups Array of Strings List of internal group names
+ * @param array $groups of Strings List of internal group names
* @return Array of Strings List of permission key names for given groups combined
*/
public static function getGroupPermissions( $groups ) {
/**
* Get all the groups who have a given permission
*
- * @param $role String Role to check
+ * @param string $role Role to check
* @return Array of Strings List of internal group names with the given permission
*/
public static function getGroupsWithPermission( $role ) {
/**
* Check, if the given group has the given permission
*
- * @param $group String Group to check
- * @param $role String Role to check
+ * @param string $group Group to check
+ * @param string $role Role to check
* @return bool
*/
public static function groupHasPermission( $group, $role ) {
/**
* Get the localized descriptive name for a group, if it exists
*
- * @param $group String Internal group name
+ * @param string $group Internal group name
* @return String Localized descriptive group name
*/
public static function getGroupName( $group ) {
/**
* Get the localized descriptive name for a member of a group, if it exists
*
- * @param $group String Internal group name
- * @param $username String Username for gender (since 1.19)
+ * @param string $group Internal group name
+ * @param string $username Username for gender (since 1.19)
* @return String Localized name for group member
*/
public static function getGroupMember( $group, $username = '#' ) {
/**
* Get the title of a page describing a particular group
*
- * @param $group String Internal group name
+ * @param string $group Internal group name
* @return Title|Bool Title of the page if it exists, false otherwise
*/
public static function getGroupPage( $group ) {
* Create a link to the group in HTML, if available;
* else return the group name.
*
- * @param $group String Internal name of the group
- * @param $text String The text of the link
+ * @param string $group Internal name of the group
+ * @param string $text The text of the link
* @return String HTML link to the group
*/
public static function makeGroupLinkHTML( $group, $text = '' ) {
* Create a link to the group in Wikitext, if available;
* else return the group name.
*
- * @param $group String Internal name of the group
- * @param $text String The text of the link
+ * @param string $group Internal name of the group
+ * @param string $text The text of the link
* @return String Wikilink to the group
*/
public static function makeGroupLinkWiki( $group, $text = '' ) {
/**
* Returns an array of the groups that a particular group can add/remove.
*
- * @param $group String: the group to check for whether it can add/remove
+ * @param string $group the group to check for whether it can add/remove
* @return Array array( 'add' => array( addablegroups ),
* 'remove' => array( removablegroups ),
* 'add-self' => array( addablegroups to self),
/**
* Get the description of a given right
*
- * @param $right String Right to query
+ * @param string $right Right to query
* @return String Localized description of the right
*/
public static function getRightDescription( $right ) {
/**
* Make an old-style password hash
*
- * @param $password String Plain-text password
- * @param $userId String User ID
+ * @param string $password Plain-text password
+ * @param string $userId User ID
* @return String Password hash
*/
public static function oldCrypt( $password, $userId ) {
/**
* Make a new-style password hash
*
- * @param $password String Plain-text password
+ * @param string $password Plain-text password
* @param bool|string $salt Optional salt, may be random or the user ID.
* If unspecified or false, will generate one automatically
* Compare a password hash with a plain-text password. Requires the user
* ID if there's a chance that the hash is an old-style hash.
*
- * @param $hash String Password hash
- * @param $password String Plain-text password to compare
- * @param $userId String|bool User ID for old-style password salt
+ * @param string $hash Password hash
+ * @param string $password Plain-text password to compare
+ * @param string|bool $userId User ID for old-style password salt
*
* @return Boolean
*/
* Add a newuser log entry for this user.
* Before 1.19 the return value was always true.
*
- * @param $action string|bool: account creation type.
+ * @param string|bool $action account creation type.
* - String, one of the following values:
* - 'create' for an anonymous user creating an account for himself.
* This will force the action's performer to be the created user itself,
* - false will be converted to 'create' if this object is the same as
* $wgUser and to 'create2' otherwise
*
- * @param $reason String: user supplied reason
+ * @param string $reason user supplied reason
*
* @return int|bool True if not $wgNewUserLog; otherwise ID of log item or 0 on failure
*/
/**
* Load the user options either from cache, the database or an array
*
- * @param $data array Rows for the current user out of the user_properties table
+ * @param array $data Rows for the current user out of the user_properties table
*/
protected function loadOptions( $data = null ) {
global $wgContLang;
*/
class MailAddress {
/**
- * @param $address string|User string with an email address, or a User object
- * @param $name String: human-readable name if a string address is given
- * @param $realName String: human-readable real name if a string address is given
+ * @param string|User $address string with an email address, or a User object
+ * @param string $name human-readable name if a string address is given
+ * @param string $realName human-readable real name if a string address is given
*/
function __construct( $address, $name = null, $realName = null ) {
if ( is_object( $address ) && $address instanceof User ) {
/**
* Creates a single string from an associative array
*
- * @param $headers array Associative Array: keys are header field names,
+ * @param array $headers Associative Array: keys are header field names,
* values are ... values.
- * @param $endl String: The end of line character. Defaults to "\n"
+ * @param string $endl The end of line character. Defaults to "\n"
*
* Note RFC2822 says newlines must be CRLF (\r\n)
* but php mail naively "corrects" it and requires \n for the "correction" to work
*
* @param $to MailAddress: recipient's email (or an array of them)
* @param $from MailAddress: sender's email
- * @param $subject String: email's subject.
- * @param $body String: email's text or Array of two strings to be the text and html bodies
+ * @param string $subject email's subject.
+ * @param string $body email's text or Array of two strings to be the text and html bodies
* @param $replyto MailAddress: optional reply-to email (default: null).
- * @param $contentType String: optional custom Content-Type (default: text/plain; charset=UTF-8)
+ * @param string $contentType optional custom Content-Type (default: text/plain; charset=UTF-8)
* @throws MWException
* @return Status object
*/
* Set the mail error message in self::$mErrorString
*
* @param $code Integer: error number
- * @param $string String: error message
+ * @param string $string error message
*/
static function errorHandler( $code, $string ) {
self::$mErrorString = preg_replace( '/^mail\(\)(\s*\[.*?\])?: /', '', $string );
*
* @param $editor User object
* @param $title Title object
- * @param $timestamp string Edit timestamp
- * @param $summary string Edit summary
+ * @param string $timestamp Edit timestamp
+ * @param string $summary Edit summary
* @param $minorEdit bool
- * @param $oldid int Revision ID
- * @param $watchers array of user IDs
+ * @param int $oldid Revision ID
+ * @param array $watchers of user IDs
* @param string $pageStatus
* @throws MWException
*/
* @see newFromId()
* @see newFromName()
* @param $db DatabaseBase: db connection
- * @param $database String: database name
- * @param $name String: user name
+ * @param string $database database name
+ * @param string $name user name
* @param $id Integer: user ID
*/
private function __construct( $db, $database, $name, $id ) {
/**
* Confirm the selected database name is a valid local interwiki database name.
*
- * @param $database String: database name
+ * @param string $database database name
* @return Boolean
*/
public static function validDatabase( $database ) {
/**
* Same as User::whoIs()
*
- * @param $database String: database name
+ * @param string $database database name
* @param $id Integer: user ID
* @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
* @return String: user name or false if the user doesn't exist
/**
* Factory function; get a remote user entry by ID number.
*
- * @param $database String: database name
+ * @param string $database database name
* @param $id Integer: user ID
* @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
* @return UserRightsProxy or null if doesn't exist
/**
* Factory function; get a remote user entry by name.
*
- * @param $database String: database name
- * @param $name String: user name
+ * @param string $database database name
+ * @param string $name user name
* @param $ignoreInvalidDB Boolean: if true, don't check if $database is in $wgLocalDatabases
* @return UserRightsProxy or null if doesn't exist
*/
* If the REQUEST_URI is not provided we'll fall back on the PATH_INFO
* provided by the server if any and use that to set a 'title' parameter.
*
- * @param $want string: If this is not 'all', then the function
+ * @param string $want If this is not 'all', then the function
* will return an empty array if it determines that the URL is
* inside a rewrite path.
*
* URL rewriting function; tries to extract page title and,
* optionally, one other fixed parameter value from a URL path.
*
- * @param $path string: the URL path given from the client
- * @param $bases array: one or more URLs, optionally with $1 at the end
- * @param $key string: if provided, the matching key in $bases will be
+ * @param string $path the URL path given from the client
+ * @param array $bases one or more URLs, optionally with $1 at the end
+ * @param string $key if provided, the matching key in $bases will be
* passed on as the value of this URL parameter
* @return array of URL variables to interpolate; empty if no match
*/
* Recursively strips slashes from the given array;
* used for undoing the evil that is magic_quotes_gpc.
*
- * @param $arr array: will be modified
- * @param $topLevel bool Specifies if the array passed is from the top
+ * @param array $arr will be modified
+ * @param bool $topLevel Specifies if the array passed is from the top
* level of the source. In PHP5 magic_quotes only escapes the first level
* of keys that belong to an array.
* @return array the original array
* selected by a drop-down menu). For freeform input, see getText().
*
* @param $name String
- * @param $default String: optional default (or NULL)
+ * @param string $default optional default (or NULL)
* @return String
*/
public function getVal( $name, $default = null ) {
/**
* Set an arbitrary value into our get/post data.
*
- * @param $key String: key name to use
+ * @param string $key key name to use
* @param $value Mixed: value to set
* @return Mixed: old value if one was present, null otherwise
*/
/**
* Unset an arbitrary value from our get/post data.
*
- * @param $key String: key name to use
+ * @param string $key key name to use
* @return Mixed: old value if one was present, null otherwise
*/
public function unsetVal( $key ) {
* If no source and no default, returns NULL.
*
* @param $name String
- * @param $default Array: optional default (or NULL)
+ * @param array $default optional default (or NULL)
* @return Array
*/
public function getArray( $name, $default = null ) {
* If an array is returned, contents are guaranteed to be integers.
*
* @param $name String
- * @param $default Array: option default (or NULL)
+ * @param array $default option default (or NULL)
* @return Array of ints
*/
public function getIntArray( $name, $default = null ) {
* be required - e.g. Esperanto x-coding).
*
* @param $name String
- * @param $default String: optional
+ * @param string $default optional
* @return String
*/
public function getText( $name, $default = '' ) {
/**
* Get a cookie from the $_COOKIE jar
*
- * @param $key String: the name of the cookie
- * @param $prefix String: a prefix to use for the cookie name, if not $wgCookiePrefix
+ * @param string $key the name of the cookie
+ * @param string $prefix a prefix to use for the cookie name, if not $wgCookiePrefix
* @param $default Mixed: what to return if the value isn't found
* @return Mixed: cookie value or $default if the cookie not set
*/
/**
* Take an arbitrary query and rewrite the present URL to include it
- * @param $query String: query string fragment; do not include initial '?'
+ * @param string $query query string fragment; do not include initial '?'
*
* @return String
*/
* HTML-safe version of appendQuery().
* @deprecated: Deprecated in 1.20, warnings in 1.21, remove in 1.22.
*
- * @param $query String: query string fragment; do not include initial '?'
+ * @param string $query query string fragment; do not include initial '?'
* @return String
*/
public function escapeAppendQuery( $query ) {
/**
* Appends or replaces value of query variables.
*
- * @param $array Array of values to replace/add to query
- * @param $onlyquery Bool: whether to only return the query string and not
+ * @param array $array of values to replace/add to query
+ * @param bool $onlyquery whether to only return the query string and not
* the complete URL
* @return String
*/
* Offset must be positive but is not capped.
*
* @param $deflimit Integer: limit to use if no input and the user hasn't set the option.
- * @param $optionname String: to specify an option other than rclimit to pull from.
+ * @param string $optionname to specify an option other than rclimit to pull from.
* @return array first element is limit, second is offset
*/
public function getLimitOffset( $deflimit = 50, $optionname = 'rclimit' ) {
/**
* Get a request header, or false if it isn't set
- * @param $name String: case-insensitive header name
+ * @param string $name case-insensitive header name
*
* @return string|bool False on failure
*/
/**
* Get data from $_SESSION
*
- * @param $key String: name of key in $_SESSION
+ * @param string $key name of key in $_SESSION
* @return Mixed
*/
public function getSessionData( $key ) {
/**
* Set session data
*
- * @param $key String: name of key in $_SESSION
+ * @param string $key name of key in $_SESSION
* @param $data Mixed
*/
public function setSessionData( $key, $data ) {
* Constructor. Should only be called by WebRequest
*
* @param $request WebRequest The associated request
- * @param $key string Key in $_FILES array (name of form field)
+ * @param string $key Key in $_FILES array (name of form field)
*/
public function __construct( $request, $key ) {
$this->request = $request;
private $session = array();
/**
- * @param $data Array of *non*-urlencoded key => value pairs, the
+ * @param array $data of *non*-urlencoded key => value pairs, the
* fake GET/POST values
- * @param $wasPosted Bool: whether to treat the data as POST
+ * @param bool $wasPosted whether to treat the data as POST
* @param $session Mixed: session array or null
* @throws MWException
*/
/**
* Output a HTTP header, wrapper for PHP's
* header()
- * @param $string String: header to output
- * @param $replace Bool: replace current similar header
+ * @param string $string header to output
+ * @param bool $replace replace current similar header
* @param $http_response_code null|int Forces the HTTP response code to the specified value.
*/
public function header( $string, $replace = true, $http_response_code = null ) {
/**
* Set the browser cookie
- * @param $name String: name of cookie
- * @param $value String: value to give cookie
- * @param $expire Int: Unix timestamp (in seconds) when the cookie should expire.
+ * @param string $name name of cookie
+ * @param string $value value to give cookie
+ * @param int $expire Unix timestamp (in seconds) when the cookie should expire.
* 0 (the default) causes it to expire $wgCookieExpiration seconds from now.
- * @param $prefix String: Prefix to use, if not $wgCookiePrefix (use '' for no prefix)
- * @param $domain String: Cookie domain to use, if not $wgCookieDomain
+ * @param string $prefix Prefix to use, if not $wgCookiePrefix (use '' for no prefix)
+ * @param string $domain Cookie domain to use, if not $wgCookieDomain
* @param $forceSecure Bool:
* true: force the cookie to be set with the secure attribute
* false: force the cookie to be set without the secure attribute
/**
* Stores a HTTP header
- * @param $string String: header to output
- * @param $replace Bool: replace current similar header
+ * @param string $string header to output
+ * @param bool $replace replace current similar header
* @param $http_response_code null|int 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 $name String: name of cookie
- * @param $value String: value to give cookie
- * @param $expire Int: number of seconds til cookie expires (Default: 0)
+ * @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 $prefix TODO DOCUMENT (Default: null)
* @param $domain TODO DOCUMENT (Default: null)
* @param $forceSecure TODO DOCUMENT (Default: null)
*/
class WikiErrorMsg extends WikiError {
/**
- * @param $message String: wiki message name
+ * @param string $message wiki message name
* @param ... parameters to pass to wfMsg()
*
* @deprecated since 1.17
/**
* Get a WikiReference object for $wikiID
*
- * @param $wikiID String: wiki'd id (generally database name)
+ * @param string $wikiID wiki'd id (generally database name)
* @return WikiReference object or null if the wiki was not found
*/
public static function getWiki( $wikiID ) {
* Convenience to get the wiki's display name
*
* @todo We can give more info than just the wiki id!
- * @param $wikiID String: wiki'd id (generally database name)
+ * @param string $wikiID wiki'd id (generally database name)
* @return string|int Wiki's name or $wiki_id if the wiki was not found
*/
public static function getWikiName( $wikiID ) {
/**
* Convenience to get a link to a user page on a foreign wiki
*
- * @param $wikiID String: wiki'd id (generally database name)
- * @param $user String: user name (must be normalised before calling this function!)
- * @param $text String: link's text; optional, default to "User:$user"
+ * @param string $wikiID wiki'd id (generally database name)
+ * @param string $user user name (must be normalised before calling this function!)
+ * @param string $text link's text; optional, default to "User:$user"
* @return String: HTML link or false if the wiki was not found
*/
public static function foreignUserLink( $wikiID, $user, $text=null ) {
/**
* Convenience to get a link to a page on a foreign wiki
*
- * @param $wikiID String: wiki'd id (generally database name)
- * @param $page String: page name (must be normalised before calling this function!)
- * @param $text String: link's text; optional, default to $page
+ * @param string $wikiID wiki'd id (generally database name)
+ * @param string $page page name (must be normalised before calling this function!)
+ * @param string $text link's text; optional, default to $page
* @return String: HTML link or false if the wiki was not found
*/
public static function makeForeignLink( $wikiID, $page, $text=null ) {
/**
* Convenience to get a url to a page on a foreign wiki
*
- * @param $wikiID String: wiki'd id (generally database name)
- * @param $page String: page name (must be normalised before calling this function!)
+ * @param string $wikiID wiki'd id (generally database name)
+ * @param string $page page name (must be normalised before calling this function!)
* @return String: URL or false if the wiki was not found
*/
public static function getForeignURL( $wikiID, $page ) {
* Helper function for getUrl()
*
* @todo FIXME: This may be generalized...
- * @param $page String: page name (must be normalised before calling this function!)
+ * @param string $page page name (must be normalised before calling this function!)
* @return String: Url fragment
*/
private function getLocalUrl( $page ) {
/**
* Get a canonical (i.e. based on $wgCanonicalServer) URL to a page on this foreign wiki
*
- * @param $page String: page name (must be normalised before calling this function!)
+ * @param string $page page name (must be normalised before calling this function!)
* @return String: Url
*/
public function getCanonicalUrl( $page ) {
* Get a URL based on $wgServer, like Title::getFullUrl() would produce
* when called locally on the wiki.
*
- * @param $page String: page name (must be normalized before calling this function!)
+ * @param string $page page name (must be normalized before calling this function!)
* @return String: URL
*/
public function getFullUrl( $page ) {
/**
* Constructor from a page id
*
- * @param $id Int article ID to load
- * @param $from string|int one of the following values:
+ * @param int $id article ID to load
+ * @param string|int $from one of the following values:
* - "fromdb" or WikiPage::READ_NORMAL to select from a slave database
* - "fromdbmaster" or WikiPage::READ_LATEST to select from the master database
*
* @since 1.20
* @param $row object: database row containing at least fields returned
* by selectFields().
- * @param $from string|int: source of $data:
+ * @param string|int $from source of $data:
* - "fromdb" or WikiPage::READ_NORMAL: from a slave DB
* - "fromdbmaster" or WikiPage::READ_LATEST: from the master DB
* - "forupdate" or WikiPage::READ_LOCKING: from the master DB using SELECT FOR UPDATE
* @since 1.20
* @param $data object: database row containing at least fields returned
* by selectFields()
- * @param $from string|int One of the following:
+ * @param string|int $from One of the following:
* - "fromdb" or WikiPage::READ_NORMAL if the data comes from a slave DB
* - "fromdbmaster" or WikiPage::READ_LATEST if the data comes from the master DB
* - "forupdate" or WikiPage::READ_LOCKING if the data comes from from
/**
* Set the page timestamp (use only to avoid DB queries)
- * @param $ts string MW timestamp of last article revision
+ * @param string $ts MW timestamp of last article revision
* @return void
*/
public function setTimestamp( $ts ) {
/**
* Get the last N authors
* @param $num Integer: number of revisions to get
- * @param $revLatest String: the latest rev_id, selected from the master (optional)
+ * @param string $revLatest the latest rev_id, selected from the master (optional)
* @return array Array of authors, duplicates not removed
*/
public function getLastNAuthors( $num, $revLatest = 0 ) {
/**
* @param $section null|bool|int or a section number (0, 1, 2, T1, T2...)
- * @param $text String: new text of the section
- * @param $sectionTitle String: new section's subject, only if $section is 'new'
- * @param $edittime String: revision timestamp or null to use the current revision
+ * @param string $text new text of the section
+ * @param string $sectionTitle new section's subject, only if $section is 'new'
+ * @param string $edittime revision timestamp or null to use the current revision
* @throws MWException
* @return String new complete article text, or null if error
*
/**
* @param $section null|bool|int or a section number (0, 1, 2, T1, T2...)
* @param $sectionContent Content: new content of the section
- * @param $sectionTitle String: new section's subject, only if $section is 'new'
- * @param $edittime String: revision timestamp or null to use the current revision
+ * @param string $sectionTitle new section's subject, only if $section is 'new'
+ * @param string $edittime revision timestamp or null to use the current revision
*
* @throws MWException
* @return Content new complete article content, or null if error
* Change an existing article or create a new article. Updates RC and all necessary caches,
* optionally via the deferred update array.
*
- * @param $text String: new text
- * @param $summary String: edit summary
+ * @param string $text new text
+ * @param string $summary edit summary
* @param $flags Integer bitfield:
* EDIT_NEW
* Article is known or assumed to be non-existent, create a new one
* optionally via the deferred update array.
*
* @param $content Content: new content
- * @param $summary String: edit summary
+ * @param string $summary edit summary
* @param $flags Integer bitfield:
* EDIT_NEW
* Article is known or assumed to be non-existent, create a new one
*
* @param $revision Revision object
* @param $user User object that did the revision
- * @param $options Array of options, following indexes are used:
+ * @param array $options of options, following indexes are used:
* - changed: boolean, whether the revision changed the content (default true)
* - created: boolean, whether the revision created the page (default false)
* - oldcountable: boolean or null (default null):
* The article must already exist; link tables etc
* are not updated, caches are not flushed.
*
- * @param $text String: text submitted
+ * @param string $text text submitted
* @param $user User The relevant user
- * @param $comment String: comment submitted
+ * @param string $comment comment submitted
* @param $minor Boolean: whereas it's a minor modification
*
* @deprecated since 1.21, use doEditContent() instead.
*
* @param $content Content: content submitted
* @param $user User The relevant user
- * @param $comment String: comment submitted
+ * @param string $comment comment submitted
* @param $serialisation_format String: format for storing the content in the database
* @param $minor Boolean: whereas it's a minor modification
*/
* Update the article's restriction field, and leave a log entry.
* This works for protection both existing and non-existing pages.
*
- * @param $limit Array: set of restriction keys
+ * @param array $limit set of restriction keys
* @param $reason String
* @param &$cascade Integer. Set to false if cascading protection isn't allowed.
- * @param $expiry Array: per restriction type expiration
+ * @param array $expiry per restriction type expiration
* @param $user User The user updating the restrictions
* @return Status
*/
*
* Deletes the article with database consistency, writes logs, purges caches
*
- * @param $reason string delete reason for deletion log
+ * @param string $reason delete reason for deletion log
* @param $suppress boolean suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
- * @param $id int article ID
+ * @param int $id article ID
* @param $commit boolean defaults to true, triggers transaction end
* @param &$error Array of errors to append to
* @param $user User The deleting user
*
* @since 1.19
*
- * @param $reason string delete reason for deletion log
+ * @param string $reason delete reason for deletion log
* @param $suppress boolean suppress all revisions and log the deletion in
* the suppression log instead of the deletion log
- * @param $id int article ID
+ * @param int $id article ID
* @param $commit boolean defaults to true, triggers transaction end
* @param &$error Array of errors to append to
* @param $user User The deleting user
/**
* Do some database updates after deletion
*
- * @param $id Int: page_id value of the page being deleted (B/C, currently unused)
+ * @param int $id page_id value of the page being deleted (B/C, currently unused)
* @param $content Content: optional page content to be used when determining the required updates.
* This may be needed because $this->getContent() may already return null when the page proper was deleted.
*/
*
* @todo: seperate the business/permission stuff out from backend code
*
- * @param $fromP String: Name of the user whose edits to rollback.
- * @param $summary String: Custom summary. Set to default summary if empty.
- * @param $token String: Rollback token.
+ * @param string $fromP Name of the user whose edits to rollback.
+ * @param string $summary Custom summary. Set to default summary if empty.
+ * @param string $token Rollback token.
* @param $bot Boolean: If true, mark all reverted edits as bot.
*
- * @param $resultDetails Array: contains result-specific array of additional values
+ * @param array $resultDetails contains result-specific array of additional values
* 'alreadyrolled' : 'current' (rev)
* success : 'summary' (str), 'current' (rev), 'target' (rev)
*
* rollback to the DB. Therefore, you should only call this function direct-
* ly if you want to use custom permissions checks. If you don't, use
* doRollback() instead.
- * @param $fromP String: Name of the user whose edits to rollback.
- * @param $summary String: Custom summary. Set to default summary if empty.
+ * @param string $fromP Name of the user whose edits to rollback.
+ * @param string $summary Custom summary. Set to default summary if empty.
* @param $bot Boolean: If true, mark all reverted edits as bot.
*
- * @param $resultDetails Array: contains result-specific array of additional values
+ * @param array $resultDetails contains result-specific array of additional values
* @param $guser User The user performing the rollback
* @return array
*/
/**
* Return an applicable autosummary if one exists for the given edit.
- * @param $oldtext String|null: the previous text of the page.
- * @param $newtext String|null: The submitted text of the page.
- * @param $flags Int bitmask: a bitmask of flags submitted for the edit.
+ * @param string|null $oldtext the previous text of the page.
+ * @param string|null $newtext The submitted text of the page.
+ * @param int $flags bitmask: a bitmask of flags submitted for the edit.
* @return string An appropriate autosummary, or an empty string.
*
* @deprecated since 1.21, use ContentHandler::getAutosummary() instead
* Update all the appropriate counts in the category table, given that
* we've added the categories $added and deleted the categories $deleted.
*
- * @param $added array The names of categories that were added
- * @param $deleted array The names of categories that were deleted
+ * @param array $added The names of categories that were added
+ * @param array $deleted The names of categories that were deleted
*/
public function updateCategoryCounts( $added, $deleted ) {
$ns = $this->mTitle->getNamespace();
* so we can do things like signatures and links-in-context.
*
* @deprecated in 1.19; use Parser::preSaveTransform() instead
- * @param $text String article contents
+ * @param string $text article contents
* @param $user User object: user doing the edit
* @param $popts ParserOptions object: parser options, default options for
* the user loaded if null given
* Update the article's restriction field, and leave a log entry.
*
* @deprecated since 1.19
- * @param $limit Array: set of restriction keys
+ * @param array $limit set of restriction keys
* @param $reason String
* @param &$cascade Integer. Set to false if cascading protection isn't allowed.
- * @param $expiry Array: per restriction type expiration
+ * @param array $expiry per restriction type expiration
* @param $user User The user updating the restrictions
* @return bool true on success
*/
* Strings are assumed to not contain XML-illegal characters; special
* characters (<, >, &) are escaped but illegals are not touched.
*
- * @param $element String: element name
- * @param $attribs Array: Name=>value pairs. Values will be escaped.
- * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)
- * @param $allowShortTag Bool: whether '' in $contents will result in a contentless closed tag
+ * @param string $element element name
+ * @param array $attribs Name=>value pairs. Values will be escaped.
+ * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param bool $allowShortTag whether '' in $contents will result in a contentless closed tag
* @return string
*/
public static function element( $element, $attribs = null, $contents = '', $allowShortTag = true ) {
* to set the XML attributes : attributename="value".
* The values are passed to Sanitizer::encodeAttribute.
* Return null if no attributes given.
- * @param $attribs Array of attributes for an XML element
+ * @param array $attribs of attributes for an XML element
* @throws MWException
* @return null|string
*/
* is passed.
*
* @param $element String:
- * @param $attribs Array: Name=>value pairs. Values will be escaped.
- * @param $contents String: NULL to make an open tag only; '' for a contentless closed tag (default)
+ * @param array $attribs Name=>value pairs. Values will be escaped.
+ * @param string $contents NULL to make an open tag only; '' for a contentless closed tag (default)
* @return string
*/
public static function elementClean( $element, $attribs = array(), $contents = '' ) {
/**
* This opens an XML element
*
- * @param $element String name of the element
- * @param $attribs array of attributes, see Xml::expandAttributes()
+ * @param string $element name of the element
+ * @param array $attribs of attributes, see Xml::expandAttributes()
* @return string
*/
public static function openElement( $element, $attribs = null ) {
/**
* Shortcut to close an XML element
- * @param $element String element name
+ * @param string $element element name
* @return string
*/
public static function closeElement( $element ) { return "</$element>"; }
* Same as Xml::element(), but does not escape contents. Handy when the
* content you have is already valid xml.
*
- * @param $element String element name
- * @param $attribs array of attributes
- * @param $contents String content of the element
+ * @param string $element element name
+ * @param array $attribs of attributes
+ * @param string $contents content of the element
* @return string
*/
public static function tags( $element, $attribs = null, $contents ) {
* @param $selected Mixed: Namespace which should be pre-selected
* @param $all Mixed: Value of an item denoting all namespaces, or null to omit
* @param $element_name String: value of the "name" attribute of the select tag
- * @param $label String: optional label to add to the field
+ * @param string $label optional label to add to the field
* @return string
* @deprecated since 1.19
*/
* Create a date selector
*
* @param $selected Mixed: the month which should be selected, default ''
- * @param $allmonths String: value of a special item denoting all month. Null to not include (default)
- * @param $id String: Element identifier
+ * @param string $allmonths value of a special item denoting all month. Null to not include (default)
+ * @param string $id Element identifier
* @return String: Html string containing the month selector
*/
public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) {
/**
* Shortcut to make a span element
- * @param $text String content of the element, will be escaped
- * @param $class String class name of the span element
- * @param $attribs array other attributes
+ * @param string $text content of the element, will be escaped
+ * @param string $class class name of the span element
+ * @param array $attribs other attributes
* @return string
*/
public static function span( $text, $class, $attribs = array() ) {
/**
* Shortcut to make a specific element with a class attribute
- * @param $text string content of the element, will be escaped
- * @param $class string class name of the span element
- * @param $tag string element name
- * @param $attribs array other attributes
+ * @param string $text content of the element, will be escaped
+ * @param string $class class name of the span element
+ * @param string $tag element name
+ * @param array $attribs other attributes
* @return string
*/
public static function wrapClass( $text, $class, $tag = 'span', $attribs = array() ) {
/**
* Convenience function to build an HTML text input field
- * @param $name String value of the name attribute
- * @param $size int value of the size attribute
+ * @param string $name value of the name attribute
+ * @param int $size value of the size attribute
* @param $value mixed value of the value attribute
- * @param $attribs array other attributes
+ * @param array $attribs other attributes
* @return string HTML
*/
public static function input( $name, $size = false, $value = false, $attribs = array() ) {
/**
* Convenience function to build an HTML password input field
- * @param $name string value of the name attribute
- * @param $size int value of the size attribute
+ * @param string $name value of the name attribute
+ * @param int $size value of the size attribute
* @param $value mixed value of the value attribute
- * @param $attribs array other attributes
+ * @param array $attribs other attributes
* @return string HTML
*/
public static function password( $name, $size = false, $value = false, $attribs = array() ) {
/**
* Convenience function to build an HTML checkbox
- * @param $name String value of the name attribute
- * @param $checked Bool Whether the checkbox is checked or not
- * @param $attribs Array other attributes
+ * @param string $name value of the name attribute
+ * @param bool $checked Whether the checkbox is checked or not
+ * @param array $attribs other attributes
* @return string HTML
*/
public static function check( $name, $checked = false, $attribs=array() ) {
/**
* Convenience function to build an HTML radio button
- * @param $name String value of the name attribute
- * @param $value String value of the value attribute
- * @param $checked Bool Whether the checkbox is checked or not
- * @param $attribs Array other attributes
+ * @param string $name value of the name attribute
+ * @param string $value value of the value attribute
+ * @param bool $checked Whether the checkbox is checked or not
+ * @param array $attribs other attributes
* @return string HTML
*/
public static function radio( $name, $value, $checked = false, $attribs = array() ) {
/**
* Convenience function to build an HTML form label
- * @param $label String text of the label
+ * @param string $label text of the label
* @param $id
- * @param $attribs Array an attribute array. This will usuall be
+ * @param array $attribs an attribute array. This will usuall be
* the same array as is passed to the corresponding input element,
* so this function will cherry-pick appropriate attributes to
* apply to the label as well; only class and title are applied.
/**
* Convenience function to build an HTML text input field with a label
- * @param $label String text of the label
- * @param $name String value of the name attribute
- * @param $id String id of the input
- * @param $size Int|Bool value of the size attribute
- * @param $value String|Bool value of the value attribute
- * @param $attribs array other attributes
+ * @param string $label text of the label
+ * @param string $name value of the name attribute
+ * @param string $id id of the input
+ * @param int|Bool $size value of the size attribute
+ * @param string|Bool $value value of the value attribute
+ * @param array $attribs other attributes
* @return string HTML
*/
public static function inputLabel( $label, $name, $id, $size=false, $value=false, $attribs = array() ) {
/**
* Convenience function to build an HTML submit button
- * @param $value String: label text for the button
- * @param $attribs Array: optional custom attributes
+ * @param string $value label text for the button
+ * @param array $attribs optional custom attributes
* @return string HTML
*/
public static function submitButton( $value, $attribs = array() ) {
/**
* Convenience function to build an HTML drop-down list item.
- * @param $text String: text for this item
- * @param $value String: form submission value; if empty, use text
+ * @param string $text text for this item
+ * @param string $value form submission value; if empty, use text
* @param $selected boolean: if true, will be the default selected item
- * @param $attribs array: optional additional HTML attributes
+ * @param array $attribs optional additional HTML attributes
* @return string HTML
*/
public static function option( $text, $value=null, $selected = false,
/**
* Shortcut for creating fieldsets.
*
- * @param $legend string|bool Legend of the fieldset. If evaluates to false, legend is not added.
- * @param $content string Pre-escaped content for the fieldset. If false, only open fieldset is returned.
- * @param $attribs array Any attributes to fieldset-element.
+ * @param string|bool $legend Legend of the fieldset. If evaluates to false, legend is not added.
+ * @param string $content Pre-escaped content for the fieldset. If false, only open fieldset is returned.
+ * @param array $attribs Any attributes to fieldset-element.
*
* @return string
*/
/**
* Shortcut for creating textareas.
*
- * @param $name string The 'name' for the textarea
- * @param $content string Content for the textarea
- * @param $cols int The number of columns for the textarea
- * @param $rows int The number of rows for the textarea
- * @param $attribs array Any other attributes for the textarea
+ * @param string $name The 'name' for the textarea
+ * @param string $content Content for the textarea
+ * @param int $cols The number of columns for the textarea
+ * @param int $rows The number of rows for the textarea
+ * @param array $attribs Any other attributes for the textarea
*
* @return string
*/
* for JavaScript source code.
* Illegal control characters are assumed not to be present.
*
- * @param $string String to escape
+ * @param string $string to escape
* @return String
*/
public static function escapeJsString( $string ) {
* Create a call to a JavaScript function. The supplied arguments will be
* encoded using Xml::encodeJsVar().
*
- * @param $name String The name of the function to call, or a JavaScript expression
+ * @param string $name The name of the function to call, or a JavaScript expression
* which evaluates to a function object which is called.
- * @param $args Array of arguments to pass to the function.
+ * @param array $args of arguments to pass to the function.
*
* @since 1.17
*
* Check if a string is well-formed XML.
* Must include the surrounding tag.
*
- * @param $text String: string to test.
+ * @param string $text string to test.
* @return bool
*
* @todo Error position reporting return
* Replace " > and < with their respective HTML entities ( ",
* >, <)
*
- * @param $in String: text that might contain HTML tags.
+ * @param string $in text that might contain HTML tags.
* @return string Escaped string
*/
public static function escapeTagsOnly( $in ) {
/**
* Generate a form (without the opening form element).
* Output optionally includes a submit button.
- * @param $fields Array Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input.
- * @param $submitLabel String A message containing a label for the submit button.
+ * @param array $fields Associative array, key is message corresponding to a description for the field (colon is in the message), value is appropriate input.
+ * @param string $submitLabel A message containing a label for the submit button.
* @return string HTML form.
*/
public static function buildForm( $fields, $submitLabel = null ) {
/**
* Build a table of data
- * @param $rows array An array of arrays of strings, each to be a row in a table
- * @param $attribs array An array of attributes to apply to the table tag [optional]
- * @param $headers array An array of strings to use as table headers [optional]
+ * @param array $rows An array of arrays of strings, each to be a row in a table
+ * @param array $attribs An array of attributes to apply to the table tag [optional]
+ * @param array $headers An array of strings to use as table headers [optional]
* @return string
*/
public static function buildTable( $rows, $attribs = array(), $headers = null ) {
/**
* Build a row for a table
- * @param $attribs array An array of attributes to apply to the tr tag
- * @param $cells array An array of strings to put in <td>
+ * @param array $attribs An array of attributes to apply to the tr tag
+ * @param array $cells An array of strings to put in <td>
* @return string
*/
public static function buildTableRow( $attribs, $cells ) {
public $rootElement = '';
/**
- * @param $file string filename
+ * @param string $file filename
* @param $filterCallback callable (optional)
* Function to call to do additional custom validity checks from the
* SAX element handler event. This gives you access to the element
/**
* Convert the input to a different language variant
*
- * @param $text String: input text
- * @param $tolang String: language variant
+ * @param string $text input text
+ * @param string $tolang language variant
* @return string the converted text
*/
function convert( $text, $tolang ) {
/**
* Convert the input to all possible variants
*
- * @param $text String: input text
+ * @param string $text input text
* @return array langcode => converted_string
*/
function convertToAllVariants( $text ) {
/**
* Perform word segmentation
*
- * @param $text String: input text
+ * @param string $text input text
* @return string segmented text
*/
function segment( $text ) {
* suspicious or ambiguous input, instead of emulating some standard
* behavior.
*
- * @param $fileName string The archive file name
- * @param $callback Array The callback function. It will be called for each file
+ * @param string $fileName The archive file name
+ * @param array $callback The callback function. It will be called for each file
* with a single associative array each time, with members:
*
* - name: The file name. Directories conventionally have a trailing
*
* - size: The uncompressed file size
*
- * @param $options Array An associative array of read options, with the option
+ * @param array $options An associative array of read options, with the option
* name in the key. This may currently contain:
*
* - zip64: If this is set to true, then we will emulate a
* Get the file contents from a given offset. If there are not enough bytes
* in the file to satisfy the request, an exception will be thrown.
*
- * @param $start int The byte offset of the start of the block.
- * @param $length int The number of bytes to return. If omitted, the remainder
+ * @param int $start The byte offset of the start of the block.
+ * @param int $length The number of bytes to return. If omitted, the remainder
* of the file will be returned.
*
* @return string
* Unpack a binary structure. This is like the built-in unpack() function
* except nicer.
*
- * @param $string string The binary data input
+ * @param string $string The binary data input
*
- * @param $struct array An associative array giving structure members and their
+ * @param array $struct An associative array giving structure members and their
* types. In the key is the field name. The value may be either an
* integer, in which case the field is a little-endian unsigned integer
* encoded in the given number of bytes, or an array, in which case the
* - "string": The second array element gives the length of string.
* Not null terminated.
*
- * @param $offset int The offset into the string at which to start unpacking.
+ * @param int $offset The offset into the string at which to start unpacking.
*
* @throws MWException
* @return array Unpacked associative array. Note that large integers in the input
* boolean.
*
* @param $value integer
- * @param $bitIndex int The index of the bit, where 0 is the LSB.
+ * @param int $bitIndex The index of the bit, where 0 is the LSB.
* @return bool
*/
function testBit( $value, $bitIndex ) {
/**
* Get a list of contributors
*
- * @param $cnt Int: maximum list of contributors to show
- * @param $showIfMax Bool: whether to contributors if there more than $cnt
+ * @param int $cnt maximum list of contributors to show
+ * @param bool $showIfMax whether to contributors if there more than $cnt
* @return String: html
*/
public function getCredits( $cnt, $showIfMax = true ) {
/**
* Get a list of contributors of $article
- * @param $cnt Int: maximum list of contributors to show
- * @param $showIfMax Bool: whether to contributors if there more than $cnt
+ * @param int $cnt maximum list of contributors to show
+ * @param bool $showIfMax whether to contributors if there more than $cnt
* @return String: html
*/
protected function getContributors( $cnt, $showIfMax ) {
/**
* Output a subscription feed listing recent edits to this page.
*
- * @param $type String: feed type
+ * @param string $type feed type
*/
function feed( $type ) {
global $wgFeedClasses, $wgFeedLimit;
/**
* Creates a submit button
*
- * @param $message String: text of the submit button, will be escaped
- * @param $attributes Array: attributes
+ * @param string $message text of the submit button, will be escaped
+ * @param array $attributes attributes
* @return String: HTML output for the submit button
*/
function submitButton( $message, $attributes = array() ) {
/**
* Adds a row to a table that will be added to the content.
*
- * @param $table string The table that will be added to the content
- * @param $name string The name of the row
- * @param $value string The value of the row
+ * @param string $table The table that will be added to the content
+ * @param string $name The name of the row
+ * @param string $value The value of the row
* @return string The table with the row added
*/
protected function addRow( $table, $name, $value ) {
/**
* Adds a table to the content that will be added to the output.
*
- * @param $content string The content that will be added to the output
- * @param $table string The table
+ * @param string $content The content that will be added to the output
+ * @param string $table The table
* @return string The content with the table added
*/
protected function addTable( $content, $table ) {
/**
* Constructor
* @param $mainModule ApiMain object
- * @param $moduleName string Name of this module
- * @param $modulePrefix string Prefix to use for parameter names
+ * @param string $moduleName Name of this module
+ * @param string $modulePrefix Prefix to use for parameter names
*/
public function __construct( $mainModule, $moduleName, $modulePrefix = '' ) {
$this->mMainModule = $mainModule;
* section to notice any changes in API. Multiple calls to this
* function will result in the warning messages being separated by
* newlines
- * @param $warning string Warning message
+ * @param string $warning Warning message
*/
public function setWarning( $warning ) {
$result = $this->getResult();
}
/**
- * @param $prefix string Text to split output items
- * @param $title string What is being output
+ * @param string $prefix Text to split output items
+ * @param string $title What is being output
* @param $input string|array
* @return string
*/
* Get final list of parameters, after hooks have had a chance to
* tweak it as needed.
*
- * @param $flags int Zero or more flags like GET_VALUES_FOR_HELP
+ * @param int $flags Zero or more flags like GET_VALUES_FOR_HELP
* @return array|Bool False on no parameters
* @since 1.21 $flags param added
*/
/**
* This method mangles parameter name based on the prefix supplied to the constructor.
* Override this method to change parameter name during runtime
- * @param $paramName string Parameter name
+ * @param string $paramName Parameter name
* @return string Prefixed parameter name
*/
public function encodeParamName( $paramName ) {
/**
* Get a value for the given parameter
- * @param $paramName string Parameter name
- * @param $parseLimit bool see extractRequestParams()
+ * @param string $paramName Parameter name
+ * @param bool $parseLimit see extractRequestParams()
* @return mixed Parameter value
*/
protected function getParameter( $paramName, $parseLimit = true ) {
/**
* Die if none or more than one of a certain set of parameters is set and not false.
- * @param $params array of parameter names
+ * @param array $params of parameter names
*/
public function requireOnlyOneParameter( $params ) {
$required = func_get_args();
/**
* @param $params array
- * @param $load bool|string Whether load the object's state from the database:
+ * @param bool|string $load Whether load the object's state from the database:
* - false: don't load (if the pageid is given, it will still be loaded)
* - 'fromdb': load from a slave database
* - 'fromdbmaster': load from the master database
/**
* Return true if we're to watch the page, false if not, null if no change.
- * @param $watchlist String Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
+ * @param string $watchlist Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param $titleObj Title the page under consideration
- * @param $userOption String The user option to consider when $watchlist=preferences.
+ * @param string $userOption The user option to consider when $watchlist=preferences.
* If not set will magically default to either watchdefault or watchcreations
* @return bool
*/
/**
* Set a watch (or unwatch) based the based on a watchlist parameter.
- * @param $watch String Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
+ * @param string $watch Valid values: 'watch', 'unwatch', 'preferences', 'nochange'
* @param $titleObj Title the article's title to change
- * @param $userOption String The user option to consider when $watch=preferences
+ * @param string $userOption The user option to consider when $watch=preferences
*/
protected function setWatch( $watch, $titleObj, $userOption = null ) {
$value = $this->getWatchlistValue( $watch, $titleObj, $userOption );
/**
* Using the settings determine the value for the given parameter
*
- * @param $paramName String: parameter name
- * @param $paramSettings array|mixed default value or an array of settings
+ * @param string $paramName parameter name
+ * @param array|mixed $paramSettings default value or an array of settings
* using PARAM_* constants.
* @param $parseLimit Boolean: parse limit?
* @return mixed Parameter value
* Return an array of values that were given in a 'a|b|c' notation,
* after it optionally validates them against the list allowed values.
*
- * @param $valueName string The name of the parameter (for error
+ * @param string $valueName The name of the parameter (for error
* reporting)
* @param $value mixed The value being parsed
- * @param $allowMultiple bool Can $value contain more than one value
+ * @param bool $allowMultiple Can $value contain more than one value
* separated by '|'?
* @param $allowedValues mixed An array of values to check against. If
* null, all values are accepted.
/**
* Validate the value against the minimum and user/bot maximum limits.
* Prints usage info on failure.
- * @param $paramName string Parameter name
- * @param $value int Parameter value
- * @param $min int|null Minimum value
- * @param $max int|null Maximum value for users
- * @param $botMax int Maximum value for sysops/bots
+ * @param string $paramName Parameter name
+ * @param int $value Parameter value
+ * @param int|null $min Minimum value
+ * @param int|null $max Maximum value for users
+ * @param int $botMax Maximum value for sysops/bots
* @param $enforceLimits Boolean Whether to enforce (die) if value is outside limits
*/
function validateLimit( $paramName, &$value, $min, $max, $botMax = null, $enforceLimits = false ) {
/**
* Validate and normalize of parameters of type 'timestamp'
- * @param $value string Parameter value
- * @param $encParamName string Parameter name
+ * @param string $value Parameter value
+ * @param string $encParamName Parameter name
* @return string Validated and normalized parameter
*/
function validateTimestamp( $value, $encParamName ) {
/**
* Validate and normalize of parameters of type 'user'
- * @param $value string Parameter value
- * @param $encParamName string Parameter value
+ * @param string $value Parameter value
+ * @param string $encParamName Parameter value
* @return string Validated and normalized parameter
*/
private function validateUser( $value, $encParamName ) {
/**
* Truncate an array to a certain length.
- * @param $arr array Array to truncate
- * @param $limit int Maximum length
+ * @param array $arr Array to truncate
+ * @param int $limit Maximum length
* @return bool True if the array was truncated, false otherwise
*/
public static function truncateArray( &$arr, $limit ) {
* Throw a UsageException, which will (if uncaught) call the main module's
* error handler and die with an error message.
*
- * @param $description string One-line human-readable description of the
+ * @param string $description One-line human-readable description of the
* error condition, e.g., "The API requires a valid action parameter"
- * @param $errorCode string Brief, arbitrary, stable string to allow easy
+ * @param string $errorCode Brief, arbitrary, stable string to allow easy
* automated identification of the error, e.g., 'unknown_action'
- * @param $httpRespCode int HTTP response code
- * @param $extradata array Data to add to the "<error>" element; array in ApiResult format
+ * @param int $httpRespCode HTTP response code
+ * @param array $extradata Data to add to the "<error>" element; array in ApiResult format
* @throws UsageException
*/
public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
/**
* Return the error message related to a certain array
- * @param $error array Element of a getUserPermissionsErrors()-style array
+ * @param array $error Element of a getUserPermissionsErrors()-style array
* @return array('code' => code, 'info' => info)
*/
public function parseMsg( $error ) {
/**
* Internal code errors should be reported with this method
- * @param $method string Method or function name
- * @param $message string Error message
+ * @param string $method Method or function name
+ * @param string $message Error message
*/
protected static function dieDebug( $method, $message ) {
wfDebugDieBacktrace( "Internal error in $method: $message" );
/**
* Parses a list of errors into a standardised format
- * @param $errors array List of errors. Items can be in the for array( key, param1, param2, ... ) or array( 'code' => ..., 'info' => ... )
+ * @param array $errors List of errors. Items can be in the for array( key, param1, param2, ... ) or array( 'code' => ..., 'info' => ... )
* @return array Parsed list of errors with items in the form array( 'code' => ..., 'info' => ... )
*/
public function parseErrors( $errors ) {
/**
* Debugging function that prints a value and an optional backtrace
* @param $value mixed Value to print
- * @param $name string Description of the printed value
- * @param $backtrace bool If true, print a backtrace
+ * @param string $name Description of the printed value
+ * @param bool $backtrace If true, print a backtrace
*/
public static function debugPrint( $value, $name = 'unknown', $backtrace = false ) {
print "\n\n<pre><b>Debugging value '$name':</b>\n\n";
*
* @param $page Page|WikiPage object to work on
* @param $user User doing the action
- * @param $token String delete token (same as edit token)
- * @param $reason String|null reason for the deletion. Autogenerated if NULL
+ * @param string $token delete token (same as edit token)
+ * @param string|null $reason reason for the deletion. Autogenerated if NULL
* @return Status|array
*/
public static function delete( Page $page, User $user, $token, &$reason = null ) {
* Constructor
* If $format ends with 'fm', pretty-print the output in HTML.
* @param $main ApiMain
- * @param $format string Format name
+ * @param string $format Format name
*/
public function __construct( $main, $format ) {
parent::__construct( $main, $format );
* special-case fix that should be removed once the help has been
* reworked to use a fully HTML interface.
*
- * @param $b bool Whether or not ampersands should be escaped.
+ * @param bool $b Whether or not ampersands should be escaped.
*/
public function setUnescapeAmps ( $b ) {
$this->mUnescapeAmps = $b;
* A human-targeted notice about available formats is printed for the HTML-based output,
* except for help screens (caused by either an error in the API parameters,
* the calling of action=help, or requesting the root script api.php).
- * @param $isHelpScreen bool Whether a help screen is going to be shown
+ * @param bool $isHelpScreen Whether a help screen is going to be shown
*/
function initPrinter( $isHelpScreen ) {
if ( $this->mDisabled ) {
* Call this method to initialize output data. See execute()
* @param $result ApiResult
* @param $feed object an instance of one of the $wgFeedClasses classes
- * @param $feedItems array of FeedItem objects
+ * @param array $feedItems of FeedItem objects
*/
public static function setResult( $result, $feed, $feedItems ) {
// Store output in the Result data.
/**
* Add all items from $values into the result
- * @param $result array output
- * @param $values array values to add
- * @param $flag string the name of the boolean flag to mark this element
- * @param $name string if given, name of the value
+ * @param array $result output
+ * @param array $values values to add
+ * @param string $flag the name of the boolean flag to mark this element
+ * @param string $name if given, name of the value
*/
private static function addValues( array &$result, $values, $flag = null, $name = null ) {
foreach ( $values as $val ) {
* Constructs an instance of ApiMain that utilizes the module and format specified by $request.
*
* @param $context IContextSource|WebRequest - if this is an instance of FauxRequest, errors are thrown and no printing occurs
- * @param $enableWrite bool should be set to true if the api may modify data
+ * @param bool $enableWrite should be set to true if the api may modify data
*/
public function __construct( $context = null, $enableWrite = false ) {
if ( $context === null ) {
/**
* Set the type of caching headers which will be sent.
*
- * @param $mode String One of:
+ * @param string $mode One of:
* - 'public': Cache this object in public caches, if the maxage or smaxage
* parameter is set, or if setCacheMaxAge() was called. If a maximum age is
* not provided by any of these means, the object will be private.
/**
* Attempt to match an Origin header against a set of rules and a set of exceptions
- * @param $value string Origin header
- * @param $rules array Set of wildcard rules
- * @param $exceptions array Set of wildcard rules
+ * @param string $value Origin header
+ * @param array $rules Set of wildcard rules
+ * @param array $exceptions Set of wildcard rules
* @return bool True if $value matches a rule in $rules and doesn't match any rules in $exceptions, false otherwise
*/
protected static function matchOrigin( $value, $rules, $exceptions ) {
* '*' => '.*?'
* '?' => '.'
*
- * @param $wildcard string String with wildcards
+ * @param string $wildcard String with wildcards
* @return string Regular expression
*/
protected static function wildcardToRegex( $wildcard ) {
/**
* Check the max lag if necessary
* @param $module ApiBase object: Api module being used
- * @param $params Array an array containing the request parameters.
+ * @param array $params an array containing the request parameters.
* @return boolean True on success, false should exit immediately
*/
protected function checkMaxLag( $module, $params ) {
/**
* Check POST for external response and setup result printer
* @param $module ApiBase An Api module
- * @param $params Array an array with the request parameters
+ * @param array $params an array with the request parameters
*/
protected function setupExternalResponse( $module, $params ) {
if ( !$this->getRequest()->wasPosted() && $module->mustBePosted() ) {
* Get a request upload, and register the fact that it was used, for logging.
*
* @since 1.21
- * @param $name string Parameter name
+ * @param string $name Parameter name
* @return WebRequestUpload
*/
public function getUpload( $name ) {
/**
* @param $module ApiBase
- * @param $paramName String What type of request is this? e.g. action, query, list, prop, meta, format
+ * @param string $paramName What type of request is this? e.g. action, query, list, prop, meta, format
* @return string
*/
public static function makeHelpMsgHeader( $module, $paramName ) {
* behavior of inherent ones.
*
* @deprecated since 1.21, Use getModuleManager()->addModule() instead.
- * @param $name string The identifier for this module.
+ * @param string $name The identifier for this module.
* @param $class ApiBase The class where this module is implemented.
*/
protected function addModule( $name, $class ) {
* classes who wish to add to or modify current formatters.
*
* @deprecated since 1.21, Use getModuleManager()->addModule() instead.
- * @param $name string The identifier for this format.
+ * @param string $name The identifier for this format.
* @param $class ApiFormatBase The class implementing this format.
*/
protected function addFormat( $name, $class ) {
* classes who wish to add their own modules to their lexicon or override the
* behavior of inherent ones.
*
- * @param $group string Name of the module group
- * @param $name string The identifier for this module.
- * @param $class string The class where this module is implemented.
+ * @param string $group Name of the module group
+ * @param string $name The identifier for this module.
+ * @param string $class The class where this module is implemented.
*/
public function addModule( $name, $group, $class ) {
$this->mGroups[$group] = null;
/**
* Get module instance by name, or instantiate it if it does not exist
- * @param $moduleName string module name
- * @param $group string optionally validate that the module is in a specific group
- * @param $ignoreCache bool if true, force-creates a new instance and does not cache it
+ * @param string $moduleName module name
+ * @param string $group optionally validate that the module is in a specific group
+ * @param bool $ignoreCache if true, force-creates a new instance and does not cache it
* @return mixed the new module instance, or null if failed
*/
public function getModule( $moduleName, $group = null, $ignoreCache = false ) {
* Constructor
* @param $dbSource ApiBase Module implementing getDB().
* Allows PageSet to reuse existing db connection from the shared state like ApiQuery.
- * @param $flags int Zero or more flags like DISABLE_GENERATORS
- * @param $defaultNamespace int the namespace to use if none is specified by a prefix.
+ * @param int $flags Zero or more flags like DISABLE_GENERATORS
+ * @param int $defaultNamespace the namespace to use if none is specified by a prefix.
* @since 1.21 accepts $flags instead of two boolean values
*/
public function __construct( ApiBase $dbSource, $flags = 0, $defaultNamespace = NS_MAIN ) {
/**
* Request an additional field from the page table.
* Must be called before execute()
- * @param $fieldName string Field name
+ * @param string $fieldName Field name
*/
public function requestField( $fieldName ) {
$this->mRequestedPageFields[$fieldName] = null;
/**
* Get the value of a custom field previously requested through
* requestField()
- * @param $fieldName string Field name
+ * @param string $fieldName Field name
* @return mixed Field value
*/
public function getCustomField( $fieldName ) {
/**
* Populate this PageSet from a list of Titles
- * @param $titles array of Title objects
+ * @param array $titles of Title objects
*/
public function populateFromTitles( $titles ) {
$this->profileIn();
/**
* Populate this PageSet from a list of page IDs
- * @param $pageIDs array of page IDs
+ * @param array $pageIDs of page IDs
*/
public function populateFromPageIDs( $pageIDs ) {
$this->profileIn();
/**
* Populate this PageSet from a list of revision IDs
- * @param $revIDs array of revision IDs
+ * @param array $revIDs of revision IDs
*/
public function populateFromRevisionIDs( $revIDs ) {
$this->profileIn();
* #5 Substitute the original LinkBatch object with the new list
* #6 Repeat from step #1
*
- * @param $titles array of Title objects or strings
+ * @param array $titles of Title objects or strings
*/
private function initFromTitles( $titles ) {
// Get validated and normalized title objects
/**
* Does the same as initFromTitles(), but is based on page IDs instead
- * @param $pageids array of page IDs
+ * @param array $pageids of page IDs
*/
private function initFromPageIds( $pageids ) {
if ( !$pageids ) {
* Iterate through the result of the query on 'page' table,
* and for each row create and store title object and save any extra fields requested.
* @param $res ResultWrapper DB Query result
- * @param $remaining array of either pageID or ns/title elements (optional).
+ * @param array $remaining of either pageID or ns/title elements (optional).
* If given, any missing items will go to $mMissingPageIDs and $mMissingTitles
- * @param $processTitles bool Must be provided together with $remaining.
+ * @param bool $processTitles Must be provided together with $remaining.
* If true, treat $remaining as an array of [ns][title]
* If false, treat it as an array of [pageIDs]
*/
/**
* Does the same as initFromTitles(), but is based on revision IDs
* instead
- * @param $revids array of revision IDs
+ * @param array $revids of revision IDs
*/
private function initFromRevIDs( $revids ) {
if ( !$revids ) {
* This method validates access rights for the title,
* and appends normalization values to the output.
*
- * @param $titles array of Title objects or strings
+ * @param array $titles of Title objects or strings
* @return LinkBatch
*/
private function processTitlesArray( $titles ) {
/**
* Add all items from $values into the result
- * @param $result array output
- * @param $values array values to add
- * @param $flag string the name of the boolean flag to mark this element
- * @param $name string if given, name of the value
+ * @param array $result output
+ * @param array $values values to add
+ * @param string $flag the name of the boolean flag to mark this element
+ * @param string $name if given, name of the value
*/
private static function addValues( array &$result, $values, $flag = null, $name = null ) {
foreach ( $values as $val ) {
* If no such connection has been requested before, it will be created.
* Subsequent calls with the same $name will return the same connection
* as the first, regardless of the values of $db and $groups
- * @param $name string Name to assign to the database connection
- * @param $db int One of the DB_* constants
- * @param $groups array Query groups
+ * @param string $name Name to assign to the database connection
+ * @param int $db One of the DB_* constants
+ * @param array $groups Query groups
* @return DatabaseBase
*/
public function getNamedDB( $name, $db, $groups ) {
/**
* Get whether the specified module is a prop, list or a meta query module
* @deprecated since 1.21, use getModuleManager()->getModuleGroup()
- * @param $moduleName string Name of the module to find type for
+ * @param string $moduleName Name of the module to find type for
* @return mixed string or null
*/
function getModuleType( $moduleName ) {
/**
* Create instances of all modules requested by the client
- * @param $modules Array to append instantiated modules to
- * @param $param string Parameter name to read modules from
+ * @param array $modules to append instantiated modules to
+ * @param string $param Parameter name to read modules from
*/
private function instantiateModules( &$modules, $param ) {
if ( isset( $this->mParams[$param] ) ) {
/**
* For all modules of a given group, generate help messages and join them together
- * @param $group string Module group
+ * @param string $group Module group
* @return string
*/
private function makeHelpMsgHelper( $group ) {
/**
* This function converts the user name to a canonical form
* which is stored in the database.
- * @param String $name
+ * @param string $name
* @return String
*/
private function getCanonicalUserName( $name ) {
/**
* Add a set of fields to select to the internal array
- * @param $value array|string Field name or array of field names
+ * @param array|string $value Field name or array of field names
*/
protected function addFields( $value ) {
if ( is_array( $value ) ) {
/**
* Same as addFields(), but add the fields only if a condition is met
- * @param $value array|string See addFields()
- * @param $condition bool If false, do nothing
+ * @param array|string $value See addFields()
+ * @param bool $condition If false, do nothing
* @return bool $condition
*/
protected function addFieldsIf( $value, $condition ) {
/**
* Same as addWhere(), but add the WHERE clauses only if a condition is met
* @param $value mixed See addWhere()
- * @param $condition bool If false, do nothing
+ * @param bool $condition If false, do nothing
* @return bool $condition
*/
protected function addWhereIf( $value, $condition ) {
/**
* Equivalent to addWhere(array($field => $value))
- * @param $field string Field name
- * @param $value string Value; ignored if null or empty array;
+ * @param string $field Field name
+ * @param string $value Value; ignored if null or empty array;
*/
protected function addWhereFld( $field, $value ) {
// Use count() to its full documented capabilities to simultaneously
/**
* Add a WHERE clause corresponding to a range, and an ORDER BY
* clause to sort in the right direction
- * @param $field string Field name
- * @param $dir string If 'newer', sort in ascending order, otherwise
+ * @param string $field Field name
+ * @param string $dir If 'newer', sort in ascending order, otherwise
* sort in descending order
- * @param $start string Value to start the list at. If $dir == 'newer'
+ * @param string $start Value to start the list at. If $dir == 'newer'
* this is the lower boundary, otherwise it's the upper boundary
- * @param $end string Value to end the list at. If $dir == 'newer' this
+ * @param string $end Value to end the list at. If $dir == 'newer' this
* is the upper boundary, otherwise it's the lower boundary
- * @param $sort bool If false, don't add an ORDER BY clause
+ * @param bool $sort If false, don't add an ORDER BY clause
*/
protected function addWhereRange( $field, $dir, $start, $end, $sort = true ) {
$isDirNewer = ( $dir === 'newer' );
/**
* Add an option such as LIMIT or USE INDEX. If an option was set
* before, the old value will be overwritten
- * @param $name string Option name
- * @param $value string Option value
+ * @param string $name Option name
+ * @param string $value Option value
*/
protected function addOption( $name, $value = null ) {
if ( is_null( $value ) ) {
/**
* Execute a SELECT query based on the values in the internal arrays
- * @param $method string Function the query should be attributed to.
+ * @param string $method Function the query should be attributed to.
* You should usually use __METHOD__ here
- * @param $extraQuery array Query data to add but not store in the object
+ * @param array $extraQuery Query data to add but not store in the object
* Format is array( 'tables' => ..., 'fields' => ..., 'where' => ..., 'options' => ..., 'join_conds' => ... )
* @return ResultWrapper
*/
/**
* Add information (title and namespace) about a Title object to a
* result array
- * @param $arr array Result array à la ApiResult
+ * @param array $arr Result array à la ApiResult
* @param $title Title
- * @param $prefix string Module prefix
+ * @param string $prefix Module prefix
*/
public static function addTitleInfo( &$arr, $title, $prefix = '' ) {
$arr[$prefix . 'ns'] = intval( $title->getNamespace() );
/**
* Add a sub-element under the page element with the given page ID
- * @param $pageId int Page ID
- * @param $data array Data array à la ApiResult
+ * @param int $pageId Page ID
+ * @param array $data Data array à la ApiResult
* @return bool Whether the element fit in the result
*/
protected function addPageSubItems( $pageId, $data ) {
/**
* Same as addPageSubItems(), but one element of $data at a time
- * @param $pageId int Page ID
- * @param $item array Data array à la ApiResult
- * @param $elemname string XML element name. If null, getModuleName()
+ * @param int $pageId Page ID
+ * @param array $item Data array à la ApiResult
+ * @param string $elemname XML element name. If null, getModuleName()
* is used
* @return bool Whether the element fit in the result
*/
/**
* Set a query-continue value
- * @param $paramName string Parameter name
- * @param $paramValue string Parameter value
+ * @param string $paramName Parameter name
+ * @param string $paramValue Parameter value
*/
protected function setContinueEnumParameter( $paramName, $paramValue ) {
$paramName = $this->encodeParamName( $paramName );
/**
* Selects the query database connection with the given name.
* See ApiQuery::getNamedDB() for more information
- * @param $name string Name to assign to the database connection
- * @param $db int One of the DB_* constants
- * @param $groups array Query groups
+ * @param string $name Name to assign to the database connection
+ * @param int $db One of the DB_* constants
+ * @param array $groups Query groups
* @return DatabaseBase
*/
public function selectNamedDB( $name, $db, $groups ) {
/**
* Convert a title to a DB key
- * @param $title string Page title with spaces
+ * @param string $title Page title with spaces
* @return string Page title with underscores
*/
public function titleToKey( $title ) {
/**
* The inverse of titleToKey()
- * @param $key string Page title with underscores
+ * @param string $key Page title with underscores
* @return string Page title with spaces
*/
public function keyToTitle( $key ) {
/**
* An alternative to titleToKey() that doesn't trim trailing spaces
- * @param $titlePart string Title part with spaces
+ * @param string $titlePart Title part with spaces
* @return string Title part with underscores
*/
public function titlePartToKey( $titlePart ) {
/**
* An alternative to keyToTitle() that doesn't trim trailing spaces
- * @param $keyPart string Key part with spaces
+ * @param string $keyPart Key part with spaces
* @return string Key part with underscores
*/
public function keyPartToTitle( $keyPart ) {
/**
* Overrides base class to prepend 'g' to every generator parameter
- * @param $paramName string Parameter name
+ * @param string $paramName Parameter name
* @return string Prefixed parameter name
*/
public function encodeParamName( $paramName ) {
/**
* Overrides base in case of generator & smart continue to
* notify ApiQueryMain instead of adding them to the result right away.
- * @param $paramName string Parameter name
- * @param $paramValue string Parameter value
+ * @param string $paramName Parameter name
+ * @param string $paramValue Parameter value
*/
protected function setContinueEnumParameter( $paramName, $paramValue ) {
// If this is a generator and query->setGeneratorContinue() returns false, treat as before
/**
* From parameters, construct a 'scale' array
- * @param $params Array: Parameters passed to api.
+ * @param array $params Parameters passed to api.
* @return Array or Null: key-val array of 'width' and 'height', or null
*/
public function getScale( $params ) {
* We do this later than getScale, since we need the image
* to know which handler, since handlers can make their own parameters.
* @param File $image Image that params are for.
- * @param Array $thumbParams thumbnail parameters from getScale
- * @param String $otherParams of otherParams (iiurlparam).
+ * @param array $thumbParams thumbnail parameters from getScale
+ * @param string $otherParams of otherParams (iiurlparam).
* @return Array of parameters for transform.
*/
protected function mergeThumbParams ( $image, $thumbParams, $otherParams ) {
* Get result information for an image revision
*
* @param $file File object
- * @param $prop Array of properties to get (in the keys)
+ * @param array $prop of properties to get (in the keys)
* @param $result ApiResult object
- * @param $thumbParams Array containing 'width' and 'height' items, or null
- * @param $version string Version of image metadata (for things like jpeg which have different versions).
+ * @param array $thumbParams containing 'width' and 'height' items, or null
+ * @param string $version Version of image metadata (for things like jpeg which have different versions).
* @return Array: result array
*/
static function getInfo( $file, $prop, $result, $thumbParams = null, $version = 'latest' ) {
/**
* Get a result array with information about a title
- * @param $pageid int Page ID (negative for missing titles)
+ * @param int $pageid Page ID (negative for missing titles)
* @param $title Title object
* @return array
*/
/**
* Sets internal state to include the desired properties in the output.
- * @param $prop Array associative array of properties, only keys are used here
+ * @param array $prop associative array of properties, only keys are used here
*/
public function initProperties( $prop ) {
$this->fld_comment = isset( $prop['comment'] );
/**
* Add an output value to the array by name.
* Verifies that value with the same name has not been added before.
- * @param $arr array to add $value to
- * @param $name string Index of $arr to add $value at
+ * @param array $arr to add $value to
+ * @param string $name Index of $arr to add $value at
* @param $value mixed
- * @param $flags int Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This parameter used to be
+ * @param int $flags Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This parameter used to be
* boolean, and the value of OVERRIDE=1 was specifically chosen so that it would be backwards
* compatible with the new method signature.
*
/**
* Adds a content element to an array.
* Use this function instead of hardcoding the '*' element.
- * @param $arr array to add the content element to
+ * @param array $arr to add the content element to
* @param $value Mixed
- * @param $subElemName string when present, content element is created
+ * @param string $subElemName when present, content element is created
* as a sub item of $arr. Use this parameter to create elements in
* format "<elem>text</elem>" without attributes.
*/
* give all indexed values the given tag name. This function MUST be
* called on every array that has numerical indexes.
* @param $arr array
- * @param $tag string Tag name
+ * @param string $tag Tag name
*/
public function setIndexedTagName( &$arr, $tag ) {
// In raw mode, add the '_element', otherwise just ignore
/**
* Calls setIndexedTagName() on each sub-array of $arr
* @param $arr array
- * @param $tag string Tag name
+ * @param string $tag Tag name
*/
public function setIndexedTagName_recursive( &$arr, $tag ) {
if ( !is_array( $arr ) ) {
* Calls setIndexedTagName() on an array already in the result.
* Don't specify a path to a value that's not in the result, or
* you'll get nasty errors.
- * @param $path array Path to the array, like addValue()'s $path
+ * @param array $path Path to the array, like addValue()'s $path
* @param $tag string
*/
public function setIndexedTagName_internal( $path, $tag ) {
* @param $path array|string|null
* @param $name string
* @param $value mixed
- * @param $flags int Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This parameter used to be
+ * @param int $flags Zero or more OR-ed flags like OVERRIDE | ADD_ON_TOP. This parameter used to be
* boolean, and the value of OVERRIDE=1 was specifically chosen so that it would be backwards
* compatible with the new method signature.
* @return bool True if $value fits in the result, false if not
/**
* Get Stash Result, throws an exception if the file could not be stashed.
- * @param $warnings array Array of Api upload warnings
+ * @param array $warnings Array of Api upload warnings
* @return array
*/
private function getStashResult( $warnings ) {
/**
* Get Warnings Result
- * @param $warnings array Array of Api upload warnings
+ * @param array $warnings Array of Api upload warnings
* @return array
*/
private function getWarningsResult( $warnings ) {
/**
* Get the result of a chunk upload.
- * @param $warnings array Array of Api upload warnings
+ * @param array $warnings Array of Api upload warnings
* @return array
*/
private function getChunkResult( $warnings ) {
* Throw an error that the user can recover from by providing a better
* value for $parameter
*
- * @param $error array Error array suitable for passing to dieUsageMsg()
- * @param $parameter string Parameter that needs revising
- * @param $data array Optional extra data to pass to the user
+ * @param array $error Error array suitable for passing to dieUsageMsg()
+ * @param string $parameter Parameter that needs revising
+ * @param array $data Optional extra data to pass to the user
* @throws UsageException
*/
private function dieRecoverableError( $error, $parameter, $data = array() ) {
* Perform the actual upload. Returns a suitable result array on success;
* dies on failure.
*
- * @param $warnings array Array of Api upload warnings
+ * @param array $warnings Array of Api upload warnings
* @return array
*/
protected function performUpload( $warnings ) {
* Returns an array giving the start and end of each range. The first
* batch has a start of false, and the last batch has an end of false.
*
- * @param $table String: the links table name
+ * @param string $table the links table name
* @param $batchSize Integer
* @return Array
*/
* calculated value will be stored to the cache in a wrapper.
*
* @param $cache BagOStuff a cache object such as $wgMemc
- * @param $key String: the cache key
+ * @param string $key the cache key
* @param $expiry Integer: the expiry timestamp or interval in seconds
* @param $callback Mixed: the callback for generating the value, or false
- * @param $callbackParams Array: the function parameters for the callback
- * @param $deps Array: the dependencies to store on a cache miss. Note: these
+ * @param array $callbackParams the function parameters for the callback
+ * @param array $deps the dependencies to store on a cache miss. Note: these
* are not the dependencies used on a cache hit! Cache hits use the stored
* dependency array.
*
/**
* Create a file dependency
*
- * @param $filename String: the name of the file, preferably fully qualified
+ * @param string $filename the name of the file, preferably fully qualified
* @param $timestamp Mixed: the unix last modified timestamp, or false if the
* file does not exist. If omitted, the timestamp will be loaded from
* the file.
/**
* Check if up to date cache file exists
- * @param $timestamp string MW_TS timestamp
+ * @param string $timestamp MW_TS timestamp
*
* @return bool
*/
/**
* Returns the gender for given username.
- * @param $username String or User: username
- * @param $caller String: the calling method
+ * @param string $username or User: username
+ * @param string $caller the calling method
* @return String
*/
public function getGenderOf( $username, $caller = '' ) {
*
* @since 1.20
* @param $titles List: array of Title objects or strings
- * @param $caller String: the calling method
+ * @param string $caller the calling method
*/
public function doTitlesArray( $titles, $caller = '' ) {
$users = array();
/**
* Preloads genders for given list of users.
* @param $users List|String: usernames
- * @param $caller String: the calling method
+ * @param string $caller the calling method
*/
public function doQuery( $users, $caller = '' ) {
$default = $this->getDefault();
/**
* Construct a WHERE clause which will match all the given titles.
*
- * @param $prefix String: the appropriate table's field name prefix ('page', 'pl', etc)
+ * @param string $prefix the appropriate table's field name prefix ('page', 'pl', etc)
* @param $db DatabaseBase object to use
* @return mixed string with SQL where clause fragment, or false if no items.
*/
* Get a field of a title object from cache.
* If this link is not good, it will return NULL.
* @param $title Title
- * @param $field String: ('length','redirect','revision','model')
+ * @param string $field ('length','redirect','revision','model')
* @return mixed
*/
public function getGoodLinkFieldObj( $title, $field ) {
/**
* Add a title to the link cache, return the page_id or zero if non-existent
*
- * @param $title String: title to add
+ * @param string $title title to add
* @return Integer
*/
public function addLink( $title ) {
interface LCStore {
/**
* Get a value.
- * @param $code string Language code
- * @param $key string Cache key
+ * @param string $code Language code
+ * @param string $key Cache key
*/
function get( $code, $key );
* Actual format of the file depends on the $wgLocalMessageCacheSerialized
* setting.
*
- * @param $hash String: the hash of contents, to check validity.
+ * @param string $hash the hash of contents, to check validity.
* @param $code Mixed: Optional language code, see documenation of load().
* @return bool on failure.
*/
* $wgMaxMsgCacheEntrySize are assigned a special value, and are loaded
* on-demand from the database later.
*
- * @param $code String: language code.
+ * @param string $code language code.
* @return Array: loaded messages for storing in caches.
*/
function loadFromDB( $code ) {
/**
* Updates cache as necessary when message page is changed
*
- * @param $title String: name of the page changed.
+ * @param string $title name of the page changed.
* @param $text Mixed: new contents of the page.
*/
public function replace( $title, $text ) {
/**
* Shortcut to update caches.
*
- * @param $cache Array: cached messages with a version.
- * @param $memc Bool: Wether to update or not memcache.
- * @param $code String: Language code.
+ * @param array $cache cached messages with a version.
+ * @param bool $memc Wether to update or not memcache.
+ * @param string $code Language code.
* @return bool on somekind of error.
*/
protected function saveToCaches( $cache, $memc = true, $code = false ) {
* we look at MediaWiki:$key)
* 2) Built-in messages via the l10n cache which is also in fallback order
*
- * @param $key String: the message cache key
+ * @param string $key the message cache key
* @param $useDB Boolean: If true will look for the message in the DB, false only
* get the message from the DB, false to use only the compiled l10n cache.
* @param bool|string|object $langcode Code of the language to get the message for.
* Get a message from the MediaWiki namespace, with caching. The key must
* first be converted to two-part lang/msg form if necessary.
*
- * @param $title String: Message cache key with initial uppercase letter.
- * @param $code String: code denoting the language to try.
+ * @param string $title Message cache key with initial uppercase letter.
+ * @param string $code code denoting the language to try.
*
* @return string|bool False on failure
*/
/**
* Find the HTCP routing rule to use for a given URL.
- * @param $url string URL to match
- * @param $rules array Array of rules, see $wgHTCPMulticastRouting for format and behavior
+ * @param string $url URL to match
+ * @param array $rules Array of rules, see $wgHTCPMulticastRouting for format and behavior
* @return mixed Element of $rules that matched, or false if nothing matched
*/
static function getRuleForURL( $url, $rules ) {
* Get a property of a user based on their user ID
*
* @param $userId integer User ID
- * @param $prop string User property
+ * @param string $prop User property
* @return mixed The property or false if the user does not exist
*/
public function getProp( $userId, $prop ) {
/**
* Preloads user names for given list of users.
- * @param $userIds Array List of user IDs
- * @param $options Array Option flags; include 'userpage' and 'usertalk'
- * @param $caller String: the calling method
+ * @param array $userIds List of user IDs
+ * @param array $options Option flags; include 'userpage' and 'usertalk'
+ * @param string $caller the calling method
*/
public function doQuery( array $userIds, $options = array(), $caller = '' ) {
wfProfileIn( __METHOD__ );
* Check if a cache type is in $options and was not loaded for this user
*
* @param $uid integer user ID
- * @param $type string Cache type
- * @param $options Array Requested cache types
+ * @param string $type Cache type
+ * @param array $options Requested cache types
* @return bool
*/
protected function queryNeeded( $uid, $type, array $options ) {
/**
* Get a connection to a redis server. Based on code in RedisBagOStuff.php.
*
- * @param $server string A hostname/port combination or the absolute path of a UNIX socket.
+ * @param string $server A hostname/port combination or the absolute path of a UNIX socket.
* If a hostname is specified but no port, port 6379 will be used.
* @return RedisConnRef|bool Returns false on failure
* @throws MWException
* This base implementation calls the hook ConvertContent to enable custom conversions.
* Subclasses may override this to implement conversion for "their" content model.
*
- * @param String $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
- * @param String $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
+ * @param string $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
+ * @param string $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
* not allowed, full round-trip conversion is expected to work without losing information.
*
* @return Content|bool A content object with the content model $toModel, or false if
*
* @since 1.21
*
- * @param $maxLength int Maximum length of the summary text
+ * @param int $maxLength Maximum length of the summary text
* @return string The summary text
*/
public function getTextForSummary( $maxLength = 250 );
*
* @since 1.21
*
- * @param $format string The format to check
+ * @param string $format The format to check
* @return bool Whether the format is supported
*/
public function isSupportedFormat( $format );
*
* @since 1.21
*
- * @param $hasLinks Bool: If it is known whether this content contains
+ * @param bool $hasLinks If it is known whether this content contains
* links, provide this information here, to avoid redundant parsing to
* find out.
* @return boolean
*
* @since 1.21
*
- * @param $sectionId string The section's ID, given as a numeric string.
+ * @param string $sectionId The section's ID, given as a numeric string.
* The ID "0" retrieves the section before the first heading, "1" the
* text between the first heading (included) and the second heading
* (excluded), etc.
*
* @param $section null/false or a section number (0, 1, 2, T1, T2...), or "new"
* @param $with Content: new content of the section
- * @param $sectionTitle String: new section's subject, only if $section is 'new'
+ * @param string $sectionTitle new section's subject, only if $section is 'new'
* @return string Complete article text, or null if error
*/
public function replaceSection( $section, Content $with, $sectionTitle = '' );
* Converts this content object into another content object with the given content model,
* if that is possible.
*
- * @param String $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
- * @param String $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
+ * @param string $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
+ * @param string $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
* not allowed, full round-trip conversion is expected to work without losing information.
*
* @return Content|bool A content object with the content model $toModel, or false if
*
* @since 1.21
*
- * @param $text string the textual representation, will be
+ * @param string $text the textual representation, will be
* unserialized to create the Content object
* @param $title null|Title the title of the page this text belongs to.
* Required if $modelId is not provided.
*
* @since 1.21
*
- * @param $modelId String The ID of the content model for which to get a
+ * @param string $modelId The ID of the content model for which to get a
* handler. Use CONTENT_MODEL_XXX constants.
* @return ContentHandler The ContentHandler singleton for handling the
* model given by $modelId
* Model names are localized using system messages. Message keys
* have the form content-model-$name, where $name is getContentModelName( $id ).
*
- * @param $name String The content model ID, as given by a CONTENT_MODEL_XXX
+ * @param string $name The content model ID, as given by a CONTENT_MODEL_XXX
* constant or returned by Revision::getContentModel().
*
* @return string The content format's localized name.
* and a list of supported formats. Values for the parameters are typically
* provided as literals by subclass's constructors.
*
- * @param $modelId String (use CONTENT_MODEL_XXX constants).
- * @param $formats array List for supported serialization formats
+ * @param string $modelId (use CONTENT_MODEL_XXX constants).
+ * @param array $formats List for supported serialization formats
* (typically as MIME types)
*/
public function __construct( $modelId, $formats ) {
*
* @since 1.21
*
- * @param $blob string serialized form of the content
+ * @param string $blob serialized form of the content
* @param $format null|String the format used for serialization
* @return Content the Content object created by deserializing $blob
*/
*
* @since 1.21
*
- * @param String $model_id The model to check
+ * @param string $model_id The model to check
*
* @throws MWException
*/
*
* @since 1.21
*
- * @param $format string the serialization format to check
+ * @param string $format the serialization format to check
* @return bool
*/
public function isSupportedFormat( $format ) {
* Convenient for checking whether a format provided as a parameter is
* actually supported.
*
- * @param $format string the serialization format to check
+ * @param string $format the serialization format to check
*
* @throws MWException
*/
* @param $context IContextSource context to use, anything else will be
* ignored
* @param $old Integer Old ID we want to show and diff with.
- * @param $new int|string String either 'prev' or 'next'.
+ * @param int|string $new String either 'prev' or 'next'.
* @param $rcid Integer ??? FIXME (default 0)
* @param $refreshCache boolean If set, refreshes the diff cache
* @param $unhide boolean If set, allow viewing deleted revs
*
* @param $oldContent Content|null: the previous text of the page.
* @param $newContent Content|null: The submitted text of the page.
- * @param $flags int Bit mask: a bit mask of flags submitted for the edit.
+ * @param int $flags Bit mask: a bit mask of flags submitted for the edit.
*
* @return string An appropriate auto-summary, or an empty string.
*/
* Logs a deprecation warning, visible if $wgDevelopmentWarnings, but only if
* self::$enableDeprecationWarnings is set to true.
*
- * @param String $func The name of the deprecated function
+ * @param string $func The name of the deprecated function
* @param string $version The version since the method is deprecated. Usually 1.21
* for ContentHandler related stuff.
- * @param String|bool $component: Component to which the function belongs.
+ * @param string|bool $component: Component to which the function belongs.
* If false, it is assumed the function is in MediaWiki core.
*
* @see ContentHandler::$enableDeprecationWarnings
* hook function, a new Content object is constructed from the new
* text.
*
- * @param $event String: event name
- * @param $args Array: parameters passed to hook functions
- * @param $warn bool: whether to log a warning.
+ * @param string $event event name
+ * @param array $args parameters passed to hook functions
+ * @param bool $warn whether to log a warning.
* Default to self::$enableDeprecationWarnings.
* May be set to false for testing.
*
* Returns true if this content is not a redirect, and $wgArticleCountMethod
* is "any".
*
- * @param $hasLinks Bool: if it is known whether this content contains links,
+ * @param bool $hasLinks if it is known whether this content contains links,
* provide this information here, to avoid redundant parsing to find out.
*
* @return bool True if the content is countable
* getHtml().
*
* @param $title Title Context title for parsing
- * @param $revId int|null Revision ID (for {{REVISIONID}})
+ * @param int|null $revId Revision ID (for {{REVISIONID}})
* @param $options ParserOptions|null Parser options
- * @param $generateHtml bool Whether or not to generate HTML
+ * @param bool $generateHtml Whether or not to generate HTML
*
* @return ParserOutput representing the HTML form of the text
*/
* This implementation provides lossless conversion between content models based
* on TextContent.
*
- * @param String $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
- * @param String $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
+ * @param string $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
+ * @param string $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
* not allowed, full round-trip conversion is expected to work without losing information.
*
* @return Content|bool A content object with the content model $toModel, or false if
* Returns true if this content is not a redirect, and this content's text
* is countable according to the criteria defined by $wgArticleCountMethod.
*
- * @param $hasLinks Bool if it is known whether this content contains
+ * @param bool $hasLinks if it is known whether this content contains
* links, provide this information here, to avoid redundant parsing to
* find out (default: null).
* @param $title Title: (default: null)
* @since 1.21
*
* @param $title Title
- * @param $revId int Revision to pass to the parser (default: null)
+ * @param int $revId Revision to pass to the parser (default: null)
* @param $options ParserOptions (default: null)
- * @param $generateHtml bool (default: false)
+ * @param bool $generateHtml (default: false)
*
* @internal param \IContextSource|null $context
* @return ParserOutput representing the HTML form of the text
protected $wiki = false;
/**
- * @param String|bool $wiki The target wiki's name. This must be an ID
+ * @param string|bool $wiki The target wiki's name. This must be an ID
* that LBFactory can understand.
*/
public function __construct( $wiki = false ) {
* Constructor
*
* @param $db DatabaseBase A database subclass
- * @param $tablesToClone Array An array of tables to clone, unprefixed
- * @param $newTablePrefix String Prefix to assign to the tables
- * @param $oldTablePrefix String Prefix on current tables, if not $wgDBprefix
+ * @param array $tablesToClone An array of tables to clone, unprefixed
+ * @param string $newTablePrefix Prefix to assign to the tables
+ * @param string $oldTablePrefix Prefix on current tables, if not $wgDBprefix
* @param $dropCurrentTables bool
*/
public function __construct( DatabaseBase $db, array $tablesToClone,
/**
* Set whether to use temporary tables or not
- * @param $u Bool Use temporary tables when cloning the structure
+ * @param bool $u Use temporary tables when cloning the structure
*/
public function useTemporaryTables( $u = true ) {
$this->useTemporaryTables = $u;
/**
* Change the prefix back to the original.
- * @param $dropTables bool Optionally drop the tables we created
+ * @param bool $dropTables Optionally drop the tables we created
*/
public function destroy( $dropTables = false ) {
if( $dropTables ) {
/**
* Open a connection to the database. Usually aborts on failure
*
- * @param $server String: database server host
- * @param $user String: database user name
- * @param $password String: database user password
- * @param $dbName String: database name
+ * @param string $server database server host
+ * @param string $user database user name
+ * @param string $password database user password
+ * @param string $dbName database name
* @return bool
* @throws DBConnectionError
*/
* mysql_fetch_field() wrapper
* Returns false if the field doesn't exist
*
- * @param $table string: table name
- * @param $field string: field name
+ * @param string $table table name
+ * @param string $field field name
*
* @return Field
*/
/**
* Get information about an index into an object
- * @param $table string: Table name
- * @param $index string: Index name
- * @param $fname string: Calling function name
+ * @param string $table Table name
+ * @param string $index Index name
+ * @param string $fname Calling function name
* @return Mixed: Database-specific index description class or false if the index does not exist
*/
function indexInfo( $table, $index, $fname = 'Database::indexInfo' );
/**
* Wrapper for addslashes()
*
- * @param $s string: to be slashed.
+ * @param string $s to be slashed.
* @return string: slashed string.
*/
function strencode( $s );
* Historically, transactions were allowed to be "nested". This is no
* longer supported, so this function really only returns a boolean.
*
- * @param $level int An integer (0 or 1), or omitted to leave it unchanged.
+ * @param int $level An integer (0 or 1), or omitted to leave it unchanged.
* @return int The previous value
*/
public function trxLevel( $level = null ) {
/**
* Get/set the number of errors logged. Only useful when errors are ignored
- * @param $count int The count to set, or omitted to leave it unchanged.
+ * @param int $count The count to set, or omitted to leave it unchanged.
* @return int The error count
*/
public function errorCount( $count = null ) {
/**
* Get/set the table prefix.
- * @param $prefix string The table prefix to set, or omitted to leave it unchanged.
+ * @param string $prefix The table prefix to set, or omitted to leave it unchanged.
* @return string The previous table prefix.
*/
public function tablePrefix( $prefix = null ) {
* Get properties passed down from the server info array of the load
* balancer.
*
- * @param $name string The entry of the info array to get, or null to get the
+ * @param string $name The entry of the info array to get, or null to get the
* whole array
*
* @return LoadBalancer|null
/**
* Constructor.
- * @param $server String: database server host
- * @param $user String: database user name
- * @param $password String: database user password
- * @param $dbName String: database name
+ * @param string $server database server host
+ * @param string $user database user name
+ * @param string $password database user password
+ * @param string $dbName database name
* @param $flags
- * @param $tablePrefix String: database table prefixes. By default use the prefix gave in LocalSettings.php
+ * @param string $tablePrefix database table prefixes. By default use the prefix gave in LocalSettings.php
*/
function __construct( $server = false, $user = false, $password = false, $dbName = false,
$flags = 0, $tablePrefix = 'get from global'
*
* @since 1.18
*
- * @param $dbType String A possible DB type
- * @param $p Array An array of options to pass to the constructor.
+ * @param string $dbType A possible DB type
+ * @param array $p An array of options to pass to the constructor.
* Valid options are: host, user, password, dbname, flags, tablePrefix
* @return DatabaseBase subclass or null
*/
abstract protected function closeConnection();
/**
- * @param $error String: fallback error message, used if none is given by DB
+ * @param string $error fallback error message, used if none is given by DB
* @throws DBConnectionError
*/
function reportConnectionError( $error = 'Unknown error' ) {
/**
* Execute a prepared query with the various arguments
- * @param $prepared String: the prepared sql
+ * @param string $prepared the prepared sql
* @param $args Mixed: Either an array here, or put scalars as varargs
*
* @return ResultWrapper
/**
* For faking prepared SQL statements on DBs that don't support it directly.
*
- * @param $preparedQuery String: a 'preparable' SQL statement
- * @param $args Array of arguments to fill it with
+ * @param string $preparedQuery a 'preparable' SQL statement
+ * @param array $args of arguments to fill it with
* @return string executable SQL
*/
public function fillPrepared( $preparedQuery, $args ) {
*
* If no result rows are returned from the query, false is returned.
*
- * @param $table string|array Table name. See DatabaseBase::select() for details.
- * @param $var string The field name to select. This must be a valid SQL
+ * @param string|array $table Table name. See DatabaseBase::select() for details.
+ * @param string $var The field name to select. This must be a valid SQL
* fragment: do not use unvalidated user input.
- * @param $cond string|array The condition array. See DatabaseBase::select() for details.
- * @param $fname string The function name of the caller.
- * @param $options string|array The query options. See DatabaseBase::select() for details.
+ * @param string|array $cond The condition array. See DatabaseBase::select() for details.
+ * @param string $fname The function name of the caller.
+ * @param string|array $options The query options. See DatabaseBase::select() for details.
*
* @return bool|mixed The value from the field, or false on failure.
*/
* Returns an optional USE INDEX clause to go after the table, and a
* string to go at the end of the query.
*
- * @param $options Array: associative array of options to be turned into
+ * @param array $options associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return Array
* @see DatabaseBase::select()
/**
* Returns an optional GROUP BY with an optional HAVING
*
- * @param $options Array: associative array of options
+ * @param array $options associative array of options
* @return string
* @see DatabaseBase::select()
* @since 1.21
/**
* Returns an optional ORDER BY
*
- * @param $options Array: associative array of options
+ * @param array $options associative array of options
* @return string
* @see DatabaseBase::select()
* @since 1.21
* Execute a SELECT query constructed using the various parameters provided.
* See below for full details of the parameters.
*
- * @param $table String|Array Table name
- * @param $vars String|Array Field names
- * @param $conds String|Array Conditions
- * @param $fname String Caller function name
- * @param $options Array Query options
+ * @param string|array $table Table name
+ * @param string|array $vars Field names
+ * @param string|array $conds Conditions
+ * @param string $fname Caller function name
+ * @param array $options Query options
* @param $join_conds Array Join conditions
*
* @param $table string|array
* doing UNION queries, where the SQL text of each query is needed. In general,
* however, callers outside of Database classes should just use select().
*
- * @param $table string|array Table name
- * @param $vars string|array Field names
- * @param $conds string|array Conditions
- * @param $fname string Caller function name
- * @param $options string|array Query options
+ * @param string|array $table Table name
+ * @param string|array $vars Field names
+ * @param string|array $conds Conditions
+ * @param string $fname Caller function name
+ * @param string|array $options Query options
* @param $join_conds string|array Join conditions
*
* @return string SQL query string.
* that a single row object is returned. If the query returns no rows,
* false is returned.
*
- * @param $table string|array Table name
- * @param $vars string|array Field names
- * @param $conds array Conditions
- * @param $fname string Caller function name
- * @param $options string|array Query options
+ * @param string|array $table Table name
+ * @param string|array $vars Field names
+ * @param array $conds Conditions
+ * @param string $fname Caller function name
+ * @param string|array $options Query options
* @param $join_conds array|string Join conditions
*
* @return object|bool
*
* Takes the same arguments as DatabaseBase::select().
*
- * @param $table String: table name
- * @param Array|string $vars : unused
- * @param Array|string $conds : filters on the table
- * @param $fname String: function name for profiling
- * @param $options Array: options for select
+ * @param string $table table name
+ * @param array|string $vars : unused
+ * @param array|string $conds : filters on the table
+ * @param string $fname function name for profiling
+ * @param array $options options for select
* @return Integer: row count
*/
public function estimateRowCount( $table, $vars = '*', $conds = '',
* Removes most variables from an SQL query and replaces them with X or N for numbers.
* It's only slightly flawed. Don't use for anything important.
*
- * @param $sql String A SQL Query
+ * @param string $sql A SQL Query
*
* @return string
*/
/**
* Determines whether a field exists in a table
*
- * @param $table String: table name
- * @param $field String: filed to check on that table
- * @param $fname String: calling function name (optional)
+ * @param string $table table name
+ * @param string $field filed to check on that table
+ * @param string $fname calling function name (optional)
* @return Boolean: whether $table has filed $field
*/
public function fieldExists( $table, $field, $fname = 'DatabaseBase::fieldExists' ) {
* DatabaseBase::tableName().
* @param $a Array of rows to insert
* @param $fname String Calling function name (use __METHOD__) for logs/profiling
- * @param $options Array of options
+ * @param array $options of options
*
* @return bool
*/
/**
* Make UPDATE options for the DatabaseBase::update function
*
- * @param $options Array: The options passed to DatabaseBase::update
+ * @param array $options The options passed to DatabaseBase::update
* @return string
*/
protected function makeUpdateOptions( $options ) {
* @param $table String name of the table to UPDATE. This will be passed through
* DatabaseBase::tableName().
*
- * @param $values Array: An array of values to SET. For each array element,
+ * @param array $values An array of values to SET. For each array element,
* the key gives the field name, and the value gives the data
* to set that field to. The data will be quoted by
* DatabaseBase::addQuotes().
* @param $fname String: The function name of the caller (from __METHOD__),
* for logging and profiling.
*
- * @param $options Array: An array of UPDATE options, can be:
+ * @param array $options An array of UPDATE options, can be:
* - IGNORE: Ignore unique key conflicts
* - LOW_PRIORITY: MySQL-specific, see MySQL manual.
* @return Boolean
/**
* Makes an encoded list of strings from an array
- * @param $a Array containing the data
+ * @param array $a containing the data
* @param int $mode Constant
* - LIST_COMMA: comma separated, no field names
* - LIST_AND: ANDed WHERE clause (without the WHERE). See
* Build a partial where clause from a 2-d array such as used for LinkBatch.
* The keys on each level may be either integers or strings.
*
- * @param $data Array: organized as 2-d
+ * @param array $data organized as 2-d
* array(baseKeyVal => array(subKeyVal => [ignored], ...), ...)
- * @param $baseKey String: field name to match the base-level keys to (eg 'pl_namespace')
- * @param $subKey String: field name to match the sub-level keys to (eg 'pl_title')
+ * @param string $baseKey field name to match the base-level keys to (eg 'pl_namespace')
+ * @param string $subKey field name to match the sub-level keys to (eg 'pl_title')
* @return Mixed: string SQL fragment, or false if no items in array.
*/
public function makeWhereFrom2d( $data, $baseKey, $subKey ) {
/**
* Build a concatenation list to feed into a SQL query
- * @param $stringList Array: list of raw SQL expressions; caller is responsible for any quoting
+ * @param array $stringList list of raw SQL expressions; caller is responsible for any quoting
* @return String
*/
public function buildConcat( $stringList ) {
* themselves. Pass the canonical name to such functions. This is only needed
* when calling query() directly.
*
- * @param $name String: database table name
- * @param $format String One of:
+ * @param string $name database table name
+ * @param string $format One of:
* quoted - Automatically pass the table name through addIdentifierQuotes()
* so that it can be used in a query.
* raw - Do not add identifier quotes to the table name
* Get an aliased table name
* e.g. tableName AS newTableName
*
- * @param $name string Table name, see tableName()
- * @param $alias string|bool Alias (optional)
+ * @param string $name Table name, see tableName()
+ * @param string|bool $alias Alias (optional)
* @return string SQL name for aliased table. Will not alias a table to its own name
*/
public function tableNameWithAlias( $name, $alias = false ) {
* Get an aliased field name
* e.g. fieldName AS newFieldName
*
- * @param $name string Field name
- * @param $alias string|bool Alias (optional)
+ * @param string $name Field name
+ * @param string|bool $alias Alias (optional)
* @return string SQL name for aliased field. Will not alias a field to its own name
*/
public function fieldNameWithAlias( $name, $alias = false ) {
* Get the aliased table name clause for a FROM clause
* which might have a JOIN and/or USE INDEX clause
*
- * @param $tables array ( [alias] => table )
+ * @param array $tables ( [alias] => table )
* @param $use_index array Same as for select()
* @param $join_conds array Same as for select()
* @return string
* to collide. However if you do this, you run the risk of encountering
* errors which wouldn't have occurred in MySQL.
*
- * @param $table String: The table to replace the row(s) in.
- * @param $rows array Can be either a single row to insert, or multiple rows,
+ * @param string $table The table to replace the row(s) in.
+ * @param array $rows Can be either a single row to insert, or multiple rows,
* in the same format as for DatabaseBase::insert()
- * @param $uniqueIndexes array is an array of indexes. Each element may be either
+ * @param array $uniqueIndexes is an array of indexes. Each element may be either
* a field name or an array of field names
- * @param $fname String: Calling function name (use __METHOD__) for logs/profiling
+ * @param string $fname Calling function name (use __METHOD__) for logs/profiling
*/
public function replace( $table, $uniqueIndexes, $rows, $fname = 'DatabaseBase::replace' ) {
$quotedTable = $this->tableName( $table );
* REPLACE query wrapper for MySQL and SQLite, which have a native REPLACE
* statement.
*
- * @param $table string Table name
- * @param $rows array Rows to insert
- * @param $fname string Caller function name
+ * @param string $table Table name
+ * @param array $rows Rows to insert
+ * @param string $fname Caller function name
*
* @return ResultWrapper
*/
/**
* DELETE query wrapper.
*
- * @param $table Array Table name
- * @param $conds String|Array of conditions. See $conds in DatabaseBase::select() for
+ * @param array $table Table name
+ * @param string|array $conds of conditions. See $conds in DatabaseBase::select() for
* the format. Use $conds == "*" to delete all rows
- * @param $fname String name of the calling function
+ * @param string $fname name of the calling function
*
* @throws DBUnexpectedError
* @return bool|ResultWrapper
* INSERT SELECT wrapper. Takes data from a SELECT query and inserts it
* into another table.
*
- * @param $destTable string The table name to insert into
- * @param $srcTable string|array May be either a table name, or an array of table names
+ * @param string $destTable The table name to insert into
+ * @param string|array $srcTable May be either a table name, or an array of table names
* to include in a join.
*
- * @param $varMap array must be an associative array of the form
+ * @param array $varMap must be an associative array of the form
* array( 'dest1' => 'source1', ...). Source items may be literals
* rather than field names, but strings should be quoted with
* DatabaseBase::addQuotes()
*
- * @param $conds array Condition array. See $conds in DatabaseBase::select() for
+ * @param array $conds Condition array. See $conds in DatabaseBase::select() for
* the details of the format of condition arrays. May be "*" to copy the
* whole table.
*
- * @param $fname string The function name of the caller, from __METHOD__
+ * @param string $fname The function name of the caller, from __METHOD__
*
- * @param $insertOptions array Options for the INSERT part of the query, see
+ * @param array $insertOptions Options for the INSERT part of the query, see
* DatabaseBase::insert() for details.
- * @param $selectOptions array Options for the SELECT part of the query, see
+ * @param array $selectOptions Options for the SELECT part of the query, see
* DatabaseBase::select() for details.
*
* @return ResultWrapper
* The version provided by default works in MySQL and SQLite. It will very
* likely need to be overridden for most other DBMSes.
*
- * @param $sql String SQL query we will append the limit too
+ * @param string $sql SQL query we will append the limit too
* @param $limit Integer the SQL limit
* @param $offset Integer|bool the SQL offset (default false)
*
* Construct a UNION query
* This is used for providing overload point for other DB abstractions
* not compatible with the MySQL syntax.
- * @param $sqls Array: SQL statements to combine
+ * @param array $sqls SQL statements to combine
* @param $all Boolean: use UNION ALL
* @return String: SQL fragment
*/
* Returns an SQL expression for a simple conditional. This doesn't need
* to be overridden unless CASE isn't supported in your DBMS.
*
- * @param $cond string|array SQL expression which will result in a boolean value
- * @param $trueVal String: SQL expression to return if true
- * @param $falseVal String: SQL expression to return if false
+ * @param string|array $cond SQL expression which will result in a boolean value
+ * @param string $trueVal SQL expression to return if true
+ * @param string $falseVal SQL expression to return if false
* @return String: SQL fragment
*/
public function conditional( $cond, $trueVal, $falseVal ) {
* Returns a comand for str_replace function in SQL query.
* Uses REPLACE() in MySQL
*
- * @param $orig String: column to modify
- * @param $old String: column to seek
- * @param $new String: column to replace with
+ * @param string $orig column to modify
+ * @param string $old column to seek
+ * @param string $new column to replace with
*
* @return string
*/
* Nesting of transactions is not supported.
*
* @param $fname string
- * @param $flush String Flush flag, set to 'flush' to disable warnings about explicitly committing implicit
+ * @param string $flush Flush flag, set to 'flush' to disable warnings about explicitly committing implicit
* transactions, or calling commit when no transaction is in progress.
* This will silently break any ongoing explicit transaction. Only set the flush flag if you are sure
* that it is safe to ignore these warnings in your context.
* The table names passed to this function shall not be quoted (this
* function calls addIdentifierQuotes when needed).
*
- * @param $oldName String: name of table whose structure should be copied
- * @param $newName String: name of table to be created
+ * @param string $oldName name of table whose structure should be copied
+ * @param string $newName name of table to be created
* @param $temporary Boolean: whether the new table should be temporary
- * @param $fname String: calling function name
+ * @param string $fname calling function name
* @throws MWException
* @return Boolean: true if operation was successful
*/
/**
* List all tables on the database
*
- * @param $prefix string Only show tables with this prefix, e.g. mw_
- * @param $fname String: calling function name
+ * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string $fname calling function name
* @throws MWException
*/
function listTables( $prefix = null, $fname = 'DatabaseBase::listTables' ) {
* Returns true on success, error string or exception on failure (depending
* on object's error ignore settings).
*
- * @param $filename String: File name to open
+ * @param string $filename File name to open
* @param bool|callable $lineCallback Optional function called before reading each line
* @param bool|callable $resultCallback Optional function called for each MySQL result
* @param bool|string $fname Calling function name or false if name should be
* from updaters.inc. Keep in mind this always returns a patch, as
* it fails back to MySQL if no DB-specific patch can be found
*
- * @param $patch String The name of the patch, like patch-something.sql
+ * @param string $patch The name of the patch, like patch-something.sql
* @return String Full path to patch file
*/
public function patchPath( $patch ) {
* ones in $GLOBALS. If an array is set here, $GLOBALS will not be used at
* all. If it's set to false, $GLOBALS will be used.
*
- * @param $vars bool|array mapping variable name to value.
+ * @param bool|array $vars mapping variable name to value.
*/
public function setSchemaVars( $vars ) {
$this->mSchemaVars = $vars;
* @param $fp Resource: File handle
* @param $lineCallback Callback: Optional function called before reading each query
* @param $resultCallback Callback: Optional function called for each MySQL result
- * @param $fname String: Calling function name
+ * @param string $fname Calling function name
* @param $inputCallback Callback: Optional function called for each complete query sent
* @return bool|string
*/
/**
* Called by sourceStream() to check if we've reached a statement end
*
- * @param $sql String SQL assembled so far
- * @param $newLine String New line about to be added to $sql
+ * @param string $sql SQL assembled so far
+ * @param string $newLine New line about to be added to $sql
* @return Bool Whether $newLine contains end of the statement
*/
public function streamStatementEnd( &$sql, &$newLine ) {
* - / *$var* / is just encoded, besides traditional table prefix and
* table options its use should be avoided.
*
- * @param $ins String: SQL statement to replace variables in
+ * @param string $ins SQL statement to replace variables in
* @return String The new SQL statement with variables replaced
*/
protected function replaceSchemaVars( $ins ) {
/**
* Check to see if a named lock is available. This is non-blocking.
*
- * @param $lockName String: name of lock to poll
- * @param $method String: name of method calling us
+ * @param string $lockName name of lock to poll
+ * @param string $method name of method calling us
* @return Boolean
* @since 1.20
*/
* Abstracted from Filestore::lock() so child classes can implement for
* their own needs.
*
- * @param $lockName String: name of lock to aquire
- * @param $method String: name of method calling us
+ * @param string $lockName name of lock to aquire
+ * @param string $method name of method calling us
* @param $timeout Integer: timeout
* @return Boolean
*/
/**
* Release a lock.
*
- * @param $lockName String: Name of lock to release
- * @param $method String: Name of method calling us
+ * @param string $lockName Name of lock to release
+ * @param string $method Name of method calling us
*
* @return int Returns 1 if the lock was released, 0 if the lock was not established
* by this thread (in which case the lock is not released), and NULL if the named
/**
* Lock specific tables
*
- * @param $read Array of tables to lock for read access
- * @param $write Array of tables to lock for write access
- * @param $method String name of caller
- * @param $lowPriority bool Whether to indicate writes to be LOW PRIORITY
+ * @param array $read of tables to lock for read access
+ * @param array $write of tables to lock for write access
+ * @param string $method name of caller
+ * @param bool $lowPriority Whether to indicate writes to be LOW PRIORITY
*
* @return bool
*/
/**
* Unlock specific tables
*
- * @param $method String the caller
+ * @param string $method the caller
*
* @return bool
*/
/**
* Encode an expiry time into the DBMS dependent format
*
- * @param $expiry String: timestamp for expiry, or the 'infinity' string
+ * @param string $expiry timestamp for expiry, or the 'infinity' string
* @return String
*/
public function encodeExpiry( $expiry ) {
/**
* Decode an expiry time into a DBMS independent format
*
- * @param $expiry String: DB timestamp field value for expiry
+ * @param string $expiry DB timestamp field value for expiry
* @param $format integer: TS_* constant, defaults to TS_MW
* @return String
*/
/**
* Construct a database error
* @param $db DatabaseBase object which threw the error
- * @param $error String A simple error message to be used for debugging
+ * @param string $error A simple error message to be used for debugging
*/
function __construct( DatabaseBase &$db, $error ) {
$this->db = $db;
/**
* Usually aborts on failure
- * @param String $server
- * @param String $user
- * @param String $password
- * @param String $dbName
+ * @param string $server
+ * @param string $user
+ * @param string $password
+ * @param string $dbName
* @throws DBConnectionError
* @return bool|DatabaseBase|null
*/
* @param $vars Mixed: array or string, field name(s) to be retrieved
* @param $conds Mixed: array or string, condition(s) for WHERE
* @param $fname String: calling function name (use __METHOD__) for logs/profiling
- * @param $options Array: associative array of options (e.g. array('GROUP BY' => 'page_title')),
+ * @param array $options associative array of options (e.g. array('GROUP BY' => 'page_title')),
* see Database::makeSelectOptions code for list of supported stuff
* @param $join_conds Array: Associative array of table join conditions (optional)
* (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
* @param $vars Mixed: Array or string, field name(s) to be retrieved
* @param $conds Mixed: Array or string, condition(s) for WHERE
* @param $fname String: Calling function name (use __METHOD__) for logs/profiling
- * @param $options Array: Associative array of options (e.g. array('GROUP BY' => 'page_title')),
+ * @param array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')),
* see Database::makeSelectOptions code for list of supported stuff
* @param $join_conds Array: Associative array of table join conditions (optional)
* (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
*
* Usually aborts on failure
* If errors are explicitly ignored, returns success
- * @param String $table
- * @param Array $arrToInsert
+ * @param string $table
+ * @param array $arrToInsert
* @param string $fname
* @param array $options
* @throws DBQueryError
/**
* @private
*
- * @param $options Array: an associative array of options to be turned into
+ * @param array $options an associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return Array
*/
/**
* Check to see if a named lock is available. This is non-blocking.
*
- * @param $lockName String: name of lock to poll
- * @param $method String: name of method calling us
+ * @param string $lockName name of lock to poll
+ * @param string $method name of method calling us
* @return Boolean
* @since 1.20
*/
/**
* List all tables on the database
*
- * @param $prefix string Only show tables with this prefix, e.g. mw_
- * @param $fname String: calling function name
+ * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string $fname calling function name
* @return array
*/
function listTables( $prefix = null, $fname = 'DatabaseMysql::listTables' ) {
*
* @private
*
- * @param $options Array: an associative array of options to be turned into
+ * @param array $options an associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return array
*/
* @param $table String: Name of the table to insert to.
* @param $args Array: Items to insert into the table.
* @param $fname String: Name of the function, for profiling
- * @param $options String or Array. Valid options: IGNORE
+ * @param string $options or Array. Valid options: IGNORE
*
* @return bool Success of insert operation. IGNORE always returns true.
*/
*
* @private
*
- * @param $ins String: SQL string, read from a stream (usually tables.sql)
+ * @param string $ins SQL string, read from a stream (usually tables.sql)
*
* @return string SQL string
*/
*
* @private
*
- * @param $options Array: an associative array of options to be turned into
+ * @param array $options an associative array of options to be turned into
* an SQL query, valid keys are listed in the function.
* @return array
*/
* Check to see if a named lock is available. This is non-blocking.
* See http://www.postgresql.org/docs/8.2/static/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS
*
- * @param $lockName String: name of lock to poll
- * @param $method String: name of method calling us
+ * @param string $lockName name of lock to poll
+ * @param string $method name of method calling us
* @return Boolean
* @since 1.20
*/
/**
* Generates a database file name. Explicitly public for installer.
- * @param $dir String: Directory where database resides
- * @param $dbName String: Database name
+ * @param string $dir Directory where database resides
+ * @param string $dbName Database name
* @return String
*/
public static function generateFileName( $dir, $dbName ) {
* Attaches external database to our connection, see http://sqlite.org/lang_attach.html
* for details.
*
- * @param $name String: database name to be used in queries like SELECT foo FROM dbname.table
- * @param $file String: database file name. If omitted, will be generated using $name and $wgSQLiteDataDir
- * @param $fname String: calling function name
+ * @param string $name database name to be used in queries like SELECT foo FROM dbname.table
+ * @param string $file database file name. If omitted, will be generated using $name and $wgSQLiteDataDir
+ * @param string $fname calling function name
*
* @return ResultWrapper
*/
/**
* List all tables on the database
*
- * @param $prefix string Only show tables with this prefix, e.g. mw_
- * @param $fname String: calling function name
+ * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string $fname calling function name
*
* @return array
*/
/**
* Store a string into a LikeMatch marker object.
*
- * @param String $s
+ * @param string $s
*/
public function __construct( $s ) {
$this->str = $s;
/**
* Set the ID of the any foreign wiki to use as a target for database operations
*
- * @param String|bool $wiki The target wiki, in a form that LBFactory understands (or false if the local wiki shall be used)
+ * @param string|bool $wiki The target wiki, in a form that LBFactory understands (or false if the local wiki shall be used)
*
* @since 1.20
*/
* Create a new load balancer object. The resulting object will be untracked,
* not chronology-protected, and the caller is responsible for cleaning it up.
*
- * @param $wiki String: wiki ID, or false for the current wiki
+ * @param string $wiki wiki ID, or false for the current wiki
* @return LoadBalancer
*/
abstract function newMainLB( $wiki = false );
/**
* Get a cached (tracked) load balancer object.
*
- * @param $wiki String: wiki ID, or false for the current wiki
+ * @param string $wiki wiki ID, or false for the current wiki
* @return LoadBalancer
*/
abstract function getMainLB( $wiki = false );
* untracked, not chronology-protected, and the caller is responsible for
* cleaning it up.
*
- * @param $cluster String: external storage cluster, or false for core
- * @param $wiki String: wiki ID, or false for the current wiki
+ * @param string $cluster external storage cluster, or false for core
+ * @param string $wiki wiki ID, or false for the current wiki
*
* @return LoadBalancer
*/
/**
* Get a cached (tracked) load balancer for external storage
*
- * @param $cluster String: external storage cluster, or false for core
- * @param $wiki String: wiki ID, or false for the current wiki
+ * @param string $cluster external storage cluster, or false for core
+ * @param string $wiki wiki ID, or false for the current wiki
*
* @return LoadBalancer
*/
}
/**
- * @param String $cluster
+ * @param string $cluster
* @param bool $wiki
* @throws MWException
* @return LoadBalancer
protected $lb;
/**
- * @param $conf array An associative array with one member:
+ * @param array $conf An associative array with one member:
* - connection: The DatabaseBase connection object
*/
function __construct( $conf ) {
private $mLoadMonitorClass, $mLoadMonitor;
/**
- * @param $params Array with keys:
+ * @param array $params with keys:
* servers Required. Array of server info structures.
* masterWaitTimeout Replication lag wait timeout
* loadMonitor Name of a class used to fetch server lag and load.
* This is the main entry point for this class.
*
* @param $i Integer: server index
- * @param $groups Array: query groups
+ * @param array $groups query groups
* @param bool|string $wiki Wiki ID
*
* @throws MWException
* error will be available via $this->mErrorConnection.
*
* @param $i Integer server index
- * @param $wiki String wiki ID to open
+ * @param string $wiki wiki ID to open
* @return DatabaseBase
*
* @access private
* error will be available via $this->mErrorConnection.
*
* @param $i Integer: server index
- * @param $wiki String: wiki ID to open
+ * @param string $wiki wiki ID to open
* @return DatabaseBase
*/
function openForeignConnection( $i, $wiki ) {
* May attempt to open connections to slaves on the default DB. If there is
* no lag, the maximum lag will be reported as -1.
*
- * @param $wiki string Wiki ID, or false for the default database
+ * @param string $wiki Wiki ID, or false for the default database
*
* @return array ( host, max lag, index of max lagged host )
*/
/**
* Perform pre-connection load ratio adjustment.
* @param $loads array
- * @param $group String: the selected query group
+ * @param string $group the selected query group
* @param $wiki String
*/
function scaleLoads( &$loads, $group = false, $wiki = false );
*
* @since 1.20
*
- * @param $name string: Field name
+ * @param string $name Field name
* @param $default mixed: Default value to return when none is found
* (default: null)
*
/**
* Set the ID of the any foreign wiki to use as a target for database operations
*
- * @param String|bool $wiki The target wiki, in a form that LBFactory understands (or false if the local wiki shall be used)
+ * @param string|bool $wiki The target wiki, in a form that LBFactory understands (or false if the local wiki shall be used)
*
* @since 1.20
*/
* @since 1.19
* @param $msg string
* @param $callerOffset int
- * @param $level int A PHP error level. See sendWarning()
+ * @param int $level A PHP error level. See sendWarning()
* @return mixed
*/
public static function warning( $msg, $callerOffset = 1, $level = E_USER_NOTICE ) {
* - MediaWiki's debug log, if $wgDevelopmentWarnings is set to false.
*
* @since 1.19
- * @param $function string: Function that is deprecated.
- * @param $version string|bool: Version in which the function was deprecated.
- * @param $component string|bool: Component to which the function belongs.
+ * @param string $function Function that is deprecated.
+ * @param string|bool $version Version in which the function was deprecated.
+ * @param string|bool $component Component to which the function belongs.
* If false, it is assumbed the function is in MediaWiki core.
* @param $callerOffset integer: How far up the callstack is the original
* caller. 2 = function that called the function that called
* Send a warning either to the debug log or by triggering an user PHP
* error depending on $wgDevelopmentWarnings.
*
- * @param $msg string Message to send
- * @param $caller array caller description get from getCallerDescription()
+ * @param string $msg Message to send
+ * @param array $caller caller description get from getCallerDescription()
* @param $level error level to use if $wgDevelopmentWarnings is true
*/
private static function sendWarning( $msg, $caller, $level ) {
* Constructor
* @param $context IContextSource context to use, anything else will be ignored
* @param $old Integer old ID we want to show and diff with.
- * @param $new String either 'prev' or 'next'.
+ * @param string $new either 'prev' or 'next'.
* @param $rcid Integer ??? FIXME (default 0)
* @param $refreshCache boolean If set, refreshes the diff cache
* @param $unhide boolean If set, allow viewing deleted revs
*
* @param string|bool $otitle Header for old text or false
* @param string|bool $ntitle Header for new text or false
- * @param $notice String: HTML between diff header and body
+ * @param string $notice HTML between diff header and body
* @return mixed
*/
function getDiff( $otitle, $ntitle, $notice = '' ) {
/**
* Generate a diff, no caching
*
- * @param $otext String: old text, must be already segmented
- * @param $ntext String: new text, must be already segmented
+ * @param string $otext old text, must be already segmented
+ * @param string $ntext new text, must be already segmented
* @return bool|string
* @deprecated since 1.21, use generateContentDiffBody() instead!
*/
*
* @todo move this to TextDifferenceEngine, make DifferenceEngine abstract. At some point.
*
- * @param $otext String: old text, must be already segmented
- * @param $ntext String: new text, must be already segmented
+ * @param string $otext old text, must be already segmented
+ * @param string $ntext new text, must be already segmented
* @return bool|string
*/
function generateTextDiffBody( $otext, $ntext ) {
* Get a header for a specified revision.
*
* @param $rev Revision
- * @param $complete String: 'complete' to get the header wrapped depending
+ * @param string $complete 'complete' to get the header wrapped depending
* the visibility of the revision and a link to edit the page.
* @return String HTML fragment
*/
/**
* Get an external store object of the given type, with the given parameters
*
- * @param $proto string Type of external storage, should be a value in $wgExternalStores
- * @param $params array Associative array of ExternalStoreMedium parameters
+ * @param string $proto Type of external storage, should be a value in $wgExternalStores
+ * @param array $params Associative array of ExternalStoreMedium parameters
* @return ExternalStoreMedium|bool The store class or false on error
*/
public static function getStoreObject( $proto, array $params = array() ) {
/**
* Fetch data from given URL
*
- * @param $url string The URL of the text to get
- * @param $params array Associative array of ExternalStoreMedium parameters
+ * @param string $url The URL of the text to get
+ * @param array $params Associative array of ExternalStoreMedium parameters
* @return string|bool The text stored or false on error
* @throws MWException
*/
* The protocol part is used to identify the class, the rest is passed to the
* class itself as a parameter.
*
- * @param $url String A partial external store URL ("<store type>://<location>")
+ * @param string $url A partial external store URL ("<store type>://<location>")
* @param $data string
- * @param $params array Associative array of ExternalStoreMedium parameters
+ * @param array $params Associative array of ExternalStoreMedium parameters
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
* itself. It also fails-over to the next possible clusters.
*
* @param $data string
- * @param $params array Associative array of ExternalStoreMedium parameters
+ * @param array $params Associative array of ExternalStoreMedium parameters
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
/**
* Get a LoadBalancer for the specified cluster
*
- * @param $cluster String: cluster name
+ * @param string $cluster cluster name
* @return LoadBalancer object
*/
function &getLoadBalancer( $cluster ) {
/**
* Get a slave database connection for the specified cluster
*
- * @param $cluster String: cluster name
+ * @param string $cluster cluster name
* @return DatabaseBase object
*/
function &getSlave( $cluster ) {
/**
* Get a master database connection for the specified cluster
*
- * @param $cluster String: cluster name
+ * @param string $cluster cluster name
* @return DatabaseBase object
*/
function &getMaster( $cluster ) {
protected $params = array();
/**
- * @param $params array Options
+ * @param array $params Options
*/
public function __construct( array $params = array() ) {
$this->params = $params;
/**
* Fetch data from given external store URL
*
- * @param $url string An external store URL
+ * @param string $url An external store URL
* @return string|bool The text stored or false on error
* @throws MWException
*/
/**
* Insert a data item into a given location
*
- * @param $location string: the location name
- * @param $data string: the data item
+ * @param string $location the location name
+ * @param string $data the data item
* @return string|bool The URL of the stored data item, or false on error
* @throws MWException
*/
/**
* Sets up the file object
*
- * @param $path string Path to temporary file on local disk
+ * @param string $path Path to temporary file on local disk
* @throws MWException
*/
public function __construct( $path ) {
/**
* Get an associative array containing information about a file in the local filesystem.
*
- * @param $path String: absolute local filesystem path
+ * @param string $path absolute local filesystem path
* @param $ext Mixed: the file extension, or true to extract it from the filename.
* Set it to false to ignore the extension.
*
/**
* Sanity check a relative file system path for validity
*
- * @param $path string Normalized relative path
+ * @param string $path Normalized relative path
* @return bool
*/
protected function isLegalRelPath( $path ) {
/**
* Get the absolute file system path for a storage path
*
- * @param $storagePath string Storage path
+ * @param string $storagePath Storage path
* @return string|null
*/
protected function resolveToFSPath( $storagePath ) {
/**
* Chmod a file, suppressing the warnings
*
- * @param $path string Absolute file system path
+ * @param string $path Absolute file system path
* @return bool Success
*/
protected function chmod( $path ) {
/**
* Clean up directory separators for the given OS
*
- * @param $path string FS path
+ * @param string $path FS path
* @return string
*/
protected function cleanPathSlashes( $path ) {
protected $params = array();
/**
- * @param $dir string file system directory
+ * @param string $dir file system directory
* @param $params array
*/
public function __construct( $dir, array $params ) {
/**
* Return an appropriate iterator object to wrap
*
- * @param $dir string file system directory
+ * @param string $dir file system directory
* @return Iterator
*/
protected function initIterator( $dir ) {
* - a) unexpected operation errors occurred (network partitions, disk full...)
* - b) significant operation errors occurred and 'force' was not set
*
- * @param $ops Array List of operations to execute in order
- * @param $opts Array Batch operation options
+ * @param array $ops List of operations to execute in order
+ * @param array $opts Batch operation options
* @return Status
*/
final public function doOperations( array $ops, array $opts = array() ) {
*
* @see FileBackend::doOperations()
*
- * @param $op Array Operation
- * @param $opts Array Operation options
+ * @param array $op Operation
+ * @param array $opts Operation options
* @return Status
*/
final public function doOperation( array $op, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
*/
final public function create( array $params, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
*/
final public function store( array $params, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
*/
final public function copy( array $params, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
*/
final public function move( array $params, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
*/
final public function delete( array $params, array $opts = array() ) {
*
* @see FileBackend::doOperation()
*
- * @param $params Array Operation parameters
- * @param $opts Array Operation options
+ * @param array $params Operation parameters
+ * @param array $opts Operation options
* @return Status
* @since 1.21
*/
* will reflect each operation attempted for the given files. The status will be
* considered "OK" as long as no fatal errors occurred.
*
- * @param $ops Array Set of operations to execute
- * @param $opts Array Batch operation options
+ * @param array $ops Set of operations to execute
+ * @param array $opts Batch operation options
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperations()
*
- * @param $op Array Operation
+ * @param array $op Operation
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.20
*/
*
* @see FileBackend::doQuickOperation()
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* @return Status
* @since 1.21
*/
* otherwise safe from modification from other processes. Normally,
* the file will be a new temp file, which should be adequate.
*
- * @param $params Array Operation parameters
+ * @param array $params Operation parameters
* $params include:
* - srcs : ordered source storage paths (e.g. chunk1, chunk2, ...)
* - dst : file system path to 0-byte temp file
* Preload persistent file stat and property cache into in-process cache.
* This should be used when stat calls will be made on a known list of a many files.
*
- * @param $paths Array Storage paths
+ * @param array $paths Storage paths
* @return void
*/
public function preloadCache( array $paths ) {}
* Invalidate any in-process file stat and property cache.
* If $paths is given, then only the cache for those files will be cleared.
*
- * @param $paths Array Storage paths (optional)
+ * @param array $paths Storage paths (optional)
* @return void
*/
public function clearCache( array $paths = null ) {}
*
* Callers should consider using getScopedFileLocks() instead.
*
- * @param $paths Array Storage paths
+ * @param array $paths Storage paths
* @param $type integer LockManager::LOCK_* constant
* @return Status
*/
/**
* Unlock the files at the given storage paths in the backend.
*
- * @param $paths Array Storage paths
+ * @param array $paths Storage paths
* @param $type integer LockManager::LOCK_* constant
* @return Status
*/
* Once the return value goes out scope, the locks will be released and
* the status updated. Unlock fatals will not change the status "OK" value.
*
- * @param $paths Array Storage paths
+ * @param array $paths Storage paths
* @param $type integer LockManager::LOCK_* constant
* @param $status Status Status to update on lock/unlock
* @return ScopedLock|null Returns null on failure
*
* @see FileBackend::doOperations()
*
- * @param $ops Array List of file operations to FileBackend::doOperations()
+ * @param array $ops List of file operations to FileBackend::doOperations()
* @param $status Status Status to update on lock/unlock
* @return Array List of ScopedFileLocks or null values
* @since 1.20
/**
* Get the storage path for the given container for this backend
*
- * @param $container string Container name
+ * @param string $container Container name
* @return string Storage path
* @since 1.21
*/
/**
* Build a Content-Disposition header value per RFC 6266.
*
- * @param $type string One of (attachment, inline)
- * @param $filename string Suggested file name (should not contain slashes)
+ * @param string $type One of (attachment, inline)
+ * @param string $filename Suggested file name (should not contain slashes)
* @throws MWException
* @return string
* @since 1.20
*
* This uses the same traversal protection as Title::secureAndSplit().
*
- * @param $path string Storage path relative to a container
+ * @param string $path Storage path relative to a container
* @return string|null
*/
final protected static function normalizeContainerPath( $path ) {
/**
* Check that a set of files are consistent across all internal backends
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @return Status
*/
public function consistencyCheck( array $paths ) {
/**
* Check that a set of file paths are usable across all internal backends
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @return Status
*/
public function accessibilityCheck( array $paths ) {
* Check that a set of files are consistent across all internal backends
* and re-synchronize those files againt the "multi master" if needed.
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @return Status
*/
public function resyncFiles( array $paths ) {
/**
* Get a list of file storage paths to read or write for a list of operations
*
- * @param $ops Array Same format as doOperations()
+ * @param array $ops Same format as doOperations()
* @return Array List of storage paths to files (does not include directories)
*/
protected function fileStoragePathsForOps( array $ops ) {
* Substitute the backend name in storage path parameters
* for a set of operations with that of a given internal backend.
*
- * @param $ops Array List of file operation arrays
+ * @param array $ops List of file operation arrays
* @param $backend FileBackendStore
* @return Array
*/
/**
* Same as substOpBatchPaths() but for a single operation
*
- * @param $ops array File operation array
+ * @param array $ops File operation array
* @param $backend FileBackendStore
* @return Array
*/
/**
* Substitute the backend of storage paths with an internal backend's name
*
- * @param $paths Array|string List of paths or single string path
+ * @param array|string $paths List of paths or single string path
* @param $backend FileBackendStore
* @return Array|string
*/
/**
* Substitute the backend of internal storage paths with the proxy backend's name
*
- * @param $paths Array|string List of paths or single string path
+ * @param array|string $paths List of paths or single string path
* @return Array|string
*/
protected function unsubstPaths( $paths ) {
}
/**
- * @param $path string Storage path
+ * @param string $path Storage path
* @return bool Path container should have dir changes pushed to all backends
*/
protected function replicateContainerDirChanges( $path ) {
/**
* @see FileBackendStore::directoryExists()
*
- * @param $container string Resolved container name
- * @param $dir string Resolved path relative to container
+ * @param string $container Resolved container name
+ * @param string $dir Resolved path relative to container
* @param $params Array
* @return bool|null
*/
*
* @see FileBackendStore::getDirectoryList()
*
- * @param $container string Resolved container name
- * @param $dir string Resolved path relative to container
+ * @param string $container Resolved container name
+ * @param string $dir Resolved path relative to container
* @param $params Array
* @return Traversable|Array|null Returns null on failure
*/
*
* @see FileBackendStore::getFileList()
*
- * @param $container string Resolved container name
- * @param $dir string Resolved path relative to container
+ * @param string $container Resolved container name
+ * @param string $dir Resolved path relative to container
* @param $params Array
* @return Traversable|Array|null Returns null on failure
*/
* The result must have the same number of items as the input.
* An exception is thrown if an unsupported operation is requested.
*
- * @param $ops Array Same format as doOperations()
+ * @param array $ops Same format as doOperations()
* @return Array List of FileOp objects
* @throws MWException
*/
* each corresponding to a list of storage paths to be locked.
* All returned paths are normalized.
*
- * @param $performOps Array List of FileOp objects
+ * @param array $performOps List of FileOp objects
* @return Array ('sh' => list of paths, 'ex' => list of paths)
*/
final public function getPathsToLockForOpsInternal( array $performOps ) {
* The resulting Status object fields will correspond
* to the order in which the handles where given.
*
- * @param $handles Array List of FileBackendStoreOpHandle objects
+ * @param array $handles List of FileBackendStoreOpHandle objects
* @return Array Map of Status objects
* @throws MWException
*/
/**
* Strip long HTTP headers from a file operation
*
- * @param $op array Same format as doOperation()
+ * @param array $op Same format as doOperation()
* @return Array
*/
protected function stripInvalidHeadersFromOp( array $op ) {
*
* @see FileBackend::clearCache()
*
- * @param $paths Array Storage paths (optional)
+ * @param array $paths Storage paths (optional)
* @return void
*/
protected function doClearCache( array $paths = null ) {}
* Get the container name shard suffix for a given path.
* Any empty suffix means the container is not sharded.
*
- * @param $container string Container name
- * @param $relPath string Storage path relative to the container
+ * @param string $container Container name
+ * @param string $relPath Storage path relative to the container
* @return string|null Returns null if shard could not be determined
*/
final protected function getContainerShard( $container, $relPath ) {
* Container dirs like "a", where the container shards on "x/xy",
* can reside on several shards. Such paths are tricky to handle.
*
- * @param $storagePath string Storage path
+ * @param string $storagePath Storage path
* @return bool
*/
final public function isSingleShardPathInternal( $storagePath ) {
* getting absolute paths (e.g. FS based backends). Note that the relative path
* may be the empty string (e.g. the path is simply to the container).
*
- * @param $container string Container name
- * @param $relStoragePath string Storage path relative to the container
+ * @param string $container Container name
+ * @param string $relStoragePath Storage path relative to the container
* @return string|null Path or null if not valid
*/
protected function resolveContainerPath( $container, $relStoragePath ) {
/**
* Get the cache key for a container
*
- * @param $container string Resolved container name
+ * @param string $container Resolved container name
* @return string
*/
private function containerCacheKey( $container ) {
/**
* Set the cached info for a container
*
- * @param $container string Resolved container name
+ * @param string $container Resolved container name
* @param $val mixed Information to cache
*/
final protected function setContainerCache( $container, $val ) {
* Delete the cached info for a container.
* The cache key is salted for a while to prevent race conditions.
*
- * @param $container string Resolved container name
+ * @param string $container Resolved container name
*/
final protected function deleteContainerCache( $container ) {
if ( !$this->memCache->set( $this->containerCacheKey( $container ), 'PURGED', 300 ) ) {
* resolved container names and their corresponding cached info.
* Only containers that actually exist should appear in the map.
*
- * @param $containerInfo Array Map of resolved container names to cached info
+ * @param array $containerInfo Map of resolved container names to cached info
* @return void
*/
protected function doPrimeContainerCache( array $containerInfo ) {}
/**
* Get the cache key for a file path
*
- * @param $path string Normalized storage path
+ * @param string $path Normalized storage path
* @return string
*/
private function fileCacheKey( $path ) {
* Negatives (404s) are not cached. By not caching negatives, we can skip cache
* salting for the case when a file is created at a path were there was none before.
*
- * @param $path string Storage path
+ * @param string $path Storage path
* @param $val mixed Information to cache
*/
final protected function setFileCache( $path, $val ) {
* Since negatives (404s) are not cached, this does not need to be called when
* a file is created at a path were there was none before.
*
- * @param $path string Storage path
+ * @param string $path Storage path
*/
final protected function deleteFileCache( $path ) {
$path = FileBackend::normalizeStoragePath( $path );
* used in a list of storage paths or FileOp objects.
* This loads the persistent cache values into the process cache.
*
- * @param $items Array List of storage paths or FileOps
+ * @param array $items List of storage paths or FileOps
* @return void
*/
final protected function primeFileCache( array $items ) {
/**
* Set the 'concurrency' option from a list of operation options
*
- * @param $opts array Map of operation options
+ * @param array $opts Map of operation options
* @return Array
*/
final protected function setConcurrencyFlags( array $opts ) {
/**
* @param $backend FileBackendStore
- * @param $container string Full storage container name
- * @param $dir string Storage directory relative to container
- * @param $suffixes Array List of container shard suffixes
+ * @param string $container Full storage container name
+ * @param string $dir Storage directory relative to container
+ * @param array $suffixes List of container shard suffixes
* @param $params Array
*/
public function __construct(
/**
* Get the list for a given container shard
*
- * @param $container string Resolved container name
- * @param $dir string Resolved path relative to container
+ * @param string $container Resolved container name
+ * @param string $dir Resolved path relative to container
* @param $params Array
* @return Traversable|Array|null
*/
/**
* Update a dependency tracking array to account for this operation
*
- * @param $deps Array Prior path reads/writes; format of FileOp::newPredicates()
+ * @param array $deps Prior path reads/writes; format of FileOp::newPredicates()
* @return Array
*/
final public function applyDependencies( array $deps ) {
/**
* Check if this operation changes files listed in $paths
*
- * @param $paths Array Prior path reads/writes; format of FileOp::newPredicates()
+ * @param array $paths Prior path reads/writes; format of FileOp::newPredicates()
* @return boolean
*/
final public function dependsOn( array $deps ) {
/**
* Get the file journal entries for this file operation
*
- * @param $oPredicates Array Pre-op info about files (format of FileOp::newPredicates)
- * @param $nPredicates Array Post-op info about files (format of FileOp::newPredicates)
+ * @param array $oPredicates Pre-op info about files (format of FileOp::newPredicates)
+ * @param array $nPredicates Post-op info about files (format of FileOp::newPredicates)
* @return Array
*/
final public function getJournalEntries( array $oPredicates, array $nPredicates ) {
/**
* Check if a file will exist in storage when this operation is attempted
*
- * @param $source string Storage path
+ * @param string $source Storage path
* @param $predicates Array
* @return bool
*/
/**
* Get the SHA-1 of a file in storage when this operation is attempted
*
- * @param $source string Storage path
+ * @param string $source Storage path
* @param $predicates Array
* @return string|bool False on failure
*/
* - a) unexpected operation errors occurred (network partitions, disk full...)
* - b) significant operation errors occurred and 'force' was not set
*
- * @param $performOps Array List of FileOp operations
- * @param $opts Array Batch operation options
+ * @param array $performOps List of FileOp operations
+ * @param array $opts Batch operation options
* @param $journal FileJournal Journal to log operations to
* @return Status
*/
}
/**
- * @param $disposition string Content-Disposition header value
+ * @param string $disposition Content-Disposition header value
* @return string Truncated Content-Disposition header value to meet Swift limits
*/
protected function truncDisp( $disposition ) {
* Fill in any missing object metadata and save it to Swift
*
* @param $obj CF_Object
- * @param $path string Storage path to object
+ * @param string $path Storage path to object
* @return bool Success
* @throws Exception cloudfiles exceptions
*/
/**
* Do not call this function outside of SwiftFileBackendFileList
*
- * @param $fullCont string Resolved container name
- * @param $dir string Resolved storage directory with no trailing slash
- * @param $after string|null Storage path of file to list items after
+ * @param string $fullCont Resolved container name
+ * @param string $dir Resolved storage directory with no trailing slash
+ * @param string|null $after Storage path of file to list items after
* @param $limit integer Max number of items to list
- * @param $params Array Includes flag for 'topOnly'
+ * @param array $params Includes flag for 'topOnly'
* @return Array List of relative paths of dirs directly under $dir
*/
public function getDirListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
/**
* Do not call this function outside of SwiftFileBackendFileList
*
- * @param $fullCont string Resolved container name
- * @param $dir string Resolved storage directory with no trailing slash
- * @param $after string|null Storage path of file to list items after
+ * @param string $fullCont Resolved container name
+ * @param string $dir Resolved storage directory with no trailing slash
+ * @param string|null $after Storage path of file to list items after
* @param $limit integer Max number of items to list
- * @param $params Array Includes flag for 'topOnly'
+ * @param array $params Includes flag for 'topOnly'
* @return Array List of relative paths of files under $dir
*/
public function getFileListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
* (lists are truncated to 10000 item with no way to page), and is just a performance risk.
*
* @param $contObj CF_Container Swift container
- * @param $readGrps Array List of read access routes
- * @param $writeGrps Array List of write access routes
+ * @param array $readGrps List of read access routes
+ * @param array $writeGrps List of write access routes
* @return Status
*/
protected function setContainerAccess(
* Purge the CDN cache of affected objects if CDN caching is enabled.
* This is for Rackspace/Akamai CDNs.
*
- * @param $objects Array List of CF_Object items
+ * @param array $objects List of CF_Object items
* @return void
*/
public function purgeCDNCache( array $objects ) {
* Get a Swift container object, possibly from process cache.
* Use $reCache if the file count or byte count is needed.
*
- * @param $container string Container name
- * @param $bypassCache bool Bypass all caches and load from Swift
+ * @param string $container Container name
+ * @param bool $bypassCache Bypass all caches and load from Swift
* @return CF_Container
* @throws CloudFilesException
*/
/**
* Create a Swift container
*
- * @param $container string Container name
+ * @param string $container Container name
* @return CF_Container
* @throws CloudFilesException
*/
/**
* Delete a Swift container
*
- * @param $container string Container name
+ * @param string $container Container name
* @return void
* @throws CloudFilesException
*/
/**
* @param $backend SwiftFileBackend
- * @param $fullCont string Resolved container name
- * @param $dir string Resolved directory relative to container
+ * @param string $fullCont Resolved container name
+ * @param string $dir Resolved directory relative to container
* @param $params Array
*/
public function __construct( SwiftFileBackend $backend, $fullCont, $dir, array $params ) {
/**
* Get the given list portion (page)
*
- * @param $container string Resolved container name
- * @param $dir string Resolved path relative to container
+ * @param string $container Resolved container name
+ * @param string $dir Resolved path relative to container
* @param $after string|null
* @param $limit integer
* @param $params Array
* Create an appropriate FileJournal object from config
*
* @param $config Array
- * @param $backend string A registered file backend name
+ * @param string $backend A registered file backend name
* @throws MWException
* @return FileJournal
*/
* newSha1 : The final base 36 SHA-1 of the file
* Note that 'false' should be used as the SHA-1 for non-existing files.
*
- * @param $entries Array List of file operations (each an array of parameters)
- * @param $batchId string UUID string that identifies the operation batch
+ * @param array $entries List of file operations (each an array of parameters)
+ * @param string $batchId UUID string that identifies the operation batch
* @return Status
*/
final public function logChangeBatch( array $entries, $batchId ) {
/**
* @see FileJournal::logChangeBatch()
*
- * @param $entries Array List of file operations (each an array of parameters)
- * @param $batchId string UUID string that identifies the operation batch
+ * @param array $entries List of file operations (each an array of parameters)
+ * @param string $batchId UUID string that identifies the operation batch
* @return Status
*/
abstract protected function doLogChangeBatch( array $entries, $batchId );
* This tells the DB server how long to wait before assuming
* connection failure and releasing all the locks for a session.
*
- * @param Array $config
+ * @param array $config
*/
public function __construct( array $config ) {
parent::__construct( $config );
* each having an odd-numbered list of server names (peers) as values.
* - connTimeout : Lock server connection attempt timeout. [optional]
*
- * @param Array $config
+ * @param array $config
*/
public function __construct( array $config ) {
parent::__construct( $config );
/**
* Lock the resources at the given abstract paths
*
- * @param $paths Array List of resource names
+ * @param array $paths List of resource names
* @param $type integer LockManager::LOCK_* constant
* @return Status
*/
/**
* Unlock the resources at the given abstract paths
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @param $type integer LockManager::LOCK_* constant
* @return Status
*/
/**
* Lock resources with the given keys and lock type
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @param $type integer LockManager::LOCK_* constant
* @return string
*/
/**
* Unlock resources with the given keys and lock type
*
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @param $type integer LockManager::LOCK_* constant
* @return string
*/
protected $managers = array();
/**
- * @param $domain string Domain (usually wiki ID)
+ * @param string $domain Domain (usually wiki ID)
*/
protected function __construct( $domain ) {
$this->domain = $domain;
}
/**
- * @param $domain string Domain (usually wiki ID)
+ * @param string $domain Domain (usually wiki ID)
* @return LockManagerGroup
*/
public static function singleton( $domain = false ) {
* - memcConfig : Configuration array for ObjectCache::newFromParams. [optional]
* If set, this must use one of the memcached classes.
*
- * @param Array $config
+ * @param array $config
* @throws MWException
*/
public function __construct( array $config ) {
/**
* Get the MemcachedBagOStuff object for a $lockSrv
*
- * @param $lockSrv string Server name
+ * @param string $lockSrv Server name
* @return MemcachedBagOStuff|null
*/
protected function getCache( $lockSrv ) {
/**
* @param $memc MemcachedBagOStuff
- * @param $keys Array List of keys to acquire
+ * @param array $keys List of keys to acquire
* @return bool
*/
protected function acquireMutexes( MemcachedBagOStuff $memc, array $keys ) {
/**
* @param $memc MemcachedBagOStuff
- * @param $keys Array List of acquired keys
+ * @param array $keys List of acquired keys
* @return void
*/
protected function releaseMutexes( MemcachedBagOStuff $memc, array $keys ) {
* This is all or nothing; if any key is locked then this totally fails.
*
* @param $bucket integer
- * @param $paths Array List of resource keys to lock
+ * @param array $paths List of resource keys to lock
* @param $type integer LockManager::LOCK_EX or LockManager::LOCK_SH
* @return Status
*/
* Attempt to release locks with the peers for a bucket
*
* @param $bucket integer
- * @param $paths Array List of resource keys to lock
+ * @param array $paths List of resource keys to lock
* @param $type integer LockManager::LOCK_EX or LockManager::LOCK_SH
* @return Status
*/
/**
* @param $manager LockManager
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @param $type integer LockManager::LOCK_* constant
* @param $status Status
*/
* The status object is updated with any errors or warnings.
*
* @param $manager LockManager
- * @param $paths Array List of storage paths
+ * @param array $paths List of storage paths
* @param $type integer LockManager::LOCK_* constant
* @param $status Status
* @return ScopedLock|null Returns null on failure
/**
* Check if a single zone or list of zones is defined for usage
*
- * @param $doZones Array Only do a particular zones
+ * @param array $doZones Only do a particular zones
* @throws MWException
* @return Status
*/
/**
* Get the URL corresponding to one of the four basic zones
*
- * @param $zone String One of: public, deleted, temp, thumb
- * @param $ext String|null Optional file extension
+ * @param string $zone One of: public, deleted, temp, thumb
+ * @param string|null $ext Optional file extension
* @return String or false
*/
public function getZoneUrl( $zone, $ext = null ) {
* from the URL path, one can configure thumb_handler.php to recognize a special path on the
* same host name as the wiki that is used for viewing thumbnails.
*
- * @param $zone String: one of: public, deleted, temp, thumb
+ * @param string $zone one of: public, deleted, temp, thumb
* @return String or false
*/
public function getZoneHandlerUrl( $zone ) {
* version control should return false if the time is specified.
*
* @param $title Mixed: Title object or string
- * @param $options array Associative array of options:
+ * @param array $options Associative array of options:
* time: requested time for a specific file version, or false for the
* current version. An image object will be returned which was
* created at the specified time (which may be archived or current).
/**
* Find many files at once.
*
- * @param $items array An array of titles, or an array of findFile() options with
+ * @param array $items An array of titles, or an array of findFile() options with
* the "title" option giving the title. Example:
*
* $findItem = array( 'title' => $title, 'private' => true );
* Returns false if the file does not exist. Repositories not supporting
* version control should return false if the time is specified.
*
- * @param $sha1 String base 36 SHA-1 hash
- * @param $options array Option array, same as findFile().
+ * @param string $sha1 base 36 SHA-1 hash
+ * @param array $options Option array, same as findFile().
* @return File|bool False on failure
*/
public function findFileFromKey( $sha1, $options = array() ) {
* Get an array of arrays or iterators of file objects for files that
* have the given SHA-1 content hashes.
*
- * @param $hashes array An array of hashes
+ * @param array $hashes An array of hashes
* @return array An Array of arrays or iterators of file objects and the hash as key
*/
public function findBySha1s( array $hashes ) {
* Get a relative path including trailing slash, e.g. f/fa/
* If the repo is not hashed, returns an empty string
*
- * @param $name string Name of file
+ * @param string $name Name of file
* @return string
*/
public function getHashPath( $name ) {
* Get a relative path including trailing slash, e.g. f/fa/
* If the repo is not hashed, returns an empty string
*
- * @param $suffix string Basename of file from FileRepo::storeTemp()
+ * @param string $suffix Basename of file from FileRepo::storeTemp()
* @return string
*/
public function getTempHashPath( $suffix ) {
* Make an url to this repo
*
* @param $query mixed Query string to append
- * @param $entry string Entry point; defaults to index
+ * @param string $entry Entry point; defaults to index
* @return string|bool False on failure
*/
public function makeUrl( $query = '', $entry = 'index' ) {
* repository's file class, since it may return invalid results. User code
* should use File::getDescriptionText().
*
- * @param $name String: name of image to fetch
- * @param $lang String: language to fetch it in, if any.
+ * @param string $name name of image to fetch
+ * @param string $lang language to fetch it in, if any.
* @return string
*/
public function getDescriptionRenderUrl( $name, $lang = null ) {
/**
* Store a file to a given destination.
*
- * @param $srcPath String: source file system path, storage path, or virtual URL
- * @param $dstZone String: destination zone
- * @param $dstRel String: destination relative path
+ * @param string $srcPath source file system path, storage path, or virtual URL
+ * @param string $dstZone destination zone
+ * @param string $dstRel destination relative path
* @param $flags Integer: bitwise combination of the following flags:
* self::DELETE_SOURCE Delete the source file after upload
* self::OVERWRITE Overwrite an existing destination file instead of failing
/**
* Store a batch of files
*
- * @param $triplets Array: (src, dest zone, dest rel) triplets as per store()
+ * @param array $triplets (src, dest zone, dest rel) triplets as per store()
* @param $flags Integer: bitwise combination of the following flags:
* self::DELETE_SOURCE Delete the source file after upload
* self::OVERWRITE Overwrite an existing destination file instead of failing
* Each file can be a (zone, rel) pair, virtual url, storage path.
* It will try to delete each file, but ignores any errors that may occur.
*
- * @param $files array List of files to delete
+ * @param array $files List of files to delete
* @param $flags Integer: bitwise combination of the following flags:
* self::SKIP_LOCKING Skip any file locking when doing the deletions
* @return FileRepoStatus
* This function can be used to write to otherwise read-only foreign repos.
* This is intended for copying generated thumbnails into the repo.
*
- * @param $src string Source file system path, storage path, or virtual URL
- * @param $dst string Virtual URL or storage path
- * @param $disposition string|null Content-Disposition if given and supported
+ * @param string $src Source file system path, storage path, or virtual URL
+ * @param string $dst Virtual URL or storage path
+ * @param string|null $disposition Content-Disposition if given and supported
* @return FileRepoStatus
*/
final public function quickImport( $src, $dst, $disposition = null ) {
* This function can be used to write to otherwise read-only foreign repos.
* This is intended for purging thumbnails.
*
- * @param $path string Virtual URL or storage path
+ * @param string $path Virtual URL or storage path
* @return FileRepoStatus
*/
final public function quickPurge( $path ) {
* Deletes a directory if empty.
* This function can be used to write to otherwise read-only foreign repos.
*
- * @param $dir string Virtual URL (or storage path) of directory to clean
+ * @param string $dir Virtual URL (or storage path) of directory to clean
* @return Status
*/
public function quickCleanDir( $dir ) {
* All path parameters may be a file system path, storage path, or virtual URL.
* When "dispositions" are given they are used as Content-Disposition if supported.
*
- * @param $triples Array List of (source path, destination path, disposition)
+ * @param array $triples List of (source path, destination path, disposition)
* @return FileRepoStatus
*/
public function quickImportBatch( array $triples ) {
* This function can be used to write to otherwise read-only foreign repos.
* This does no locking nor journaling and is intended for purging thumbnails.
*
- * @param $paths Array List of virtual URLs or storage paths
+ * @param array $paths List of virtual URLs or storage paths
* @return FileRepoStatus
*/
public function quickPurgeBatch( array $paths ) {
* Returns a FileRepoStatus object with the file Virtual URL in the value,
* file can later be disposed using FileRepo::freeTemp().
*
- * @param $originalName String: the base name of the file as specified
+ * @param string $originalName the base name of the file as specified
* by the user. The file extension will be maintained.
- * @param $srcPath String: the current location of the file.
+ * @param string $srcPath the current location of the file.
* @return FileRepoStatus object with the URL in the value.
*/
public function storeTemp( $originalName, $srcPath ) {
/**
* Remove a temporary file or mark it for garbage collection
*
- * @param $virtualUrl String: the virtual URL returned by FileRepo::storeTemp()
+ * @param string $virtualUrl the virtual URL returned by FileRepo::storeTemp()
* @return Boolean: true on success, false on failure
*/
public function freeTemp( $virtualUrl ) {
/**
* Concatenate a list of temporary files into a target file location.
*
- * @param $srcPaths Array Ordered list of source virtual URLs/storage paths
- * @param $dstPath String Target file system path
+ * @param array $srcPaths Ordered list of source virtual URLs/storage paths
+ * @param string $dstPath Target file system path
* @param $flags Integer: bitwise combination of the following flags:
* self::DELETE_SOURCE Delete the source files
* @return FileRepoStatus
* Options to $options include:
* - headers : name/value map of HTTP headers to use in response to GET/HEAD requests
*
- * @param $srcPath String: the source file system path, storage path, or URL
- * @param $dstRel String: the destination relative path
- * @param $archiveRel String: the relative path where the existing file is to
+ * @param string $srcPath the source file system path, storage path, or URL
+ * @param string $dstRel the destination relative path
+ * @param string $archiveRel the relative path where the existing file is to
* be archived, if there is one. Relative to the public zone root.
* @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
* that the source file should be deleted if possible
- * @param $options Array Optional additional parameters
+ * @param array $options Optional additional parameters
* @return FileRepoStatus
*/
public function publish(
/**
* Publish a batch of files
*
- * @param $ntuples Array: (source, dest, archive) triplets or
+ * @param array $ntuples (source, dest, archive) triplets or
* (source, dest, archive, options) 4-tuples as per publish().
* @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
* that the source files should be deleted if possible
* Creates a directory with the appropriate zone permissions.
* Callers are responsible for doing read-only and "writable repo" checks.
*
- * @param $dir string Virtual URL (or storage path) of directory to clean
+ * @param string $dir Virtual URL (or storage path) of directory to clean
* @return Status
*/
protected function initDirectory( $dir ) {
/**
* Deletes a directory if empty.
*
- * @param $dir string Virtual URL (or storage path) of directory to clean
+ * @param string $dir Virtual URL (or storage path) of directory to clean
* @return Status
*/
public function cleanDir( $dir ) {
/**
* Checks existence of a a file
*
- * @param $file string Virtual URL (or storage path) of file to check
+ * @param string $file Virtual URL (or storage path) of file to check
* @return bool
*/
public function fileExists( $file ) {
/**
* Checks existence of an array of files.
*
- * @param $files Array: Virtual URLs (or storage paths) of files to check
+ * @param array $files Virtual URLs (or storage paths) of files to check
* @return array|bool Either array of files and existence flags, or false
*/
public function fileExistsBatch( array $files ) {
* assumes a naming scheme in the deleted zone based on content hash, as
* opposed to the public zone which is assumed to be unique.
*
- * @param $sourceDestPairs Array of source/destination pairs. Each element
+ * @param array $sourceDestPairs of source/destination pairs. Each element
* is a two-element array containing the source file path relative to the
* public root in the first element, and the archive file path relative
* to the deleted zone root in the second element.
* Attempt to stream a file with the given virtual URL/storage path
*
* @param $virtualUrl string
- * @param $headers Array Additional HTTP headers to send on success
+ * @param array $headers Additional HTTP headers to send on success
* @return bool Success
*/
public function streamFile( $virtualUrl, $headers = array() ) {
* If the url has been requested today, get it from cache
* Otherwise retrieve remote thumb url, check for local file.
*
- * @param $name String is a dbkey form of a title
+ * @param string $name is a dbkey form of a title
* @param $width
* @param $height
- * @param String $params Other rendering parameters (page number, etc) from handler's makeParamString.
+ * @param string $params Other rendering parameters (page number, etc) from handler's makeParamString.
* @return bool|string
*/
function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
/**
* @see FileRepo::getZoneUrl()
* @param $zone String
- * @param $ext String|null Optional file extension
+ * @param string|null $ext Optional file extension
* @return String
*/
function getZoneUrl( $zone, $ext = null ) {
/**
* Check if a deleted (filearchive) file has this sha1 key
*
- * @param $key String File storage key (base-36 sha1 key with file extension)
- * @param $lock String|null Use "lock" to lock the row via FOR UPDATE
+ * @param string $key File storage key (base-36 sha1 key with file extension)
+ * @param string|null $lock Use "lock" to lock the row via FOR UPDATE
* @return bool File with this key is in use
*/
protected function deletedFileHasKey( $key, $lock = null ) {
/**
* Check if a hidden (revision delete) file has this sha1 key
*
- * @param $key String File storage key (base-36 sha1 key with file extension)
- * @param $lock String|null Use "lock" to lock the row via FOR UPDATE
+ * @param string $key File storage key (base-36 sha1 key with file extension)
+ * @param string|null $lock Use "lock" to lock the row via FOR UPDATE
* @return bool File with this key is in use
*/
protected function hiddenFileHasKey( $key, $lock = null ) {
* Get an array or iterator of file objects for files that have a given
* SHA-1 content hash.
*
- * @param $hash String a sha1 hash to look for
+ * @param string $hash a sha1 hash to look for
* @return Array
*/
function findBySha1( $hash ) {
*
* Overrides generic implementation in FileRepo for performance reason
*
- * @param $hashes array An array of hashes
+ * @param array $hashes An array of hashes
* @return array An Array of arrays or iterators of file objects and the hash as key
*/
function findBySha1s( array $hashes ) {
/**
* Construct a group of file repositories.
*
- * @param $localInfo array Associative array for local repo's info
- * @param $foreignInfo Array of repository info arrays.
+ * @param array $localInfo Associative array for local repo's info
+ * @param array $foreignInfo of repository info arrays.
* Each info array is an associative array with the 'class' member
* giving the class name. The entire array is passed to the repository
* constructor as the first parameter.
* You can also use wfFindFile() to do this.
*
* @param $title Title|string Title object or string
- * @param $options array Associative array of options:
+ * @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
* created at the specified time.
* Find an instance of the file with this key, created at the specified time
* Returns false if the file does not exist.
*
- * @param $hash String base 36 SHA-1 hash
- * @param $options array Option array, same as findFile()
+ * @param string $hash base 36 SHA-1 hash
+ * @param array $options Option array, same as findFile()
* @return File object or false if it is not found
*/
function findFileFromKey( $hash, $options = array() ) {
/**
* Find all instances of files with this key
*
- * @param $hash String base 36 SHA-1 hash
+ * @param string $hash base 36 SHA-1 hash
* @return Array of File objects
*/
function findBySha1( $hash ) {
/**
* Find all instances of files with this keys
*
- * @param $hashes Array base 36 SHA-1 hashes
+ * @param array $hashes base 36 SHA-1 hashes
* @return Array of array of File objects
*/
function findBySha1s( array $hashes ) {
* first parameter.
*
* @param $callback Callback: the function to call
- * @param $params Array: optional additional parameters to pass to the function
+ * @param array $params optional additional parameters to pass to the function
* @return bool
*/
function forEachForeignRepo( $callback, $params = array() ) {
* valid Title object with namespace NS_FILE or null
*
* @param $title Title|string
- * @param $exception string|bool Use 'exception' to throw an error on bad titles
+ * @param string|bool $exception Use 'exception' to throw an error on bad titles
* @throws MWException
* @return Title|null
*/
* Normalize a file extension to the common form, and ensure it's clean.
* Extensions with non-alphanumeric characters will be discarded.
*
- * @param $ext string (without the .)
+ * @param string $ext (without the .)
* @return string
*/
static function normalizeExtension( $ext ) {
* Checks if file extensions are compatible
*
* @param $old File Old file
- * @param $new string New name
+ * @param string $new New name
*
* @return bool|null
*/
* Returns ID or name of user who uploaded the file
* STUB
*
- * @param $type string 'text' or 'id'
+ * @param string $type 'text' or 'id'
*
* @return string|int
*/
* Use File::THUMB_FULL_NAME to always get a name like "<params>-<source>".
* Otherwise, the format may be "<params>-<source>" or "<params>-thumbnail.<ext>".
*
- * @param $params Array: handler-specific parameters
+ * @param array $params handler-specific parameters
* @param $flags integer Bitfield that supports THUMB_* constants
* @return string
*/
/**
* Return either a MediaTransformError or placeholder thumbnail (if $wgIgnoreImageErrors)
*
- * @param $thumbPath string Thumbnail storage path
- * @param $thumbUrl string Thumbnail URL
+ * @param string $thumbPath Thumbnail storage path
+ * @param string $thumbUrl Thumbnail URL
* @param $params Array
* @param $flags integer
* @return MediaTransformOutput
/**
* Transform a media file
*
- * @param $params Array: an associative array of handler-specific parameters.
+ * @param array $params an associative array of handler-specific parameters.
* Typical keys are width, height and page.
* @param $flags Integer: a bitfield, may contain self::RENDER_NOW to force rendering
* @return MediaTransformOutput|bool False on failure
}
/**
- * @param $thumbName string Thumbnail name
+ * @param string $thumbName Thumbnail name
* @return string Content-Disposition header value
*/
function getThumbDisposition( $thumbName ) {
* Purge shared caches such as thumbnails and DB data caching
* STUB
* Overridden by LocalFile
- * @param $options Array Options, which include:
+ * @param array $options Options, which include:
* 'forThumbRefresh' : The purging is only to refresh thumbnails
*/
function purgeCache( $options = array() ) {}
*
* STUB
* @param $limit integer Limit of rows to return
- * @param $start string timestamp Only revisions older than $start will be returned
- * @param $end string timestamp Only revisions newer than $end will be returned
- * @param $inc bool Include the endpoints of the time range
+ * @param string $start timestamp Only revisions older than $start will be returned
+ * @param string $end timestamp Only revisions newer than $end will be returned
+ * @param bool $inc Include the endpoints of the time range
*
* @return array
*/
/**
* Get the path of an archived file relative to the public zone root
*
- * @param $suffix bool|string if not false, the name of an archived thumbnail file
+ * @param bool|string $suffix if not false, the name of an archived thumbnail file
*
* @return string
*/
* Get the path, relative to the thumbnail zone root, of the
* thumbnail directory or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
* Get the path, relative to the thumbnail zone root, for an archived file's thumbs directory
* or a specific thumb if the $suffix is given.
*
- * @param $archiveName string the timestamped name of an archived image
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param string $archiveName the timestamped name of an archived image
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the path of the archived file.
*
- * @param $suffix bool|string if not false, the name of an archived file.
+ * @param bool|string $suffix if not false, the name of an archived file.
*
* @return string
*/
/**
* Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified
*
- * @param $archiveName string the timestamped name of an archived image
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param string $archiveName the timestamped name of an archived image
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the path of the thumbnail directory, or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the path of the transcoded directory, or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of a media file
+ * @param bool|string $suffix if not false, the name of a media file
*
* @return string
*/
/**
* Get the URL of the archive directory, or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of an archived file
+ * @param bool|string $suffix if not false, the name of an archived file
*
* @return string
*/
/**
* Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified
*
- * @param $archiveName string the timestamped name of an archived image
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param string $archiveName the timestamped name of an archived image
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the URL of the zone directory, or a particular file if $suffix is specified
*
- * @param $zone string name of requested zone
- * @param $suffix bool|string if not false, the name of a file in zone
+ * @param string $zone name of requested zone
+ * @param bool|string $suffix if not false, the name of a file in zone
*
* @return string path
*/
/**
* Get the URL of the thumbnail directory, or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string path
*/
/**
* Get the URL of the transcoded directory, or a particular file if $suffix is specified
*
- * @param $suffix bool|string if not false, the name of a media file
+ * @param bool|string $suffix if not false, the name of a media file
*
* @return string path
*/
/**
* Get the public zone virtual URL for a current version source file
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the public zone virtual URL for an archived version source file
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
/**
* Get the virtual URL for a thumbnail file or directory
*
- * @param $suffix bool|string if not false, the name of a thumbnail file
+ * @param bool|string $suffix if not false, the name of a thumbnail file
*
* @return string
*/
* Options to $options include:
* - headers : name/value map of HTTP headers to use in response to GET/HEAD requests
*
- * @param $srcPath String: local filesystem path to the source image
+ * @param string $srcPath local filesystem path to the source image
* @param $flags Integer: a bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move
* rather than copy
- * @param $options Array Optional additional parameters
+ * @param array $options Optional additional parameters
* @return FileRepoStatus object. On success, the value member contains the
* archive name, or an empty string if it was a new file.
*
*
* May throw database exceptions on error.
*
- * @param $versions array set of record ids of deleted items to restore,
+ * @param array $versions set of record ids of deleted items to restore,
* or empty to restore all revisions.
- * @param $unsuppress bool remove restrictions on content upon restoration?
+ * @param bool $unsuppress remove restrictions on content upon restoration?
* @return int|bool the number of file revisions restored if successful,
* or false on failure
* STUB
* Get an image size array like that returned by getImageSize(), or false if it
* can't be determined.
*
- * @param $fileName String: The filename
+ * @param string $fileName The filename
* @return Array
*/
function getImageSize( $fileName ) {
/**
* Get an associative array containing information about a file in the local filesystem.
*
- * @param $path String: absolute local filesystem path
+ * @param string $path absolute local filesystem path
* @param $ext Mixed: the file extension, or true to extract it from the filename.
* Set it to false to ignore the extension.
*
}
/**
- * @param Array $params
+ * @param array $params
* @param int $flags
* @return bool|MediaTransformOutput
*/
* Create a LocalFile from a SHA-1 key
* Do not call this except from inside a repo class.
*
- * @param $sha1 string base-36 SHA-1
+ * @param string $sha1 base-36 SHA-1
* @param $repo LocalRepo
* @param string|bool $timestamp MW_timestamp (optional)
*
/**
* Returns ID or name of user who uploaded the file
*
- * @param $type string 'text' or 'id'
+ * @param string $type 'text' or 'id'
* @return int|string
*/
function getUser( $type = 'text' ) {
/**
* Get all thumbnail names previously generated for this file
- * @param $archiveName string|bool Name of an archive file, default false
+ * @param string|bool $archiveName Name of an archive file, default false
* @return array first element is the base dir, then files in that base dir.
*/
function getThumbnails( $archiveName = false ) {
/**
* Delete cached transformed files for an archived version only.
- * @param $archiveName string name of the archived file
+ * @param string $archiveName name of the archived file
*/
function purgeOldThumbnails( $archiveName ) {
global $wgUseSquid;
/**
* Delete a list of thumbnails visible at urls
- * @param $dir string base dir of the files.
- * @param $files array of strings: relative filenames (to $dir)
+ * @param string $dir base dir of the files.
+ * @param array $files of strings: relative filenames (to $dir)
*/
protected function purgeThumbList( $dir, $files ) {
$fileListDebug = strtr(
/**
* Upload a file and record it in the DB
- * @param $srcPath String: source storage path, virtual URL, or filesystem path
- * @param $comment String: upload description
- * @param $pageText String: text to use for the new description page,
+ * @param string $srcPath source storage path, virtual URL, or filesystem path
+ * @param string $comment upload description
+ * @param string $pageText text to use for the new description page,
* if a new description page is created
* @param $flags Integer|bool: flags for publish()
- * @param $props Array|bool: File properties, if known. This can be used to reduce the
+ * @param array|bool $props File properties, if known. This can be used to reduce the
* upload time when uploading virtual URLs for which the file info
* is already known
- * @param $timestamp String|bool: timestamp for img_timestamp, or false to use the current time
+ * @param string|bool $timestamp timestamp for img_timestamp, or false to use the current time
* @param $user User|null: User object or null to use $wgUser
*
* @return FileRepoStatus object. On success, the value member contains the
* The archive name should be passed through to recordUpload for database
* registration.
*
- * @param $srcPath String: local filesystem path to the source image
+ * @param string $srcPath local filesystem path to the source image
* @param $flags Integer: a bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move rather than copy
- * @param $options Array Optional additional parameters
+ * @param array $options Optional additional parameters
* @return FileRepoStatus object. On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
* The archive name should be passed through to recordUpload for database
* registration.
*
- * @param $srcPath String: local filesystem path to the source image
- * @param $dstRel String: target relative path
+ * @param string $srcPath local filesystem path to the source image
+ * @param string $dstRel target relative path
* @param $flags Integer: a bitwise combination of:
* File::DELETE_SOURCE Delete the source file, i.e. move rather than copy
- * @param $options Array Optional additional parameters
+ * @param array $options Optional additional parameters
* @return FileRepoStatus object. On success, the value member contains the
* archive name, or an empty string if it was a new file.
*/
*
* May throw database exceptions on error.
*
- * @param $versions array set of record ids of deleted items to restore,
+ * @param array $versions set of record ids of deleted items to restore,
* or empty to restore all revisions.
* @param $unsuppress Boolean
* @return FileRepoStatus
* Create a OldLocalFile from a SHA-1 key
* Do not call this except from inside a repo class.
*
- * @param $sha1 string base-36 SHA-1
+ * @param string $sha1 base-36 SHA-1
* @param $repo LocalRepo
* @param string|bool $timestamp MW_timestamp (optional)
*
/**
* @param $title Title
* @param $repo FileRepo
- * @param $time String: timestamp or null to load by archive name
- * @param $archiveName String: archive name or null to load by timestamp
+ * @param string $time timestamp or null to load by archive name
+ * @param string $archiveName archive name or null to load by timestamp
* @throws MWException
*/
function __construct( $title, $repo, $time, $archiveName ) {
/**
* Upload a file directly into archive. Generally for Special:Import.
*
- * @param $srcPath string File system path of the source file
- * @param $archiveName string Full archive name of the file, in the form
+ * @param string $srcPath File system path of the source file
+ * @param string $archiveName Full archive name of the file, in the form
* $timestamp!$filename, where $filename must match $this->getName()
*
* @param $timestamp string
/**
* Record a file upload in the oldimage table, without adding log entries.
*
- * @param $srcPath string File system path to the source file
- * @param $archiveName string The archive name of the file
+ * @param string $srcPath File system path to the source file
+ * @param string $archiveName The archive name of the file
* @param $timestamp string
- * @param $comment string Upload comment
+ * @param string $comment Upload comment
* @param $user User User who did this upload
* @return bool
*/
var $handler;
/**
- * @param $path string Storage path
+ * @param string $path Storage path
* @param $mime string
* @return UnregisteredLocalFile
*/
/**
* Write LocalSettings.php to a given path
*
- * @param $path String Full path to write LocalSettings.php to
+ * @param string $path Full path to write LocalSettings.php to
*/
public function writeConfigurationFile( $path ) {
$ls = InstallerOverrides::getLocalSettingsGenerator( $this );
/**
* Get a standard web-user fieldset
- * @param $noCreateMsg String: Message to display instead of the creation checkbox.
+ * @param string $noCreateMsg Message to display instead of the creation checkbox.
* Set this to false to show a creation checkbox.
*
* @return String
* Constructor
*
* @param $db DatabaseBase object to perform updates on
- * @param $shared bool Whether to perform updates on shared tables
+ * @param bool $shared Whether to perform updates on shared tables
* @param $maintenance Maintenance Maintenance object which created us
*/
protected function __construct( DatabaseBase &$db, $shared, Maintenance $maintenance = null ) {
/**
* Output some text. If we're running from web, escape the text first.
*
- * @param $str String: Text to output
+ * @param string $str Text to output
*/
public function output( $str ) {
if ( $this->maintenance->isQuiet() ) {
*
* @since 1.17
*
- * @param $update Array: the update to run. Format is the following:
+ * @param array $update the update to run. Format is the following:
* first item is the callback function, it also can be a
* simple string with the name of a function in this class,
* following elements are parameters to the function.
*
* @since 1.18
*
- * @param $tableName String Name of table to create
- * @param $sqlPath String Full path to the schema file
+ * @param string $tableName Name of table to create
+ * @param string $sqlPath Full path to the schema file
*/
public function addExtensionTable( $tableName, $sqlPath ) {
$this->extensionUpdates[] = array( 'addTable', $tableName, $sqlPath, true );
*
* @since 1.21
*
- * @param $tableName string The table name
- * @param $indexName string The index name
- * @param $sqlPath string The path to the SQL change path
+ * @param string $tableName The table name
+ * @param string $indexName The index name
+ * @param string $sqlPath The path to the SQL change path
*/
public function dropExtensionIndex( $tableName, $indexName, $sqlPath ) {
$this->extensionUpdates[] = array( 'dropIndex', $tableName, $indexName, $sqlPath, true );
*
* @since 1.21
*
- * @param $tableName string The table name
- * @param $oldIndexName string The old index name
- * @param $newIndexName string The new index name
+ * @param string $tableName The table name
+ * @param string $oldIndexName The old index name
+ * @param string $newIndexName The new index name
* @param $skipBothIndexExistWarning Boolean: Whether to warn if both the old and the new indexes exist. [facultative; by default, false]
- * @param $sqlPath string The path to the SQL change path
+ * @param string $sqlPath The path to the SQL change path
*/
public function renameExtensionIndex( $tableName, $oldIndexName, $newIndexName, $sqlPath, $skipBothIndexExistWarning = false ) {
$this->extensionUpdates[] = array( 'renameIndex', $tableName, $oldIndexName, $newIndexName, $skipBothIndexExistWarning, $sqlPath, true );
/**
* @since 1.21
*
- * @param $tableName string The table name
- * @param $fieldName string The field to be modified
- * @param $sqlPath string The path to the SQL change path
+ * @param string $tableName The table name
+ * @param string $fieldName The field to be modified
+ * @param string $sqlPath The path to the SQL change path
*/
public function modifyExtensionField( $tableName, $fieldName, $sqlPath) {
$this->extensionUpdates[] = array( 'modifyField', $tableName, $fieldName, $sqlPath, true );
*
* @since 1.19
*
- * @param $class string Name of a Maintenance subclass
+ * @param string $class Name of a Maintenance subclass
*/
public function addPostDatabaseUpdateMaintenance( $class ) {
$this->postDatabaseUpdateMaintenance[] = $class;
/**
* Do all the updates
*
- * @param $what Array: what updates to perform
+ * @param array $what what updates to perform
*/
public function doUpdates( $what = array( 'core', 'extensions', 'stats' ) ) {
global $wgVersion, $wgLocalisationCacheConf;
/**
* Helper function for doUpdates()
*
- * @param $updates Array of updates to run
+ * @param array $updates of updates to run
* @param $passSelf Boolean: whether to pass this object we calling external
* functions
*/
* Helper function: check if the given key is present in the updatelog table.
* Obviously, only use this for updates that occur after the updatelog table was
* created!
- * @param $key String Name of the key to check for
+ * @param string $key Name of the key to check for
*
* @return bool
*/
* Helper function: Add a key to the updatelog table
* Obviously, only use this for updates that occur after the updatelog table was
* created!
- * @param $key String Name of key to insert
- * @param $val String [optional] value to insert along with the key
+ * @param string $key Name of key to insert
+ * @param string $val [optional] value to insert along with the key
*/
public function insertUpdateRow( $key, $val = null ) {
$this->db->clearFlag( DBO_DDLMODE );
* Updates will be prevented if the table is a shared table and it is not
* specified to run updates on shared tables.
*
- * @param $name String table name
+ * @param string $name table name
* @return bool
*/
protected function doTable( $name ) {
/**
* Append an SQL fragment to the open file handle.
*
- * @param $filename String: File name to open
+ * @param string $filename File name to open
*/
public function copyFile( $filename ) {
$this->db->sourceFile( $filename, false, false, false,
*
* This is used as a callback for for sourceLine().
*
- * @param $line String text to append to the file
+ * @param string $line text to append to the file
* @return Boolean false to skip actually executing the file
* @throws MWException
*/
/**
* Applies a SQL patch
*
- * @param $path String Path to the patch file
+ * @param string $path Path to the patch file
* @param $isFullPath Boolean Whether to treat $path as a relative or not
- * @param $msg String Description of the patch
+ * @param string $msg Description of the patch
* @return boolean false if patch is skipped.
*/
protected function applyPatch( $path, $isFullPath = false, $msg = null ) {
/**
* Add a new table to the database
*
- * @param $name String Name of the new table
- * @param $patch String Path to the patch file
+ * @param string $name Name of the new table
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Add a new field to an existing table
*
- * @param $table String Name of the table to modify
- * @param $field String Name of the new field
- * @param $patch String Path to the patch file
+ * @param string $table Name of the table to modify
+ * @param string $field Name of the new field
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Add a new index to an existing table
*
- * @param $table String Name of the table to modify
- * @param $index String Name of the new index
- * @param $patch String Path to the patch file
+ * @param string $table Name of the table to modify
+ * @param string $index Name of the new index
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Drop a field from an existing table
*
- * @param $table String Name of the table to modify
- * @param $field String Name of the old field
- * @param $patch String Path to the patch file
+ * @param string $table Name of the table to modify
+ * @param string $field Name of the old field
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Drop an index from an existing table
*
- * @param $table String: Name of the table to modify
- * @param $index String: Name of the index
- * @param $patch String: Path to the patch file
+ * @param string $table Name of the table to modify
+ * @param string $index Name of the index
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean: Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Rename an index from an existing table
*
- * @param $table String: Name of the table to modify
- * @param $oldIndex String: Old name of the index
- * @param $newIndex String: New name of the index
+ * @param string $table Name of the table to modify
+ * @param string $oldIndex Old name of the index
+ * @param string $newIndex New name of the index
* @param $skipBothIndexExistWarning Boolean: Whether to warn if both the old and the new indexes exist.
- * @param $patch String: Path to the patch file
+ * @param string $patch Path to the patch file
* @param $fullpath Boolean: Whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
/**
* Modify an existing field
*
- * @param $table String: name of the table to which the field belongs
- * @param $field String: name of the field to modify
- * @param $patch String: path to the patch file
+ * @param string $table name of the table to which the field belongs
+ * @param string $field name of the field to modify
+ * @param string $patch path to the patch file
* @param $fullpath Boolean: whether to treat $patch path as a relative or not
* @return Boolean false if this was skipped because schema changes are skipped
*/
*
* Used only by environment checks.
*
- * @param $path String: path to search
- * @param $names Array of executable names
+ * @param string $path path to search
+ * @param array $names of executable names
* @param $versionInfo Boolean false or array with two members:
* 0 => Command to run for version check, with $1 for the full executable name
* 1 => String to compare the output with
/**
* Checks for presence of an Apache module. Works only if PHP is running as an Apache module, too.
*
- * @param $moduleName String: Name of module to check.
+ * @param string $moduleName Name of module to check.
* @return bool
*/
public static function apacheModulePresent( $moduleName ) {
/**
* Actually perform the installation.
*
- * @param $startCB Array A callback array for the beginning of each step
- * @param $endCB Array A callback array for the end of each step
+ * @param array $startCB A callback array for the beginning of each step
+ * @param array $endCB A callback array for the end of each step
*
* @return Array of Status objects
*/
/**
* Add an installation step following the given step.
*
- * @param $callback Array A valid installation callback array, in this form:
+ * @param array $callback A valid installation callback array, in this form:
* array( 'name' => 'some-unique-name', 'callback' => array( $obj, 'function' ) );
- * @param $findStep String the step to find. Omit to put the step at the beginning
+ * @param string $findStep the step to find. Omit to put the step at the beginning
*/
public function addInstallStep( $callback, $findStep = 'BEGINNING' ) {
$this->extraInstallSteps[$findStep][] = $callback;
/**
* For $wgGroupPermissions, set a given ['group']['permission'] value.
- * @param $group String Group name
- * @param $rightsArr Array An array of permissions, in the form of:
+ * @param string $group Group name
+ * @param array $rightsArr An array of permissions, in the form of:
* array( 'right' => true, 'right2' => false )
*/
public function setGroupRights( $group, $rightsArr ) {
/**
* Write the generated LocalSettings to a file
*
- * @param $fileName String Full path to filename to write to
+ * @param string $fileName Full path to filename to write to
*/
public function writeFile( $fileName ) {
file_put_contents( $fileName, $this->getText() );
/**
* Return a formal 'User'@'Host' username for use in queries
- * @param $name String Username, quotes will be added
- * @param $host String Hostname, quotes will be added
+ * @param string $name Username, quotes will be added
+ * @param string $host Hostname, quotes will be added
* @return String
*/
private function buildFullUserName( $name, $host ) {
/**
* Try to see if the user account exists. Our "superuser" may not have
* access to mysql.user, so false means "no" or "maybe"
- * @param $host String Hostname to check
- * @param $user String Username to check
+ * @param string $host Hostname to check
+ * @param string $user Username to check
* @return boolean
*/
private function userDefinitelyExists( $host, $user ) {
* 1.4 betas were missing the 'binary' marker from logging.log_title,
* which causes a collation mismatch error on joins in MySQL 4.1.
*
- * @param $table String: table name
- * @param $field String: field name to check
- * @param $patchFile String: path to the patch to correct the field
+ * @param string $table table name
+ * @param string $field field name to check
+ * @param string $patchFile path to the patch to correct the field
*/
protected function checkBin( $table, $field, $patchFile ) {
if ( !$this->doTable( $table ) ) {
/**
* Check whether an index contain a field
*
- * @param $table String: table name
- * @param $index String: index name to check
- * @param $field String: field that should be in the index
+ * @param string $table table name
+ * @param string $index index name to check
+ * @param string $field field that should be in the index
* @return Boolean
*/
protected function indexHasField( $table, $index, $field ) {
/**
* Open a PG connection with given parameters
- * @param $user string User name
- * @param $password string Password
- * @param $dbName string Database name
+ * @param string $user User name
+ * @param string $password Password
+ * @param string $dbName Database name
* @return Status
*/
protected function openConnectionWithParams( $user, $password, $dbName ) {
/**
* Get a special type of connection
- * @param $type string See openPgConnection() for details.
+ * @param string $type See openPgConnection() for details.
* @return Status
*/
protected function getPgConnection( $type ) {
* separate connection for this allows us to avoid accidental cross-module
* dependencies.
*
- * @param $type string The type of connection to get:
+ * @param string $type The type of connection to get:
* - create-db: A connection for creating DBs, suitable for pre-
* installation.
* - create-schema: A connection to the new DB, for creating schemas and
/**
* Recursive helper for canCreateObjectsForWebUser().
* @param $conn DatabaseBase object
- * @param $targetMember int Role ID of the member to look for
- * @param $group int Role ID of the group to look for
- * @param $maxDepth int Maximum recursive search depth
+ * @param int $targetMember Role ID of the member to look for
+ * @param int $group Role ID of the group to look for
+ * @param int $maxDepth Maximum recursive search depth
* @return bool
*/
protected function isRoleMember( $conn, $targetMember, $group, $maxDepth ) {
/**
* Main entry point.
*
- * @param $session Array: initial session array
+ * @param array $session initial session array
*
* @return Array: new session array
*/
/**
* Set a session variable.
- * @param $name String key for the variable
+ * @param string $name key for the variable
* @param $value Mixed
*/
public function setSession( $name, $value ) {
/**
* Get HTML for an error box with an icon.
*
- * @param $text String: wikitext, get this with wfMessage()->plain()
+ * @param string $text wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for a warning box with an icon.
*
- * @param $text String: wikitext, get this with wfMessage()->plain()
+ * @param string $text wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for an info box with an icon.
*
- * @param $text String: wikitext, get this with wfMessage()->plain()
- * @param $icon String: icon name, file in skins/common/images
- * @param $class String: additional class name to add to the wrapper div
+ * @param string $text wikitext, get this with wfMessage()->plain()
+ * @param string $icon icon name, file in skins/common/images
+ * @param string $class additional class name to add to the wrapper div
*
* @return string
*/
/**
* Output a help box.
- * @param $msg String key for wfMessage()
+ * @param string $msg key for wfMessage()
*/
public function showHelpBox( $msg /*, ... */ ) {
$args = func_get_args();
* fake) passwords.
*
* @param $varNames Array
- * @param $prefix String: the prefix added to variables to obtain form names
+ * @param string $prefix the prefix added to variables to obtain form names
*
* @return array
*/
/**
* Get the raw vector CSS, flipping if needed
- * @param $dir String 'ltr' or 'rtl'
+ * @param string $dir 'ltr' or 'rtl'
* @return String
*/
public function getCSS( $dir ) {
/**
* Get the starting tags of a fieldset.
*
- * @param $legend String: message name
+ * @param string $legend message name
*
* @return string
*/
/**
* Initiate an upgrade of the existing database
- * @param $vars array Variables from LocalSettings.php and AdminSettings.php
+ * @param array $vars Variables from LocalSettings.php and AdminSettings.php
* @return Status
*/
protected function handleExistingUpgrade( $vars ) {
/**
* Create the appropriate object to handle a specific job
*
- * @param $command String: Job command
+ * @param string $command Job command
* @param $title Title: Associated title
- * @param $params Array|bool: Job parameters
- * @param $id Int: Job identifier
+ * @param array|bool $params Job parameters
+ * @param int $id Job identifier
* @throws MWException
* @return Job
*/
* This may add duplicate at insert time, but they will be
* removed later on, when the first one is popped.
*
- * @param $jobs array of Job objects
+ * @param array $jobs of Job objects
* @return bool
* @deprecated 1.21
*/
* be rolled-back as part of a larger transaction. However,
* large batches of jobs can cause slave lag.
*
- * @param $jobs array of Job objects
+ * @param array $jobs of Job objects
* @return bool
* @deprecated 1.21
*/
}
/**
- * @param $key string A key that identifies the task
+ * @param string $key A key that identifies the task
* @return Array
*/
public static function newRootJobParams( $key ) {
* This does not require $wgJobClasses to be set for the given job type.
* Outside callers should use JobQueueGroup::push() instead of this function.
*
- * @param $jobs array List of Jobs
+ * @param array $jobs List of Jobs
* @param $flags integer Bitfield (supports JobQueue::QoS_Atomic)
* @return bool Returns false on failure
* @throws MWException
/**
* Reserve a row with a single UPDATE without holding row locks over RTTs...
*
- * @param $uuid string 32 char hex string
+ * @param string $uuid 32 char hex string
* @param $rand integer Random unsigned integer (31 bits)
- * @param $gte bool Search for job_random >= $random (otherwise job_random <= $random)
+ * @param bool $gte Search for job_random >= $random (otherwise job_random <= $random)
* @return Row|false
*/
protected function claimRandom( $uuid, $rand, $gte ) {
/**
* Reserve a row with a single UPDATE without holding row locks over RTTs...
*
- * @param $uuid string 32 char hex string
+ * @param string $uuid 32 char hex string
* @return Row|false
*/
protected function claimOldest( $uuid ) {
const CACHE_VERSION = 1; // integer; cache version
/**
- * @param $wiki string Wiki ID
+ * @param string $wiki Wiki ID
*/
protected function __construct( $wiki ) {
$this->wiki = $wiki;
}
/**
- * @param $wiki string Wiki ID
+ * @param string $wiki Wiki ID
* @return JobQueueGroup
*/
public static function singleton( $wiki = false ) {
}
/**
- * @param $uid string Job UID
+ * @param string $uid Job UID
* @return bool Whether $uid is a SHA-1 hash based identifier for de-duplication
*/
protected function isHashUid( $uid ) {
/**
* Insert jobs into the job queue to fix redirects to the given title
- * @param $reason String: the reason for the fix, see message "double-redirect-fixed-<reason>"
+ * @param string $reason the reason for the fix, see message "double-redirect-fixed-<reason>"
* @param $redirTitle Title: the title which has changed, redirects pointing to this title are fixed
- * @param $destTitle bool Not used
+ * @param bool $destTitle Not used
*/
public static function fixRedirects( $reason, $redirTitle, $destTitle = false ) {
# Need to use the master to get the redirect table updated in the same transaction
* Callers should use DuplicateJob::newFromJob() instead
*
* @param $title Title
- * @param $params Array: job parameters
+ * @param array $params job parameters
* @param $id Integer: job id
*/
function __construct( $title, $params, $id = 0 ) {
/**
* Construct a job
* @param $title Title: the title linked to
- * @param $params Array: job parameters (table, start and end page_ids)
+ * @param array $params job parameters (table, start and end page_ids)
* @param $id Integer: job id
*/
function __construct( $title, $params, $id = 0 ) {
class NullJob extends Job {
/**
* @param $title Title (can be anything)
- * @param $params Array: job parameters (lives, usleep)
+ * @param array $params job parameters (lives, usleep)
* @param $id Integer: job id
*/
function __construct( $title, $params, $id = 0 ) {
* Store a result in the session data. Note that the caller is responsible
* for appropriate session_start and session_write_close calls.
*
- * @param $result String: the result (Success|Warning|Failure)
- * @param $dataKey String: the key of the extra data
+ * @param string $result the result (Success|Warning|Failure)
+ * @param string $dataKey the key of the extra data
* @param $dataValue Mixed: the extra data itself
*/
protected function storeResultInSession( $result, $dataKey, $dataValue ) {
/**
* Decodes a JSON string.
*
- * @param $value String: the json string being decoded.
+ * @param string $value the json string being decoded.
* @param $assoc Boolean: when true, returned objects will be converted into associative arrays.
*
* @return Mixed: the value encoded in json in appropriate PHP type.
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
- * @param $utf16 String: UTF-16 character
+ * @param string $utf16 UTF-16 character
* @return String: UTF-8 character
* @access private
*/
* provides a slower PHP-only method for installations
* that lack the multibye string extension.
*
- * @param $utf8 String: UTF-8 character
+ * @param string $utf8 UTF-8 character
* @return String: UTF-16 character
* @access private
*/
/**
* array-walking function for use in generating JSON-formatted name-value pairs
*
- * @param $name String: name of key to use
+ * @param string $name name of key to use
* @param $value Mixed: reference to an array element to be encoded
*
* @return String: JSON-formatted name-value pair, like '"name":value'
/**
* reduce a string by removing leading and trailing comments and whitespace
*
- * @param $str String: string value to strip of comments and whitespace
+ * @param string $str string value to strip of comments and whitespace
*
* @return String: string value stripped of comments and whitespace
* @access private
/**
* decodes a JSON string into appropriate variable
*
- * @param $str String: JSON-formatted string
+ * @param string $str JSON-formatted string
*
* @return mixed number, boolean, string, array, or object
* corresponding to given JSON input string.
/**
* Transform an LTR stylesheet to RTL
- * @param $css String: stylesheet to transform
+ * @param string $css stylesheet to transform
* @param $swapLtrRtlInURL Boolean: If true, swap 'ltr' and 'rtl' in URLs
* @param $swapLeftRightInURL Boolean: If true, swap 'left' and 'right' in URLs
* @return string Transformed stylesheet
/**
* Constructor
- * @param $regex string Regular expression whose matches to replace by a token.
- * @param $token string Token
+ * @param string $regex Regular expression whose matches to replace by a token.
+ * @param string $token Token
*/
public function __construct( $regex, $token ) {
$this->regex = $regex;
/**
* Replace all occurrences of $regex in $str with a token and remember
* the original strings.
- * @param $str String to tokenize
+ * @param string $str to tokenize
* @return string Tokenized string
*/
public function tokenize( $str ) {
/**
* Replace tokens with their originals. If multiple strings were tokenized, it's important they be
* detokenized in exactly the SAME ORDER.
- * @param $str String: previously run through tokenize()
+ * @param string $str previously run through tokenize()
* @return string Original string
*/
public function detokenize( $str ) {
/**
* Gets a list of local file paths which are referenced in a CSS style sheet
*
- * @param $source string CSS data to remap
- * @param $path string File path where the source was read from (optional)
+ * @param string $source CSS data to remap
+ * @param string $path File path where the source was read from (optional)
* @return array List of local file references
*/
public static function getLocalFileReferences( $source, $path = null ) {
* Remaps CSS URL paths and automatically embeds data URIs for URL rules
* preceded by an /* @embed * / comment
*
- * @param $source string CSS data to remap
- * @param $local string File path where the source was read from
- * @param $remote string URL path to the file
- * @param $embedData bool If false, never do any data URI embedding, even if / * @embed * / is found
+ * @param string $source CSS data to remap
+ * @param string $local File path where the source was read from
+ * @param string $remote URL path to the file
+ * @param bool $embedData If false, never do any data URI embedding, even if / * @embed * / is found
* @return string Remapped CSS data
*/
public static function remap( $source, $local, $remote, $embedData = true ) {
/**
* Removes whitespace from CSS data
*
- * @param $css string CSS data to minify
+ * @param string $css CSS data to minify
* @return string Minified CSS data
*/
public static function minify( $css ) {
* Get the MIME types from getMimesFromData(), but convert the result from IE's
* idiosyncratic private types into something other apps will understand.
*
- * @param $fileName String: the file name (unused at present)
- * @param $chunk String: the first 256 bytes of the file
- * @param $proposed String: the MIME type proposed by the server
+ * @param string $fileName the file name (unused at present)
+ * @param string $chunk the first 256 bytes of the file
+ * @param string $proposed the MIME type proposed by the server
*
* @return Array: map of IE version to detected mime type
*/
/**
* Get the untranslated MIME types for all known versions
*
- * @param $fileName String: the file name (unused at present)
- * @param $chunk String: the first 256 bytes of the file
- * @param $proposed String: the MIME type proposed by the server
+ * @param string $fileName the file name (unused at present)
+ * @param string $chunk the first 256 bytes of the file
+ * @param string $proposed the MIME type proposed by the server
*
* @return Array: map of IE version to detected mime type
*/
*
* If the a variable is unset in $_SERVER, it should be unset in $vars.
*
- * @param $vars array A subset of $_SERVER.
- * @param $extWhitelist array Extensions which are allowed, assumed harmless.
+ * @param array $vars A subset of $_SERVER.
+ * @param array $extWhitelist Extensions which are allowed, assumed harmless.
* @return bool
*/
public static function areServerVarsBad( $vars, $extWhitelist = array() ) {
* Given a right-hand portion of a URL, determine whether IE would detect
* a potentially harmful file extension.
*
- * @param $urlPart string The right-hand portion of a URL
- * @param $extWhitelist array An array of file extensions which may occur in this
+ * @param string $urlPart The right-hand portion of a URL
+ * @param array $extWhitelist An array of file extensions which may occur in this
* URL, and which should be allowed.
* @return bool
*/
* - if we find a possible extension followed by a dot or another illegal
* character, we ignore it and continue searching
*
- * @param $url string URL
+ * @param string $url URL
* @return mixed Detected extension (string), or false if none found
*/
public static function findIE6Extension( $url ) {
* literals (e.g. quoted strings) longer than $maxLineLength are encountered
* or when required to guard against semicolon insertion.
*
- * @param $s String JavaScript code to minify
- * @param $statementsOnOwnLine Bool Whether to put each statement on its own line
- * @param $maxLineLength Int Maximum length of a single line, or -1 for no maximum.
+ * @param string $s JavaScript code to minify
+ * @param bool $statementsOnOwnLine Whether to put each statement on its own line
+ * @param int $maxLineLength Maximum length of a single line, or -1 for no maximum.
* @return String Minified code
*/
public static function minify( $s, $statementsOnOwnLine = false, $maxLineLength = 1000 ) {
*
* @since 1.19
*
- * @param $parameters array Associative array
+ * @param array $parameters Associative array
*/
public function setParameters( $parameters ) {
$this->parameters = $parameters;
/**
* Publishes the log entry.
- * @param $newId int id of the log entry.
- * @param $to string: rcandudp (default), rc, udp
+ * @param int $newId id of the log entry.
+ * @param string $to rcandudp (default), rc, udp
*/
public function publish( $newId, $to = 'rcandudp' ) {
$log = new LogPage( $this->getType() );
*
* @param $context IContextSource Context to use; formerly it was Skin object.
* @param $unused void Unused; used to be an OutputPage object.
- * @param $flags int flags; can be a combinaison of self::NO_ACTION_LINK,
+ * @param int $flags flags; can be a combinaison of self::NO_ACTION_LINK,
* self::NO_EXTRA_USER_LINKS or self::USE_REVDEL_CHECKBOXES.
*/
public function __construct( $context, $unused = null, $flags = 0 ) {
/**
* Show options for the log list
*
- * @param $types string or Array
+ * @param string $types or Array
* @param $user String
* @param $page String
* @param $pattern String
* Show log extract. Either with text and a box (set $msgKey) or without (don't set $msgKey)
*
* @param $out OutputPage|String-by-reference
- * @param $types String|Array Log types to show
- * @param $page String|Title The page title to show log entries for
- * @param $user String The user who made the log entries
- * @param $param array Associative Array with the following additional options:
+ * @param string|array $types Log types to show
+ * @param string|Title $page The page title to show log entries for
+ * @param string $user The user who made the log entries
+ * @param array $param Associative Array with the following additional options:
* - lim Integer Limit of items to show, default is 50
* - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
* - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
/**
* Formats parameters values dependent to their type
- * @param $type string The type of the value.
+ * @param string $type The type of the value.
* Valid are currently:
* * - (empty) or plain: The value is returned as-is
* * raw: The value will be added to the log message
* * title-link: The value is a page title,
* returns link to this page
* * number: Format value as number
- * @param $value string The parameter value that should
+ * @param string $value The parameter value that should
* be formated
* @return string or Message::numParam or Message::rawParam
* Formated value
* Helper to make a link to the page, taking the plaintext
* value in consideration.
* @param $title Title the page
- * @param $parameters array query parameters
+ * @param array $parameters query parameters
* @throws MWException
* @return String
*/
/**
* Constructor
*
- * @param $type String: one of '', 'block', 'protect', 'rights', 'delete',
+ * @param string $type one of '', 'block', 'protect', 'rights', 'delete',
* 'upload', 'move'
* @param $rc Boolean: whether to update recent changes as well as the logging table
- * @param $udp String: pass 'UDP' to send to the UDP feed if NOT sent to RC
+ * @param string $udp pass 'UDP' to send to the UDP feed if NOT sent to RC
*/
public function __construct( $type, $rc = true, $udp = 'skipUDP' ) {
$this->type = $type;
/**
* Is $type a valid log type
*
- * @param $type String: log type to check
+ * @param string $type log type to check
* @return Boolean
*/
public static function isLogType( $type ) {
/**
* Get the name for the given log type
*
- * @param $type String: logtype
+ * @param string $type logtype
* @return String: log name
* @deprecated in 1.19, warnings in 1.21. Use getName()
*/
* Get the log header for the given log type
*
* @todo handle missing log types
- * @param $type String: logtype
+ * @param string $type logtype
* @return String: headertext of this logtype
* @deprecated in 1.19, warnings in 1.21. Use getDescription()
*/
* Generate text for a log entry.
* Only LogFormatter should call this function.
*
- * @param $type String: log type
- * @param $action String: log action
+ * @param string $type log type
+ * @param string $action log action
* @param $title Mixed: Title object or null
* @param $skin Mixed: Skin object or null. If null, we want to use the wiki
* content language, since that will go to the IRC feed.
- * @param $params Array: parameters
+ * @param array $params parameters
* @param $filterWikilinks Boolean: whether to filter wiki links
* @return HTML string
*/
/**
* Add a log entry
*
- * @param $action String: one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
+ * @param string $action one of '', 'block', 'protect', 'rights', 'delete', 'upload', 'move', 'move_redir'
* @param $target Title object
- * @param $comment String: description associated
- * @param $params Array: parameters passed later to wfMessage function
+ * @param string $comment description associated
+ * @param array $params parameters passed later to wfMessage function
* @param $doer User object: the user doing the action
*
* @return int log_id of the inserted log entry
* Convert a comma-delimited list of block log flags
* into a more readable (and translated) form
*
- * @param $flags string Flags to format
+ * @param string $flags Flags to format
* @param $lang Language object to use
* @return String
*/
/**
* Translate a block log flag if possible
*
- * @param $flag int Flag to translate
+ * @param int $flag Flag to translate
* @param $lang Language object to use
* @return String
*/
* Constructor
*
* @param $list LogEventsList
- * @param $types String or Array: log types to show
- * @param $performer String: the user who made the log entries
- * @param $title String|Title: the page title the log entries are for
- * @param $pattern String: do a prefix search rather than an exact title match
- * @param $conds Array: extra conditions for the query
+ * @param string $types or Array: log types to show
+ * @param string $performer the user who made the log entries
+ * @param string|Title $title the page title the log entries are for
+ * @param string $pattern do a prefix search rather than an exact title match
+ * @param array $conds extra conditions for the query
* @param $year Integer: the year to start from
* @param $month Integer: the month to start from
- * @param $tagFilter String: tag
+ * @param string $tagFilter tag
*/
public function __construct( $list, $types = array(), $performer = '', $title = '', $pattern = '',
$conds = array(), $year = false, $month = false, $tagFilter = '' ) {
* Set the log reader to return only entries of the given type.
* Type restrictions enforced here
*
- * @param $types String or array: Log types ('upload', 'delete', etc);
+ * @param string $types or array: Log types ('upload', 'delete', etc);
* empty string means no restriction
*/
private function limitType( $types ) {
/**
* Set the log reader to return only entries by the given user.
*
- * @param $name String: (In)valid user name
+ * @param string $name (In)valid user name
* @return bool
*/
private function limitPerformer( $name ) {
* Set the log reader to return only entries affecting the given page.
* (For the block and rights logs, this is a user page.)
*
- * @param $page String or Title object: Title name
+ * @param string $page or Title object: Title name
* @param $pattern String
* @return bool
*/
class BitmapHandler extends ImageHandler {
/**
* @param $image File
- * @param $params array Transform parameters. Entries with the keys 'width'
+ * @param array $params Transform parameters. Entries with the keys 'width'
* and 'height' are the respective screen width and height, while the keys
* 'physicalWidth' and 'physicalHeight' indicate the thumbnail dimensions.
* @return bool
* stored as raw landscape with 90-degress rotation, the resulting size
* will be wider than it is tall.
*
- * @param $params array Parameters as returned by normaliseParams
- * @param $rotation int The rotation angle that will be applied
+ * @param array $params Parameters as returned by normaliseParams
+ * @param int $rotation The rotation angle that will be applied
* @return array ($width, $height) array
*/
public function extractPreRotationDimensions( $params, $rotation ) {
* client side
*
* @param $image File File associated with this thumbnail
- * @param $scalerParams array Array with scaler params
+ * @param array $scalerParams Array with scaler params
* @return ThumbnailImage
*
* @todo fixme: no rotation support
* Transform an image using ImageMagick
*
* @param $image File File associated with this thumbnail
- * @param $params array Array with scaler params
+ * @param array $params Array with scaler params
*
* @return MediaTransformError Error object if error occurred, false (=no error) otherwise
*/
* Transform an image using the Imagick PHP extension
*
* @param $image File File associated with this thumbnail
- * @param $params array Array with scaler params
+ * @param array $params Array with scaler params
*
* @return MediaTransformError Error object if error occurred, false (=no error) otherwise
*/
* Transform an image using a custom command
*
* @param $image File File associated with this thumbnail
- * @param $params array Array with scaler params
+ * @param array $params Array with scaler params
*
* @return MediaTransformError Error object if error occurred, false (=no error) otherwise
*/
/**
* Get a MediaTransformError with error 'thumbnail_error'
*
- * @param $params array Parameter array as passed to the transform* functions
- * @param $errMsg string Error message
+ * @param array $params Parameter array as passed to the transform* functions
+ * @param string $errMsg Error message
* @return MediaTransformError
*/
public function getMediaTransformError( $params, $errMsg ) {
* Transform an image using the built in GD library
*
* @param $image File File associated with this thumbnail
- * @param $params array Array with scaler params
+ * @param array $params Array with scaler params
*
* @return MediaTransformError Error object if error occurred, false (=no error) otherwise
*/
* in a directory, so we're better off escaping and waiting for the bugfix
* to filter down to users.
*
- * @param $path string The file path
+ * @param string $path The file path
* @param bool|string $scene The scene specification, or false if there is none
* @throws MWException
* @return string
* Armour a string against ImageMagick's GetPathComponent(). This is a
* helper function for escapeMagickInput() and escapeMagickOutput().
*
- * @param $path string The file path
+ * @param string $path The file path
* @param bool|string $scene The scene specification, or false if there is none
* @throws MWException
* @return string
/**
* @param $file File
- * @param $params array Rotate parameters.
+ * @param array $params Rotate parameters.
* 'rotation' clockwise rotation in degrees, allowed are multiples of 90
* @since 1.21
* @return bool
*
* Mostly just calls doPSIR and doIPTC
*
- * @param String $app13 String containing app13 block from jpeg file
+ * @param string $app13 String containing app13 block from jpeg file
*/
private function doApp13 ( $app13 ) {
try {
/** Add misc metadata. Warning: atm if the metadata category
* doesn't have a priority, it will be silently discarded.
*
- * @param Array $metaArray array of metadata values
+ * @param array $metaArray array of metadata values
* @param string $type type. defaults to other. if two things have the same type they're merged
*/
function addMetadata ( $metaArray, $type = 'other' ) {
/** Main entry point for jpeg's.
*
- * @param $filename string filename (with full path)
+ * @param string $filename filename (with full path)
* @return array metadata result array.
* @throws MWException on invalid file.
*/
* merge the png various tEXt chunks to that
* are interesting, but for now it only does XMP
*
- * @param $filename String full path to file
+ * @param string $filename full path to file
* @return Array Array for storage in img_metadata.
*/
public static function PNG ( $filename ) {
* They don't really have native metadata, so just merges together
* XMP and image comment.
*
- * @param $filename string full path to file
+ * @param string $filename full path to file
* @return Array metadata array
*/
public static function GIF ( $filename ) {
* Read the first 2 bytes of a tiff file to figure out
* Little Endian or Big Endian. Needed for exif stuff.
*
- * @param $filename String The filename
+ * @param string $filename The filename
* @return String 'BE' or 'LE' or false
*/
static function getTiffByteOrder( $filename ) {
/**
* Constructor
*
- * @param $file String: filename.
- * @param $byteOrder String Type of byte ordering either 'BE' (Big Endian) or 'LE' (Little Endian). Default ''.
+ * @param string $file filename.
+ * @param string $byteOrder Type of byte ordering either 'BE' (Big Endian) or 'LE' (Little Endian). Default ''.
* @throws MWException
* @todo FIXME: The following are broke:
* SubjectArea. Need to test the more obscure tags.
* Do userComment tags and similar. See pg. 34 of exif standard.
* basically first 8 bytes is charset, rest is value.
* This has not been tested on any shift-JIS strings.
- * @param $prop String prop name.
+ * @param string $prop prop name.
*/
private function charCodeString ( $prop ) {
if ( isset( $this->mFilteredExifData[$prop] ) ) {
* Convert an Exif::UNDEFINED from a raw binary string
* to its value. This is sometimes needed depending on
* the type of UNDEFINED field
- * @param $prop String name of property
+ * @param string $prop name of property
*/
private function exifPropToOrd ( $prop ) {
if ( isset( $this->mFilteredExifData[$prop] ) ) {
/**
* Convert gps in exif form to a single floating point number
* for example 10 degress 20`40`` S -> -10.34444
- * @param String $prop a gps coordinate exif tag name (like GPSLongitude)
+ * @param string $prop a gps coordinate exif tag name (like GPSLongitude)
*/
private function exifGPStoNumber ( $prop ) {
$loc =& $this->mFilteredExifData[$prop];
* Validates if a tag has a legal value according to the Exif spec
*
* @private
- * @param $section String: section where tag is located.
- * @param $tag String: the tag to check.
+ * @param string $section section where tag is located.
+ * @param string $tag the tag to check.
* @param $val Mixed: the value of the tag.
* @param $recursive Boolean: true if called recursively for array types.
* @return bool
*
* @private
*
- * @param $fname String: the name of the function calling this function
+ * @param string $fname the name of the function calling this function
* @param $io Boolean: Specify whether we're beginning or ending
*/
private function debugFile( $fname, $io ) {
* value which most of the time are plain integers. This function
* formats Exif (and other metadata) values into human readable form.
*
- * @param $tags Array: the Exif data to format ( as returned by
+ * @param array $tags the Exif data to format ( as returned by
* Exif::getFilteredData() or BitmapMetadataHandler )
* @return array
*/
*
* This is public on the basis it might be useful outside of this class.
*
- * @param $vals Array array of values
- * @param $type String Type of array (either lang, ul, ol).
+ * @param array $vals array of values
+ * @param string $type Type of array (either lang, ul, ol).
* lang = language assoc array with keys being the lang code
* ul = unordered list, ol = ordered list
* type can also come from the '_type' member of $vals.
/** Helper function for creating lists of translations.
*
- * @param $value String value (this is not escaped)
- * @param $lang String lang code of item or false
+ * @param string $value value (this is not escaped)
+ * @param string $lang lang code of item or false
* @param $default Boolean if it is default value.
* @param $noHtml Boolean If to avoid html (for back-compat)
* @throws MWException
*
* @private
*
- * @param $tag String: the tag name to pass on
- * @param $val String: the value of the tag
- * @param $arg String: an argument to pass ($1)
- * @param $arg2 String: a 2nd argument to pass ($2)
+ * @param string $tag the tag name to pass on
+ * @param string $val the value of the tag
+ * @param string $arg an argument to pass ($1)
+ * @param string $arg2 a 2nd argument to pass ($2)
* @return string A wfMessage of "exif-$tag-$val" in lower case
*/
static function msg( $tag, $val, $arg = null, $arg2 = null ) {
* Note, leading 0's are significant, so this is
* a string, not an int.
*
- * @param $val String: The 8 digit news code.
+ * @param string $val The 8 digit news code.
* @return string The human readable form
*/
private static function convertNewsCode( $val ) {
* Format a coordinate value, convert numbers from floating point
* into degree minute second representation.
*
- * @param $coord int degrees, minutes and seconds
- * @param $type String: latitude or longitude (for if its a NWS or E)
+ * @param int $coord degrees, minutes and seconds
+ * @param string $type latitude or longitude (for if its a NWS or E)
* @return mixed A floating point number or whatever we were fed
*/
static function formatCoords( $coord, $type ) {
/**
* Format the contact info field into a single value.
*
- * @param $vals Array array with fields of the ContactInfo
+ * @param array $vals array with fields of the ContactInfo
* struct defined in the IPTC4XMP spec. Or potentially
* an array with one element that is a free form text
* value from the older iptc iim 1:118 prop.
*
* @see http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf
*
- * @param $rawData String app13 block from jpeg containing iptc/iim data
+ * @param string $rawData app13 block from jpeg containing iptc/iim data
* @return Array iptc metadata array
*/
static function parse( $rawData ) {
* Convert an iptc date and time tags into the exif format
*
* @todo Potentially this should also capture the timezone offset.
- * @param Array $date The date tag
- * @param Array $time The time tag
+ * @param array $date The date tag
+ * @param array $time The time tag
* @param $c
* @return String Date in exif format.
*/
/**
* Helper function to convert charset for iptc values.
- * @param $data string|array The iptc string
- * @param $charset String: The charset
+ * @param string|array $data The iptc string
+ * @param string $charset The charset
*
* @return string|array
*/
/**
* Helper function of a helper function to convert charset for iptc values.
* @param $data Mixed String or Array: The iptc string
- * @param $charset String: The charset
+ * @param string $charset The charset
*
* @return string
*/
/**
* take the value of 1:90 tag and returns a charset
- * @param String $tag 1:90 tag.
+ * @param string $tag 1:90 tag.
* @return string charset name or "?"
* Warning, this function does not (and is not intended to) detect
* all iso 2022 escape codes. In practise, the code for utf-8 is the
/**
* @param $file File
- * @param $params array Rotate parameters.
+ * @param array $params Rotate parameters.
* 'rotation' clockwise rotation in degrees, allowed are multiples of 90
* @since 1.21
* @return bool
* but gis doesn't support having multiple app1 segments
* and those can't extract xmp on files containing both exif and xmp data
*
- * @param String $filename name of jpeg file
+ * @param string $filename name of jpeg file
* @return Array of interesting segments.
* @throws MWException if given invalid file.
*/
*
* This should generally be called by BitmapMetadataHandler::doApp13()
*
- * @param String $app13 photoshop psir app13 block from jpg.
+ * @param string $app13 photoshop psir app13 block from jpg.
* @throws MWException (It gets caught next level up though)
* @return String if the iptc hash is good or not.
*/
* can't be determined.
*
* @param $image File: the image object, or false if there isn't one
- * @param $path String: the filename
+ * @param string $path the filename
* @return Array Follow the format of PHP getimagesize() internal function. See http://www.php.net/getimagesize
*/
abstract function getImageSize( $image, $path );
*
* @param $image File: the image object, or false if there isn't one.
* Warning, FSFile::getPropsFromPath might pass an (object)array() instead (!)
- * @param $path String: the filename
+ * @param string $path the filename
* @return String
*/
function getMetadata( $image, $path ) { return ''; }
* actually do the transform.
*
* @param $image File: the image object
- * @param $dstPath String: filesystem destination path
- * @param $dstUrl String: Destination URL to use in output HTML
- * @param $params Array: Arbitrary set of parameters validated by $this->validateParam()
+ * @param string $dstPath filesystem destination path
+ * @param string $dstUrl Destination URL to use in output HTML
+ * @param array $params Arbitrary set of parameters validated by $this->validateParam()
* @return MediaTransformOutput
*/
final function getTransform( $image, $dstPath, $dstUrl, $params ) {
* transform unless $flags contains self::TRANSFORM_LATER.
*
* @param $image File: the image object
- * @param $dstPath String: filesystem destination path
- * @param $dstUrl String: destination URL to use in output HTML
- * @param $params Array: arbitrary set of parameters validated by $this->validateParam()
+ * @param string $dstPath filesystem destination path
+ * @param string $dstUrl destination URL to use in output HTML
+ * @param array $params arbitrary set of parameters validated by $this->validateParam()
* @param $flags Integer: a bitfield, may contain self::TRANSFORM_LATER
*
* @return MediaTransformOutput
*
* This is used by the media handlers that use the FormatMetadata class
*
- * @param $metadataArray Array metadata array
+ * @param array $metadataArray metadata array
* @return array for use displaying metadata.
*/
function formatMetadataHelper( $metadataArray ) {
* @param &$array Array An array containing elements for each type of visibility
* and each of those elements being an array of metadata items. This function adds
* a value to that array.
- * @param $visibility string ('visible' or 'collapsed') if this value is hidden
+ * @param string $visibility ('visible' or 'collapsed') if this value is hidden
* by default.
- * @param $type String type of metadata tag (currently always 'exif')
- * @param $id String the name of the metadata tag (like 'artist' for example).
+ * @param string $type type of metadata tag (currently always 'exif')
+ * @param string $id the name of the metadata tag (like 'artist' for example).
* its name in the table displayed is the message "$type-$id" (Ex exif-artist ).
- * @param $value String thingy goes into a wikitext table; it used to be escaped but
+ * @param string $value thingy goes into a wikitext table; it used to be escaped but
* that was incompatible with previous practise of customized display
* with wikitext formatting via messages such as 'exif-model-value'.
* So the escaping is taken back out, but generally this seems a confusing
* interface.
- * @param $param String value to pass to the message for the name of the field
+ * @param string $param value to pass to the message for the name of the field
* as $1. Currently this parameter doesn't seem to ever be used.
*
* Note, everything here is passed through the parser later on (!)
* match the handler class, a Status object should be returned containing
* relevant errors.
*
- * @param $fileName string The local path to the file.
+ * @param string $fileName The local path to the file.
* @return Status object
*/
function verifyUpload( $fileName ) {
* Check for zero-sized thumbnails. These can be generated when
* no disk space is available or some other error occurs
*
- * @param $dstPath string The location of the suspect file
- * @param $retval int Return value of some shell process, file will be deleted if this is non-zero
+ * @param string $dstPath The location of the suspect file
+ * @param int $retval Return value of some shell process, file will be deleted if this is non-zero
* @return bool True if removed, false otherwise
*/
function removeBadFile( $dstPath, $retval = 0 ) {
}
/**
- * @param $storagePath string The permanent storage path
+ * @param string $storagePath The permanent storage path
* @return void
*/
public function setStoragePath( $storagePath ) {
/**
* Fetch HTML for this transform output
*
- * @param $options array Associative array of options. Boolean options
+ * @param array $options Associative array of options. Boolean options
* should be indicated with a value of true for true, and false or
* absent for false.
*
/**
* Stream the file if there were no errors
*
- * @param $headers Array Additional HTTP headers to send on success
+ * @param array $headers Additional HTTP headers to send on success
* @return Bool success
*/
public function streamFile( $headers = array() ) {
* It may also include a 'page' parameter for multipage files.
*
* @param $file File object
- * @param $url String: URL path to the thumb
+ * @param string $url URL path to the thumb
* @param $path String|bool|null: filesystem path to the thumb
- * @param $parameters Array: Associative array of parameters
+ * @param array $parameters Associative array of parameters
* @private
*/
function __construct( $file, $url, $path = false, $parameters = array() ) {
* Return HTML <img ... /> tag for the thumbnail, will include
* width and height attributes and a blank alt text (as required).
*
- * @param $options array Associative array of options. Boolean options
+ * @param array $options Associative array of options. Boolean options
* should be indicated with a value of true for true, and false or
* absent for false.
*
* Constructor
*
* Creates an SVGReader drawing from the source provided
- * @param $source String: URI from which to read
+ * @param string $source URI from which to read
* @throws MWException|Exception
*/
function __construct( $source ) {
/**
* Read a textelement from an element
*
- * @param String $name of the element that we are reading from
- * @param String $metafield that we will fill with the result
+ * @param string $name of the element that we are reading from
+ * @param string $metafield that we will fill with the result
*/
private function readField( $name, $metafield=null ) {
$this->debug ( "Read field $metafield" );
/**
* Read an XML snippet from an element
*
- * @param String $metafield that we will fill with the result
+ * @param string $metafield that we will fill with the result
* @throws MWException
*/
private function readXml( $metafield=null ) {
/**
* Filter all children, looking for animate elements
*
- * @param String $name of the element that we are reading from
+ * @param string $name of the element that we are reading from
*/
private function animateFilter( $name ) {
$this->debug ( "animate filter for tag $name" );
* Return a rounded pixel equivalent for a labeled CSS/SVG length.
* http://www.w3.org/TR/SVG11/coords.html#UnitIdentifiers
*
- * @param $length String: CSS/SVG length.
+ * @param string $length CSS/SVG length.
* @param $viewportSize: Float optional scale for percentage units...
* @return float: length in pixels
*/
* @author Hexmode
* @author Hashar
*
- * @param $filename String Full path to a XCF file
+ * @param string $filename Full path to a XCF file
* @return bool|array metadata array just like PHP getimagesize()
*/
static function getXCFMetaData( $filename ) {
* Also catches any errors during processing, writes them to
* debug log, blanks result array and returns false.
*
- * @param $content String: XMP data
+ * @param string $content XMP data
* @param $allOfIt Boolean: If this is all the data (true) or if its split up (false). Default true
* @param $reset Boolean: does xml parser need to be reset. Default false
* @throws MWException
*
* @todo In serious need of testing
* @see http://www.adobe.ge/devnet/xmp/pdfs/XMPSpecificationPart3.pdf XMP spec part 3 page 20
- * @param String $content XMPExtended block minus the namespace signature
+ * @param string $content XMPExtended block minus the namespace signature
* @return Boolean If it succeeded.
*/
public function parseExtended( $content ) {
* and are processing the 0/10 bit.
*
* @param $parser XMLParser reference to the xml parser
- * @param $data String Character data
+ * @param string $data Character data
* @throws MWException on invalid data
*/
function char( $parser, $data ) {
* Check to see if this is the element we started to ignore,
* in which case we get out of MODE_IGNORE
*
- * @param $elm String Namespace of element followed by a space and then tag name of element.
+ * @param string $elm Namespace of element followed by a space and then tag name of element.
*/
private function endElementModeIgnore ( $elm ) {
if ( $this->curItem[0] === $elm ) {
* Or it could be if we hit the end element of a property
* of a compound data structure (like a member of an array).
*
- * @param $elm String namespace, space, and tag name.
+ * @param string $elm namespace, space, and tag name.
*/
private function endElementModeSimple ( $elm ) {
if ( $this->charContent !== false ) {
*
* This method is called when we hit the "</exif:ISOSpeedRatings>" tag.
*
- * @param $elm String namespace . space . tag name.
+ * @param string $elm namespace . space . tag name.
* @throws MWException
*/
private function endElementNested( $elm ) {
* (For comparison, we call endElementModeSimple when we
* hit the "</rdf:li>")
*
- * @param $elm String namespace . ' ' . element name
+ * @param string $elm namespace . ' ' . element name
* @throws MWException
*/
private function endElementModeLi( $elm ) {
* Qualifiers aren't all that common, and we don't do anything
* with them.
*
- * @param $elm String namespace and element
+ * @param string $elm namespace and element
*/
private function endElementModeQDesc( $elm ) {
* xmp and have no meaning.
*
* @param $parser XMLParser
- * @param $elm String namespace . ' ' . element name
+ * @param string $elm namespace . ' ' . element name
* @throws MWException
*/
function endElement( $parser, $elm ) {
* in which case we add it to the item stack, so we can ignore things
* that are nested, correctly.
*
- * @param $elm String namespace . ' ' . tag name
+ * @param string $elm namespace . ' ' . tag name
*/
private function startElementModeIgnore( $elm ) {
if ( $elm === $this->curItem[0] ) {
* Start element in MODE_BAG (unordered array)
* this should always be <rdf:Bag>
*
- * @param $elm String namespace . ' ' . tag
+ * @param string $elm namespace . ' ' . tag
* @throws MWException if we have an element that's not <rdf:Bag>
*/
private function startElementModeBag( $elm ) {
* Start element in MODE_SEQ (ordered array)
* this should always be <rdf:Seq>
*
- * @param $elm String namespace . ' ' . tag
+ * @param string $elm namespace . ' ' . tag
* @throws MWException if we have an element that's not <rdf:Seq>
*/
private function startElementModeSeq( $elm ) {
* which are really only used for thumbnails, which
* we don't care about.
*
- * @param $elm String namespace . ' ' . tag
+ * @param string $elm namespace . ' ' . tag
* @throws MWException if we have an element that's not <rdf:Alt>
*/
private function startElementModeLang( $elm ) {
*
* This method is called when processing the <rdf:Description> element
*
- * @param $elm String namespace and tag names separated by space.
- * @param $attribs Array Attributes of the element.
+ * @param string $elm namespace and tag names separated by space.
+ * @param array $attribs Attributes of the element.
* @throws MWException
*/
private function startElementModeSimple( $elm, $attribs ) {
* </exif:DigitalZoomRatio>
* Called when processing the <rdf:value> or <foo:someQualifier>.
*
- * @param $elm String namespace and tag name separated by a space.
+ * @param string $elm namespace and tag name separated by a space.
*
*/
private function startElementModeQDesc( $elm ) {
*
* This is generally where most properties start.
*
- * @param $ns String Namespace
- * @param $tag String tag name (without namespace prefix)
- * @param $attribs Array array of attributes
+ * @param string $ns Namespace
+ * @param string $tag tag name (without namespace prefix)
+ * @param array $attribs array of attributes
* @throws MWException
*/
private function startElementModeInitial( $ns, $tag, $attribs ) {
* <exif:Flash rdf:parseType='Resource'> <exif:Fired>True</exif:Fired>
* <exif:Mode>1</exif:Mode></exif:Flash>
*
- * @param $ns String namespace
- * @param $tag String tag name (no ns)
- * @param $attribs Array array of attribs w/ values.
+ * @param string $ns namespace
+ * @param string $tag tag name (no ns)
+ * @param array $attribs array of attribs w/ values.
* @throws MWException
*/
private function startElementModeStruct( $ns, $tag, $attribs ) {
* </rdf:Seq> </exif:ISOSpeedRatings>
* This method is called when we hit the <rdf:li> element.
*
- * @param $elm String: namespace . ' ' . tagname
- * @param $attribs Array: Attributes. (needed for BAGSTRUCTS)
+ * @param string $elm namespace . ' ' . tagname
+ * @param array $attribs Attributes. (needed for BAGSTRUCTS)
* @throws MWException if gets a tag other than <rdf:li>
*/
private function startElementModeLi( $elm, $attribs ) {
*
* This method is called when we hit the <rdf:li> element.
*
- * @param $elm String namespace . ' ' . tag
- * @param $attribs array array of elements (most importantly xml:lang)
+ * @param string $elm namespace . ' ' . tag
+ * @param array $attribs array of elements (most importantly xml:lang)
* @throws MWException if gets a tag other than <rdf:li> or if no xml:lang
*/
private function startElementModeLiLang( $elm, $attribs ) {
* Also does some initial set up for the wrapper element
*
* @param $parser XMLParser
- * @param $elm String namespace "<space>" element
- * @param $attribs Array attribute name => value
+ * @param string $elm namespace "<space>" element
+ * @param array $attribs attribute name => value
* @throws MWException
*/
function startElement( $parser, $elm, $attribs ) {
* <rdf:Description rdf:about="" xmlns:exif="http://ns.adobe.com/exif/1.0/" exif:DigitalZoomRatio="0/10">
* @endcode
*
- * @param $attribs Array attribute=>value array.
+ * @param array $attribs attribute=>value array.
* @throws MWException
*/
private function doAttribs( $attribs ) {
* $this->processingArray to determine what name to
* save the value under. (in addition to $tag).
*
- * @param $ns String namespace of tag this is for
- * @param $tag String tag name
- * @param $val String value to save
+ * @param string $ns namespace of tag this is for
+ * @param string $tag tag name
+ * @param string $val value to save
*/
private function saveValue( $ns, $tag, $val ) {
/**
* function to validate boolean properties ( True or False )
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
/**
* function to validate rational properties ( 12/10 )
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
* if its outside of range put it into range.
*
* @see MWG spec
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
/**
* function to validate integers
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
* function to validate properties with a fixed number of allowed
* choices. (closed choice)
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
/**
* function to validate and modify flash structure
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
* @see rfc 3066
* @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate
* @param $standalone Boolean if this is a simple property or array
*/
* YYYY-MM-DDThh:mm:ssTZD
* YYYY-MM-DDThh:mm:ss.sTZD
*
- * @param $info Array information about current property
+ * @param array $info information about current property
* @param &$val Mixed current value to validate. Converts to TS_EXIF as a side-effect.
* in cases where there's only a partial date, it will give things like
* 2011:04.
* @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart2.pdf
* section 1.2.7.4 on page 23
*
- * @param $info Array unused (info about prop)
+ * @param array $info unused (info about prop)
* @param &$val String GPS string in either DDD,MM,SSk or
* or DDD,MM.mmk form
* @param $standalone Boolean if its a simple prop (should always be true)
* Fast return for pure ASCII strings; some lesser optimizations for
* strings containing only known-good characters. Not as fast as toNFC().
*
- * @param $string String: a UTF-8 string
+ * @param string $string a UTF-8 string
* @return string a clean, shiny, normalized UTF-8 string
*/
static function cleanUp( $string ) {
* Fast return for pure ASCII strings; some lesser optimizations for
* strings containing only known-good characters.
*
- * @param $string String: a valid UTF-8 string. Input is not validated.
+ * @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form C
*/
static function toNFC( $string ) {
* Convert a UTF-8 string to normal form D, canonical decomposition.
* Fast return for pure ASCII strings.
*
- * @param $string String: a valid UTF-8 string. Input is not validated.
+ * @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form D
*/
static function toNFD( $string ) {
* This may cause irreversible information loss, use judiciously.
* Fast return for pure ASCII strings.
*
- * @param $string String: a valid UTF-8 string. Input is not validated.
+ * @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KC
*/
static function toNFKC( $string ) {
* This may cause irreversible information loss, use judiciously.
* Fast return for pure ASCII strings.
*
- * @param $string String: a valid UTF-8 string. Input is not validated.
+ * @param string $string a valid UTF-8 string. Input is not validated.
* @return string a UTF-8 string in normal form KD
*/
static function toNFKD( $string ) {
/**
* Returns true if the string is _definitely_ in NFC.
* Returns false if not or uncertain.
- * @param $string String: a valid UTF-8 string. Input is not validated.
+ * @param string $string a valid UTF-8 string. Input is not validated.
* @return bool
*/
static function quickIsNFC( $string ) {
/**
* Returns true if the string is _definitely_ in NFC.
* Returns false if not or uncertain.
- * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
+ * @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML.
* @return bool
*/
static function quickIsNFCVerify( &$string ) {
* (depending on which decomposition map is passed to us).
* Input is assumed to be *valid* UTF-8. Invalid code will break.
* @private
- * @param $string String: valid UTF-8 string
- * @param $map Array: hash of expanded decomposition map
+ * @param string $string valid UTF-8 string
+ * @param array $map hash of expanded decomposition map
* @return string a UTF-8 string decomposed, not yet normalized (needs sorting)
*/
static function fastDecompose( $string, $map ) {
* Sorts combining characters into canonical order. This is the
* final step in creating decomposed normal forms D and KD.
* @private
- * @param $string String: a valid, decomposed UTF-8 string. Input is not validated.
+ * @param string $string a valid, decomposed UTF-8 string. Input is not validated.
* @return string a UTF-8 string with combining characters sorted in canonical order
*/
static function fastCombiningSort( $string ) {
* Produces canonically composed sequences, i.e. normal form C or KC.
*
* @private
- * @param $string String: a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
+ * @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated.
* @return string a UTF-8 string with canonical precomposed characters used where possible
*/
static function fastCompose( $string ) {
* Function to replace some characters that we don't want
* but most of the native normalize functions keep.
*
- * @param $string String The string
+ * @param string $string The string
* @return String String with the character codes replaced.
*/
private static function replaceForNativeNormalize( $string ) {
* Take a UTF-8 string and return a space-separated series of hex
* numbers representing Unicode code points. For debugging.
*
- * @param $str String: UTF-8 string.
+ * @param string $str UTF-8 string.
* @return string
* @private
*/
/**
* Escape a string for inclusion in a PHP single-quoted string literal.
*
- * @param $string String: string to be escaped.
+ * @param string $string string to be escaped.
* @return String: escaped string.
* @public
*/
/**
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
* Set an item.
* @param $key string
* @param $value mixed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
* @return bool success
*/
abstract public function set( $key, $value, $exptime = 0 );
* @param $casToken mixed
* @param $key string
* @param $value mixed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
* @return bool success
*/
abstract public function cas( $casToken, $key, $value, $exptime = 0 );
/**
* Delete an item.
* @param $key string
- * @param $time int Amount of time to delay the operation (mostly memcached-specific)
+ * @param int $time Amount of time to delay the operation (mostly memcached-specific)
* @return bool True if the item was deleted or not found, false on failure
*/
abstract public function delete( $key, $time = 0 );
*
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
*
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
protected function mergeViaCas( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
*
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
protected function mergeViaLock( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
/**
* Delete all objects expiring before a certain date.
- * @param $date string The reference date in MW format
+ * @param string $date The reference date in MW format
* @param $progressCallback callback|bool Optional, a function which will be called
* regularly during long-running operations with the percentage progress
* as the first parameter.
/**
* Get an associative array containing the item for each of the keys that have items.
- * @param $keys Array List of strings
+ * @param array $keys List of strings
* @return Array
*/
public function getMulti( array $keys ) {
/**
* Increase stored value of $key by $value while preserving its TTL
- * @param $key String: Key to increase
+ * @param string $key Key to increase
* @param $value Integer: Value to add to $key (Default 1)
* @return integer|bool New value or false on failure
*/
/**
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
/**
* @param $key string
* @param $value int
- * @param $exptime int (default 0)
+ * @param int $exptime (default 0)
* @return Mixed
*/
public function add( $key, $value, $exptime = 0 ) {
/**
* Memcache initializer
*
- * @param $args Array Associative array of settings
+ * @param array $args Associative array of settings
*
* @return mixed
*/
* Adds a key/value to the memcache server if one isn't already set with
* that key
*
- * @param $key String: key to set with data
+ * @param string $key key to set with data
* @param $val Mixed: value to store
* @param $exp Integer: (optional) Expiration time. This can be a number of seconds
* to cache for (up to 30 days inclusive). Any timespans of 30 days + 1 second or
/**
* Decrease a value stored on the memcache server
*
- * @param $key String: key to decrease
+ * @param string $key key to decrease
* @param $amt Integer: (optional) amount to decrease
*
* @return Mixed: FALSE on failure, value on success
/**
* Deletes a key from the server, optionally after $time
*
- * @param $key String: key to delete
+ * @param string $key key to delete
* @param $time Integer: (optional) how long to wait before deleting
*
* @return Boolean: TRUE on success, FALSE on failure
/**
* Retrieves the value associated with the key from the memcache server
*
- * @param $key array|string key to retrieve
+ * @param array|string $key key to retrieve
* @param $casToken[optional] Float
*
* @return Mixed
/**
* Get multiple keys from the server(s)
*
- * @param $keys Array: keys to retrieve
+ * @param array $keys keys to retrieve
*
* @return Array
*/
/**
* Increments $key (optionally) by $amt
*
- * @param $key String: key to increment
+ * @param string $key key to increment
* @param $amt Integer: (optional) amount to increment
*
* @return Integer: null if the key does not exist yet (this does NOT
/**
* Overwrites an existing value for key; only works if key is already set
*
- * @param $key String: key to set value as
+ * @param string $key key to set value as
* @param $value Mixed: value to store
* @param $exp Integer: (optional) Expiration time. This can be a number of seconds
* to cache for (up to 30 days inclusive). Any timespans of 30 days + 1 second or
* output as an array (null array if no output)
*
* @param $sock Resource: socket to send command on
- * @param $cmd String: command to run
+ * @param string $cmd command to run
*
* @return Array: output array
*/
* Unconditionally sets a key to a given value in the memcache. Returns true
* if set successfully.
*
- * @param $key String: key to set value as
+ * @param string $key key to set value as
* @param $value Mixed: value to set
* @param $exp Integer: (optional) Expiration time. This can be a number of seconds
* to cache for (up to 30 days inclusive). Any timespans of 30 days + 1 second or
* to a known, given value. Returns true if set successfully.
*
* @param $casToken Float: current known value
- * @param $key String: key to set value as
+ * @param string $key key to set value as
* @param $value Mixed: value to set
* @param $exp Integer: (optional) Expiration time. This can be a number of seconds
* to cache for (up to 30 days inclusive). Any timespans of 30 days + 1 second or
/**
* Sets the server list to distribute key gets and puts between
*
- * @param $list Array of servers to connect to
+ * @param array $list of servers to connect to
*
* @see MWMemcached::__construct()
*/
/**
* Close the specified socket
*
- * @param $sock String: socket to close
+ * @param string $sock socket to close
*
* @access private
*/
* Connects $sock to $host, timing out after $timeout
*
* @param $sock Integer: socket to connect
- * @param $host String: Host:IP to connect to
+ * @param string $host Host:IP to connect to
*
* @return boolean
* @access private
/**
* Marks a host as dead until 30-40 seconds in the future
*
- * @param $sock String: socket to mark as dead
+ * @param string $sock socket to mark as dead
*
* @access private
*/
/**
* get_sock
*
- * @param $key String: key to retrieve value for;
+ * @param string $key key to retrieve value for;
*
* @return Mixed: resource on success, false on failure
* @access private
/**
* Creates a hash integer based on the $key
*
- * @param $key String: key to hash
+ * @param string $key key to hash
*
* @return Integer: hash value
* @access private
/**
* Perform increment/decriment on $key
*
- * @param $cmd String command to perform
- * @param $key String|array key to perform it on
+ * @param string $cmd command to perform
+ * @param string|array $key key to perform it on
* @param $amt Integer amount to adjust
*
* @return Integer: new value of $key
* Load items into $ret from $sock
*
* @param $sock Resource: socket to read from
- * @param $ret Array: returned values
+ * @param array $ret returned values
* @param $casToken[optional] Float
* @return boolean True for success, false for failure
*
/**
* Performs the requested storage operation to the memcache server
*
- * @param $cmd String: command to perform
- * @param $key String: key to act on
+ * @param string $cmd command to perform
+ * @param string $key key to act on
* @param $val Mixed: what we need to store
* @param $exp Integer: (optional) Expiration time. This can be a number of seconds
* to cache for (up to 30 days inclusive). Any timespans of 30 days + 1 second or
/**
* Returns the socket for the host
*
- * @param $host String: Host:IP to get socket for
+ * @param string $host Host:IP to get socket for
*
* @return Mixed: IO Stream or false
* @access private
* the client, but some day we might find a case where it should be
* different.
*
- * @param $key string The key used by the caller, or false if there wasn't one.
+ * @param string $key The key used by the caller, or false if there wasn't one.
* @param $result Mixed The return value
* @return Mixed
*/
/**
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
/**
* Get a cache key for the given session id.
*
- * @param $id String: session id
+ * @param string $id session id
* @return String: cache key
*/
static function getKey( $id ) {
/**
* Callback when reading session data.
*
- * @param $id String: session id
+ * @param string $id session id
* @return Mixed: session data
*/
static function read( $id ) {
/**
* Callback when writing session data.
*
- * @param $id String: session id
+ * @param string $id session id
* @param $data Mixed: session data
* @return Boolean: success
*/
/**
* Callback to destroy a session when calling session_destroy().
*
- * @param $id String: session id
+ * @param string $id session id
* @return Boolean: success
*/
static function destroy( $id ) {
/**
* Get a value from the WinCache object cache
*
- * @param $key String: cache key
+ * @param string $key cache key
* @param $casToken[optional] int: cas token
* @return mixed
*/
/**
* Store a value in the WinCache object cache
*
- * @param $key String: cache key
+ * @param string $key cache key
* @param $value Mixed: object to store
- * @param $expire Int: expiration time
+ * @param int $expire expiration time
* @return bool
*/
public function set( $key, $value, $expire = 0 ) {
/**
* Store a value in the WinCache object cache, race condition-safe
*
- * @param $casToken int: cas token
- * @param $key String: cache key
- * @param $value int: object to store
- * @param $exptime Int: expiration time
+ * @param int $casToken cas token
+ * @param string $key cache key
+ * @param int $value object to store
+ * @param int $exptime expiration time
* @return bool
*/
public function cas( $casToken, $key, $value, $exptime = 0 ) {
/**
* Remove a value from the WinCache object cache
*
- * @param $key String: cache key
- * @param $time Int: not used in this implementation
+ * @param string $key cache key
+ * @param int $time not used in this implementation
* @return bool
*/
public function delete( $key, $time = 0 ) {
/**
* Get a value from the XCache object cache
*
- * @param $key String: cache key
+ * @param string $key cache key
* @param $casToken mixed: cas token
* @return mixed
*/
/**
* Store a value in the XCache object cache
*
- * @param $key String: cache key
+ * @param string $key cache key
* @param $value Mixed: object to store
- * @param $expire Int: expiration time
+ * @param int $expire expiration time
* @return bool
*/
public function set( $key, $value, $expire = 0 ) {
/**
* Remove a value from the XCache object cache
*
- * @param $key String: cache key
- * @param $time Int: not used in this implementation
+ * @param string $key cache key
+ * @param int $time not used in this implementation
* @return bool
*/
public function delete( $key, $time = 0 ) {
*
* @param $key string
* @param $callback closure Callback method to be executed
- * @param $exptime int Either an interval in seconds or a unix timestamp for expiry
- * @param $attempts int The amount of times to attempt a merge in case of failure
+ * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
+ * @param int $attempts The amount of times to attempt a merge in case of failure
* @return bool success
*/
public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
* per-article cache invalidation timestamps, or if it comes from
* an incompatible older version.
*
- * @param $touched String: the affected article's last touched timestamp
+ * @param string $touched the affected article's last touched timestamp
* @return Boolean
*/
public function expired( $touched ) {
* For links to "wiki"s, or similar software, spaces are encoded as '_',
*
* @param $parser Parser object
- * @param $s String: The text to encode.
- * @param $arg String (optional): The type of encoding.
+ * @param string $s The text to encode.
+ * @param string $arg (optional): The type of encoding.
* @return string
*/
static function urlencode( $parser, $s = '', $arg = null ) {
* title which will normalise to the canonical title
*
* @param $parser Parser: parent parser
- * @param $text String: desired title text
+ * @param string $text desired title text
* @return String
*/
static function displaytitle( $parser, $text = '' ) {
* @todo Document parameters
*
* @param $parser Parser
- * @param $page String TODO DOCUMENT (Default: empty string)
+ * @param string $page TODO DOCUMENT (Default: empty string)
* @param $raw TODO DOCUMENT (Default: null)
* @return string
*/
/**
* Gives language names.
* @param $parser Parser
- * @param $code String Language code (of which to get name)
- * @param $inLanguage String Language code (in which to get name)
+ * @param string $code Language code (of which to get name)
+ * @param string $inLanguage Language code (in which to get name)
* @return String
*/
static function language( $parser, $code = '', $inLanguage = '' ) {
/**
* @param $parser Parser
- * @param $text String The sortkey to use
- * @param $uarg String Either "noreplace" or "noerror" (in en)
+ * @param string $text The sortkey to use
+ * @param string $uarg Either "noreplace" or "noerror" (in en)
* both suppress errors, and noreplace does nothing if
* a default sortkey already exists.
* @return string
}
/**
- * @param $preference String: User preference
- * @param $text String: Text to reformat
- * @param $options Array: can contain 'linked' and/or 'match-whole'
+ * @param string $preference User preference
+ * @param string $text Text to reformat
+ * @param array $options can contain 'linked' and/or 'match-whole'
* @return mixed|String
*/
function reformat( $preference, $text, $options = array( 'linked' ) ) {
/**
* Makes an ISO month, e.g. 02, from a month name
- * @param $monthName String: month name
+ * @param string $monthName month name
* @return string ISO month name
*/
function makeIsoMonth( $monthName ) {
/**
* @todo document
- * @param $year String: Year name
+ * @param string $year Year name
* @return string ISO year name
*/
function makeIsoYear( $year ) {
* strings will be returned.
*
* @param $other LinkHolderArray
- * @param $texts Array of strings
+ * @param array $texts of strings
* @return Array
*/
function mergeForeign( $other, $texts ) {
*
* @param $nt Title
* @param $text String
- * @param $query Array [optional]
- * @param $trail String [optional]
- * @param $prefix String [optional]
+ * @param array $query [optional]
+ * @param string $trail [optional]
+ * @param string $prefix [optional]
* @return string
*/
function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) {
* Convert wikitext to HTML
* Do not call this function recursively.
*
- * @param $text String: text we want to parse
+ * @param string $text text we want to parse
* @param $title Title object
* @param $options ParserOptions
* @param $linestart boolean
* @param $clearState boolean
- * @param $revid Int: number to pass in {{REVISIONID}}
+ * @param int $revid number to pass in {{REVISIONID}}
* @return ParserOutput a ParserOutput
*/
public function parse( $text, Title $title, ParserOptions $options, $linestart = true, $clearState = true, $revid = null ) {
*
* If $frame is not provided, then template variables (e.g., {{{1}}}) within $text are not expanded
*
- * @param $text String: text extension wants to have parsed
+ * @param string $text text extension wants to have parsed
* @param $frame PPFrame: The frame to use for expanding any template variables
*
* @return string
* Recursive parser entry point that can be called from an extension tag
* hook.
*
- * @param $text String: text to be expanded
+ * @param string $text text to be expanded
* @param $frame PPFrame: The frame to use for expanding any template variables
* @return String
* @since 1.19
/**
* Accessor/mutator for the output type
*
- * @param $x int|null New value or null to just get the current one
+ * @param int|null $x New value or null to just get the current one
* @return Integer
*/
function OutputType( $x = null ) {
* '<element param="x">tag content</element>' ) )
* @endcode
*
- * @param $elements array list of element names. Comments are always extracted.
- * @param $text string Source text string.
- * @param $matches array Out parameter, Array: extracted tags
+ * @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
*/
* Get the rel attribute for a particular external link.
*
* @since 1.21
- * @param $url String|bool optional URL, to extract the domain from for rel =>
+ * @param string|bool $url optional URL, to extract the domain from for rel =>
* nofollow if appropriate
* @param $title Title optional Title, for wgNoFollowNsExceptions lookups
* @return string|null rel attribute for $url
* (depending on configuration, namespace, and the URL's domain) and/or a
* target attribute (depending on configuration).
*
- * @param $url String|bool optional URL, to extract the domain from for rel =>
+ * @param string|bool $url optional URL, to extract the domain from for rel =>
* nofollow if appropriate
* @return Array associative array of HTML attributes
*/
*
* @param $nt Title
* @param $text String
- * @param $query Array or String
+ * @param array $query or String
* @param $trail String
* @param $prefix String
* @return String: HTML-wikitext mix oh yuck
* 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 $text String: more-or-less HTML
+ * @param string $text more-or-less HTML
* @return String: less-or-more HTML with NOPARSE bits
*/
function armorLinks( $text ) {
/**
* Handle link to subpage if necessary
*
- * @param $target String: the source of the link
+ * @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
* @private
* Split up a string on ':', ignoring any occurrences inside tags
* to prevent illegal overlapping.
*
- * @param $str String the string to split
+ * @param string $str the string to split
* @param &$before String set to everything before the ':'
* @param &$after String set to everything after the ':'
* @throws MWException
* Preprocess some wikitext and return the document tree.
* This is the ghost of replace_variables().
*
- * @param $text String: The text to parse
+ * @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.
* self::OT_PREPROCESS: templates but not extension tags
* self::OT_HTML: all templates and extension tags
*
- * @param $text String the text to transform
+ * @param string $text the text to transform
* @param $frame PPFrame Object describing the arguments passed to the template.
* Arguments may also be provided as an associative array, as was the usual case before MW1.12.
* Providing arguments this way may be useful for extensions wishing to perform variable replacement explicitly.
* Warn the user when a parser limitation is reached
* Will warn at most once the user per limitation type
*
- * @param $limitationType String: should be one of:
+ * @param string $limitationType should be one of:
* 'expensive-parserfunction' (corresponding messages:
* 'expensive-parserfunction-warning',
* 'expensive-parserfunction-category')
* 'post-expand-template-inclusion' (corresponding messages:
* 'post-expand-template-inclusion-warning',
* 'post-expand-template-inclusion-category')
- * @param $current int|null Current value
- * @param $max int|null Maximum allowed, when an explicit limit has been
+ * @param int|null $current Current value
+ * @param int|null $max Maximum allowed, when an explicit limit has been
* exceeded, provide the values (optional)
*/
function limitationWarn( $limitationType, $current = '', $max = '' ) {
* Return the text of a template, after recursively
* replacing any variables or templates within the template.
*
- * @param $piece Array: 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
* Fetch a file and its title and register a reference to it.
* If 'broken' is a key in $options then the file will appear as a broken thumbnail.
* @param Title $title
- * @param Array $options Array of options to RepoGroup::findFile
+ * @param array $options Array of options to RepoGroup::findFile
* @return File|bool
*/
function fetchFile( $title, $options = array() ) {
* Fetch a file and its title and register a reference to it.
* If 'broken' is a key in $options then the file will appear as a broken thumbnail.
* @param Title $title
- * @param Array $options Array of options to RepoGroup::findFile
+ * @param array $options Array of options to RepoGroup::findFile
* @return Array ( File or false, Title of file )
*/
function fetchFileAndTitle( $title, $options = array() ) {
* Return the text to be used for a given extension tag.
* This is the ghost of strip().
*
- * @param $params array Associative array of parameters:
+ * @param array $params Associative array of parameters:
* name PPNode for the tag name
* attr PPNode for unparsed text where tag attributes are thought to be
* attributes Optional associative array of parsed attributes
/**
* Increment an include size counter
*
- * @param $type String: the type of expansion
+ * @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
*/
* Add a tracking category, getting the title from a system message,
* or print a debug message if the title is invalid.
*
- * @param $msg String: message key
+ * @param string $msg message key
* @return Boolean: whether the addition was successful
*/
public function addTrackingCategory( $msg ) {
* string and re-inserts the newly formatted headlines.
*
* @param $text String
- * @param $origText String: original, untouched wikitext
+ * @param string $origText original, untouched wikitext
* @param $isMain Boolean
* @return mixed|string
* @private
* Transform wiki markup when saving a page by doing "\r\n" -> "\n"
* conversion, substitting signatures, {{subst:}} templates, etc.
*
- * @param $text String: the text to transform
+ * @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
* as it may have changed if it's the $wgParser.
*
* @param $user User
- * @param $nickname String|bool nickname to use or false to use user's default nickname
+ * @param string|bool $nickname nickname to use or false to use user's default nickname
* @param $fancySig Boolean|null whether the nicknname is the complete signature
* or null to use default value
* @return string
* 2) Substitute all transclusions
*
* @param $text String
- * @param $parsing bool Whether we're cleaning (preferences save) or parsing
+ * @param bool $parsing Whether we're cleaning (preferences save) or parsing
* @return String: signature text
*/
public function cleanSig( $text, $parsing = false ) {
/**
* Wrapper for preprocess()
*
- * @param $text String: the text to preprocess
+ * @param string $text the text to preprocess
* @param $options ParserOptions: options
* @param $title Title object or null to use $wgTitle
* @return String
* nowiki Wiki markup in the return value should be escaped
* isHTML The returned text is HTML, armour it against wikitext transformation
*
- * @param $id String: The magic word ID
+ * @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:
* SFH_NO_HASH No leading hash, i.e. {{plural:...}} instead of {{#if:...}}
*
* External callers should use the getSection and replaceSection methods.
*
- * @param $text String: Page wikitext
- * @param $section String: a section identifier string of the form:
+ * @param string $text Page wikitext
+ * @param string $section a section identifier string of the form:
* "<flag1> - <flag2> - ... - <section number>"
*
* Currently the only recognised flag is "T", which means the target section number
* string. If $text is the empty string and section 0 is replaced, $newText is
* returned.
*
- * @param $mode String: one of "get" or "replace"
- * @param $newText String: replacement text for section data.
+ * @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.
*/
*
* If a section contains subsections, these are also returned.
*
- * @param $text String: text to look in
- * @param $section String: section identifier
- * @param $deftext String: default to return if section is not found
+ * @param string $text text to look in
+ * @param string $section section identifier
+ * @param string $deftext default to return if section is not found
* @return string text of the requested section
*/
public function getSection( $text, $section, $deftext = '' ) {
* specified by $section has been replaced with $text. If the target
* section does not exist, $oldtext is returned unchanged.
*
- * @param $oldtext String: former text of the article
- * @param $section int section identifier
- * @param $text String: replacing 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 ) {
/**
* Mutator for $mDefaultSort
*
- * @param $sort string New value
+ * @param string $sort New value
*/
public function setDefaultSort( $sort ) {
$this->mDefaultSort = $sort;
* instead. For use in redirects, since IE6 interprets Redirect: headers
* as something other than UTF-8 (apparently?), resulting in breakage.
*
- * @param $text String: The section name
+ * @param string $text The section name
* @return string An anchor
*/
public function guessLegacySectionNameFromWikiText( $text ) {
* to create valid section anchors by mimicing the output of the
* parser when headings are parsed.
*
- * @param $text String: text string to be stripped of wikitext
+ * @param string $text text string to be stripped of wikitext
* for use in a Section anchor
* @return string Filtered text string
*/
* If the $data array has been stored persistently, the caller should first
* check whether it is still valid, by calling isValidHalfParsedText().
*
- * @param $data array Serialized data
+ * @param array $data Serialized data
* @throws MWException
* @return String
*/
/**
* Checks, if a url is pointing to the own server
*
- * @param $internal String the server to check against
- * @param $url String the url to check
+ * @param string $internal the server to check against
+ * @param string $url the url to check
* @return bool
*/
static function isLinkInternal( $internal, $url ) {
/**
* Register a file dependency for this output
- * @param $name string Title dbKey
- * @param $timestamp string MW timestamp of file creation (or false if non-existing)
- * @param $sha1 string base 36 SHA-1 of file (or false if non-existing)
+ * @param string $name Title dbKey
+ * @param string $timestamp MW timestamp of file creation (or false if non-existing)
+ * @param string $sha1 base 36 SHA-1 of file (or false if non-existing)
* @return void
*/
function addImage( $name, $timestamp = null, $sha1 = null ) {
* -- this is assumed to have been validated
* (check equal normalisation, etc.)
*
- * @param $text String: desired title text
+ * @param string $text desired title text
*/
public function setDisplayTitle( $text ) {
$this->setTitleText( $text );
* Preprocess some wikitext and return the document tree.
* This is the ghost of Parser::replace_variables().
*
- * @param $text String: the text to parse
+ * @param string $text the text to parse
* @param $flags Integer: bitwise combination of:
* Parser::PTD_FOR_INCLUSION Handle "<noinclude>" and "<includeonly>" as if the text is being
* included. Default is to assume a direct page view.
* Preprocess some wikitext and return the document tree.
* This is the ghost of Parser::replace_variables().
*
- * @param $text String: the text to parse
+ * @param string $text the text to parse
* @param $flags Integer: bitwise combination of:
* Parser::PTD_FOR_INCLUSION Handle "<noinclude>" and "<includeonly>" as if the text is being
* included. Default is to assume a direct page view.
* If tidy isn't able to correct the markup, the original will be
* returned in all its glory with a warning comment appended.
*
- * @param $text String: hideous HTML input
+ * @param string $text hideous HTML input
* @return String: corrected HTML output
*/
public static function tidy( $text ) {
* Spawn an external HTML tidy process and get corrected markup back from it.
* Also called in OutputHandler.php for full page validation
*
- * @param $text String: HTML to check
+ * @param string $text HTML to check
* @param $stderr Boolean: Whether to read result from STDERR rather than STDOUT
* @param &$retval int Exit code (-1 on internal error)
* @return mixed String or null
* Use the HTML tidy extension to use the tidy library in-process,
* saving the overhead of spawning a new process.
*
- * @param $text String: HTML to check
+ * @param string $text HTML to check
* @param $stderr Boolean: Whether to read result from error status instead of output
* @param &$retval int Exit code (-1 on internal error)
* @return mixed String or null
/**
* Begin profiling of a function
- * @param $functionname String: name of the function we will profile
+ * @param string $functionname name of the function we will profile
*/
function wfProfileIn( $functionname ) {
global $wgProfiler;
/**
* Stop profiling of a function
- * @param $functionname String: name of the function we have profiled
+ * @param string $functionname name of the function we have profiled
*/
function wfProfileOut( $functionname = 'missing' ) {
global $wgProfiler;
/**
* Recursive function the format the current profiling array into a tree
*
- * @param $stack array profiling array
+ * @param array $stack profiling array
* @return array
*/
function remapCallTree( $stack ) {
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param $metric string|false: metric to use, with the following possibilities:
+ * @param string|false $metric metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
* Get the initial time of the request, based either on $wgRequestTime or
* $wgRUstart. Will return null if not able to find data.
*
- * @param $metric string|false: metric to use, with the following possibilities:
+ * @param string|false $metric metric to use, with the following possibilities:
* - user: User CPU time (without system calls)
* - cpu: Total CPU time (user and system calls)
* - wall (or any other string): elapsed time
/**
* Add an entry in the debug log file
*
- * @param $s String to output
+ * @param string $s to output
*/
function debug( $s ) {
if( defined( 'MW_COMPILED' ) || function_exists( 'wfDebug' ) ) {
* requests its own information. This sacrifice of modularity yields a substantial
* performance improvement.
*
- * @param $modules Array: List of module names to preload information for
+ * @param array $modules List of module names to preload information for
* @param $context ResourceLoaderContext: Context to load the information within
*/
public function preloadModuleInfo( array $modules, ResourceLoaderContext $context ) {
* If $data is empty, only contains whitespace or the filter was unknown,
* $data is returned unmodified.
*
- * @param $filter String: Name of filter to run
- * @param $data String: Text to filter, such as JavaScript or CSS text
+ * @param string $filter Name of filter to run
+ * @param string $data Text to filter, such as JavaScript or CSS text
* @return String: Filtered data, or a comment containing an error message
*/
protected function filter( $filter, $data ) {
* Registers a module with the ResourceLoader system.
*
* @param $name Mixed: Name of module as a string or List of name/object pairs as an array
- * @param $info array Module info array. For backwards compatibility with 1.17alpha,
+ * @param array $info Module info array. For backwards compatibility with 1.17alpha,
* this may also be a ResourceLoaderModule object. Optional when using
* multiple-registration calling style.
* @throws MWException: If a duplicate module registration is attempted
* 'loadScript': URL (either fully-qualified or protocol-relative) of load.php for this source
*
* @param $id Mixed: source ID (string), or array( id1 => props1, id2 => props2, ... )
- * @param $properties Array: source properties
+ * @param array $properties source properties
* @throws MWException
*/
public function addSource( $id, $properties = null) {
* If the given framework id is unknkown, or if the in-object variable is not an array,
* then it will return an empty array.
*
- * @param $framework String: Optional. Get only the test module names for one
+ * @param string $framework Optional. Get only the test module names for one
* particular framework.
* @return Array
*/
/**
* Get the ResourceLoaderModule object for a given module name.
*
- * @param $name String: Module name
+ * @param string $name Module name
* @return ResourceLoaderModule if module has been registered, null otherwise
*/
public function getModule( $name ) {
/**
* Send content type and last modified headers to the client.
* @param $context ResourceLoaderContext
- * @param $mtime string TS_MW timestamp to use for last-modified
- * @param $error bool Whether there are commented-out errors in the response
+ * @param string $mtime TS_MW timestamp to use for last-modified
+ * @param bool $error Whether there are commented-out errors in the response
* @return void
*/
protected function sendResponseHeaders( ResourceLoaderContext $context, $mtime, $errors ) {
* If there's an If-Modified-Since header, respond with a 304 appropriately
* and clear out the output buffer. If the client cache is too old then do nothing.
* @param $context ResourceLoaderContext
- * @param $mtime string The TS_MW timestamp to check the header against
+ * @param string $mtime The TS_MW timestamp to check the header against
* @return bool True iff 304 header sent and output handled
*/
protected function tryRespondLastModified( ResourceLoaderContext $context, $mtime ) {
* Generates code for a response
*
* @param $context ResourceLoaderContext: Context in which to generate a response
- * @param $modules Array: List of module objects keyed by module name
- * @param $missing Array: List of unavailable modules (optional)
+ * @param array $modules List of module objects keyed by module name
+ * @param array $missing List of unavailable modules (optional)
* @return String: Response data
*/
public function makeModuleResponse( ResourceLoaderContext $context,
* Returns JS code to call to mw.loader.implement for a module with
* given properties.
*
- * @param $name string Module name
+ * @param string $name Module name
* @param $scripts Mixed: List of URLs to JavaScript files or String of JavaScript code
* @param $styles Mixed: Array of CSS strings keyed by media type, or an array of lists of URLs to
* CSS files keyed by media type
* Combines an associative array mapping media type to CSS into a
* single stylesheet with "@media" blocks.
*
- * @param $stylePairs Array: Array keyed by media type containing (arrays of) CSS strings.
+ * @param array $stylePairs Array keyed by media type containing (arrays of) CSS strings.
*
* @return Array
*/
* which will have values corresponding to $name, $version, $dependencies
* and $group as supplied.
*
- * @param $name String: Module name
+ * @param string $name Module name
* @param $version Integer: Module version number as a timestamp
- * @param $dependencies Array: List of module names on which this module depends
- * @param $group String: Group which the module is in.
- * @param $source String: Source of the module, or 'local' if not foreign.
- * @param $script String: JavaScript code
+ * @param array $dependencies List of module names on which this module depends
+ * @param string $group Group which the module is in.
+ * @param string $source Source of the module, or 'local' if not foreign.
+ * @param string $script JavaScript code
*
* @return string
*/
* ) ):
* Registers modules with the given names and parameters.
*
- * @param $name String: Module name
+ * @param string $name Module name
* @param $version Integer: Module version number as a timestamp
- * @param $dependencies Array: List of module names on which this module depends
- * @param $group String: group which the module is in.
- * @param $source String: source of the module, or 'local' if not foreign
+ * @param array $dependencies List of module names on which this module depends
+ * @param string $group group which the module is in.
+ * @param string $source source of the module, or 'local' if not foreign
*
* @return string
*/
* - ResourceLoader::makeLoaderSourcesScript( array( $id1 => $props1, $id2 => $props2, ... ) );
* Register sources with the given IDs and properties.
*
- * @param $id String: source ID
- * @param $properties Array: source properties (see addSource())
+ * @param string $id source ID
+ * @param array $properties source properties (see addSource())
*
* @return string
*/
* Returns JS code which runs given JS code if the client-side framework is
* present.
*
- * @param $script String: JavaScript code
+ * @param string $script JavaScript code
*
* @return string
*/
* Returns JS code which will set the MediaWiki configuration array to
* the given value.
*
- * @param $configuration Array: List of configuration values keyed by variable name
+ * @param array $configuration List of configuration values keyed by variable name
*
* @return string
*/
*
* For example, array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' )
* becomes 'foo.bar,baz|bar.baz,quux'
- * @param $modules array of module names (strings)
+ * @param array $modules of module names (strings)
* @return string Packed query string
*/
public static function makePackedModulesString( $modules ) {
/**
* Build a load.php URL
- * @param $modules array of module names (strings)
- * @param $lang string Language code
- * @param $skin string Skin name
- * @param $user string|null User name. If null, the &user= parameter is omitted
- * @param $version string|null Versioning timestamp
- * @param $debug bool Whether the request should be in debug mode
- * @param $only string|null &only= parameter
- * @param $printable bool Printable mode
- * @param $handheld bool Handheld mode
- * @param $extraQuery array Extra query parameters to add
+ * @param array $modules of module names (strings)
+ * @param string $lang Language code
+ * @param string $skin Skin name
+ * @param string|null $user User name. If null, the &user= parameter is omitted
+ * @param string|null $version Versioning timestamp
+ * @param bool $debug Whether the request should be in debug mode
+ * @param string|null $only &only= parameter
+ * @param bool $printable Printable mode
+ * @param bool $handheld Handheld mode
+ * @param array $extraQuery Extra query parameters to add
* @return string URL to load.php. May be protocol-relative (if $wgLoadScript is procol-relative)
*/
public static function makeLoaderURL( $modules, $lang, $skin, $user = null, $version = null, $debug = false, $only = null,
* Module names may not contain pipes (|), commas (,) or exclamation marks (!) and can be
* at most 255 bytes.
*
- * @param $moduleName string Module name to check
+ * @param string $moduleName Module name to check
* @return bool Whether $moduleName is a valid module name
*/
public static function isValidModuleName( $moduleName ) {
* Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to
* an array of module names like array( 'jquery.foo', 'jquery.bar',
* 'jquery.ui.baz', 'jquery.ui.quux' )
- * @param $modules String Packed module name list
+ * @param string $modules Packed module name list
* @return array of module names
*/
public static function expandModuleNames( $modules ) {
/**
* Constructs a new module from an options array.
*
- * @param $options Array: List of options; if not given or empty, an empty module will be
+ * @param array $options List of options; if not given or empty, an empty module will be
* constructed
- * @param $localBasePath String: Base path to prepend to all local paths in $options. Defaults
+ * @param string $localBasePath Base path to prepend to all local paths in $options. Defaults
* to $IP
- * @param $remoteBasePath String: Base path to prepend to all remote paths in $options. Defaults
+ * @param string $remoteBasePath Base path to prepend to all remote paths in $options. Defaults
* to $wgScriptPath
*
* Below is a description for the $options array:
/**
* Collates file paths by option (where provided).
*
- * @param $list Array: List of file paths in any combination of index/path
+ * @param array $list List of file paths in any combination of index/path
* or path/options pairs
- * @param $option String: option name
+ * @param string $option option name
* @param $default Mixed: default value if the option isn't set
* @return Array: List of file paths, collated by $option
*/
/**
* Gets a list of element that match a key, optionally using a fallback key.
*
- * @param $list Array: List of lists to select from
- * @param $key String: Key to look for in $map
- * @param $fallback String: Key to look for in $list if $key doesn't exist
+ * @param array $list List of lists to select from
+ * @param string $key Key to look for in $map
+ * @param string $fallback Key to look for in $list if $key doesn't exist
* @return Array: List of elements from $map which matched $key or $fallback,
* or an empty list in case of no match
*/
/**
* Gets the contents of a list of JavaScript files.
*
- * @param $scripts Array: List of file paths to scripts to read, remap and concetenate
+ * @param array $scripts List of file paths to scripts to read, remap and concetenate
* @throws MWException
* @return String: Concatenated and remapped JavaScript data from $scripts
*/
/**
* Gets the contents of a list of CSS files.
*
- * @param $styles Array: List of media type/list of file paths pairs, to read, remap and
+ * @param array $styles List of media type/list of file paths pairs, to read, remap and
* concetenate
*
* @param $flip bool
*
* This method can be used as a callback for array_map()
*
- * @param $path String: File path of style file to read
+ * @param string $path File path of style file to read
* @param $flip bool
*
* @return String: CSS data in script file
* Set this module's name. This is called by ResourceLoader::register()
* when registering the module. Other code should not call this.
*
- * @param $name String: Name
+ * @param string $name Name
*/
public function setName( $name ) {
$this->name = $name;
* Set this module's origin. This is called by ResourceLodaer::register()
* when registering the module. Other code should not call this.
*
- * @param $origin Int origin
+ * @param int $origin origin
*/
public function setOrigin( $origin ) {
$this->origin = $origin;
* Get the files this module depends on indirectly for a given skin.
* Currently these are only image files referenced by the module's CSS.
*
- * @param $skin String: Skin name
+ * @param string $skin Skin name
* @return Array: List of files
*/
public function getFileDependencies( $skin ) {
/**
* Set preloaded file dependency information. Used so we can load this
* information for all modules at once.
- * @param $skin String: Skin name
- * @param $deps Array: Array of file names
+ * @param string $skin Skin name
+ * @param array $deps Array of file names
*/
public function setFileDependencies( $skin, $deps ) {
$this->fileDeps[$skin] = $deps;
/**
* Get the last modification timestamp of the message blob for this
* module in a given language.
- * @param $lang String: Language code
+ * @param string $lang Language code
* @return Integer: UNIX timestamp, or 0 if the module doesn't have messages
*/
public function getMsgBlobMtime( $lang ) {
/**
* Set a preloaded message blob last modification timestamp. Used so we
* can load this information for all modules at once.
- * @param $lang String: Language code
+ * @param string $lang Language code
* @param $mtime Integer: UNIX timestamp or 0 if there is no such blob
*/
public function setMsgBlobMtime( $lang, $mtime ) {
/**
* Safe version of filemtime(), which doesn't throw a PHP warning if the file doesn't exist
* but returns 1 instead.
- * @param $filename string File name
+ * @param string $filename File name
* @return int UNIX timestamp, or 1 if the file doesn't exist
*/
protected static function safeFilemtime( $filename ) {
* Set the visibility for the revisions in this list. Logging and
* transactions are done here.
*
- * @param $params array Associative array of parameters. Members are:
+ * @param array $params Associative array of parameters. Members are:
* value: The integer value to set the visibility to
* comment: The log comment.
* @return Status
/**
* Record a log entry on the action
- * @param $params array Associative array of parameters:
+ * @param array $params Associative array of parameters:
* newBits: The new value of the *_deleted bitfield
* oldBits: The old value of the *_deleted bitfield.
* title: The target title
/**
* Get log parameter array.
- * @param $params array Associative array of log parameters, same as updateLog()
+ * @param array $params Associative array of log parameters, same as updateLog()
* @return array
*/
public function getLogParams( $params ) {
* Checks for a change in the bitfield for a certain option and updates the
* provided array accordingly.
*
- * @param $desc String: description to add to the array if the option was
+ * @param string $desc description to add to the array if the option was
* enabled / disabled.
* @param $field Integer: the bitmask describing the single option.
* @param $diff Integer: the xor of the old and new bitfields.
* @param $new Integer: the new bitfield
- * @param $arr Array: the array to update.
+ * @param array $arr the array to update.
*/
protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
if( $diff & $field ) {
* If title searches are not supported or disabled, return null.
* STUB
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SearchResultSet
*/
function searchText( $term ) {
* If title searches are not supported or disabled, return null.
* STUB
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SearchResultSet
*/
function searchTitle( $term ) {
* on text to be used for searching or updating search index.
* Default implementation does nothing (simply returns $string).
*
- * @param $string string: String to process
+ * @param string $string String to process
* @return string
*/
public function normalizeText( $string ) {
}
/**
- * @param $terms Array: terms to highlight
+ * @param array $terms terms to highlight
* @return String: highlighted text snippet, null (and not '') if not supported
*/
function getTextSnippet( $terms ) {
}
/**
- * @param $terms Array: terms to highlight
+ * @param array $terms terms to highlight
* @return String: highlighted title, '' if not supported
*/
function getTitleSnippet( $terms ) {
}
/**
- * @param $terms Array: terms to highlight
+ * @param array $terms terms to highlight
* @return String: highlighted redirect name (redirect to this page), '' if none or not supported
*/
function getRedirectSnippet( $terms ) {
* Default implementation of wikitext highlighting
*
* @param $text String
- * @param $terms Array: terms to highlight (unescaped)
+ * @param array $terms terms to highlight (unescaped)
* @param $contextlines Integer
* @param $contextchars Integer
* @return String
/**
* Split text into lines and add it to extracts array
*
- * @param $extracts Array: index -> $line
+ * @param array $extracts index -> $line
* @param $count Integer
* @param $text String
*/
/**
* Search extracts for a pattern, and return snippets
*
- * @param $pattern String: regexp for matching lines
- * @param $extracts Array: extracts to search
+ * @param string $pattern regexp for matching lines
+ * @param array $extracts extracts to search
* @param $linesleft Integer: number of extracts to make
* @param $contextchars Integer: length of snippet
- * @param $out Array: map for highlighted snippets
- * @param $offsets Array: map of starting points of snippets
+ * @param array $out map for highlighted snippets
+ * @param array $offsets map of starting points of snippets
* @protected
*/
function process( $pattern, $extracts, &$linesleft, &$contextchars, &$out, &$offsets ) {
/**
* Perform a full text search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return MssqlSearchResultSet
* @access public
*/
/**
* Perform a title-only search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return MssqlSearchResultSet
* @access public
*/
/**
* Perform a full text search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return MySQLSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return MySQLSearchResultSet
*/
function searchTitle( $term ) {
/**
* Perform a full text search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SqlSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SqlSearchResultSet
*/
function searchTitle( $term ) {
* Currently searches a page's current title (page.page_title) and
* latest revision article text (pagecontent.old_text)
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return PostgresSearchResultSet
*/
function searchTitle( $term ) {
/**
* Perform a full text search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SqliteSearchResultSet
*/
function searchText( $term ) {
/**
* Perform a title-only search query and return a result set.
*
- * @param $term String: raw search term
+ * @param string $term raw search term
* @return SqliteSearchResultSet
*/
function searchTitle( $term ) {
*
* @since 1.21
*
- * @param String $title the target page's title, in normalized form.
+ * @param string $title the target page's title, in normalized form.
*
* @return String
*/
/**
* @param $context IContextSource
* @param $group null Unused
- * @param $par string Parameter passed to the page
+ * @param string $par Parameter passed to the page
*/
function __construct( IContextSource $context = null, $group = null, $par = null ) {
global $wgActiveUserDays;
/**
* Constructor
*
- * @param $name string: name of the special page, as seen in links and URLs (default: 'Allpages')
+ * @param string $name name of the special page, as seen in links and URLs (default: 'Allpages')
*/
function __construct( $name = 'Allpages' ) {
parent::__construct( $name );
/**
* Entry point : initialise variables and call subfunctions.
*
- * @param $par String: becomes "FOO" when called like Special:Allpages/FOO (default NULL)
+ * @param string $par becomes "FOO" when called like Special:Allpages/FOO (default NULL)
*/
function execute( $par ) {
global $wgContLang;
* HTML for the top form
*
* @param $namespace Integer: a namespace constant (default NS_MAIN).
- * @param $from String: dbKey we are starting listing at.
- * @param $to String: dbKey we are ending listing at.
- * @param $hideredirects Bool: dont show redirects (default FALSE)
+ * @param string $from dbKey we are starting listing at.
+ * @param string $to dbKey we are ending listing at.
+ * @param bool $hideredirects dont show redirects (default FALSE)
* @return string
*/
function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '', $hideredirects = false ) {
/**
* @param $namespace Integer (default NS_MAIN)
- * @param $from String: list all pages from this name
- * @param $to String: list all pages to this name
- * @param $hideredirects Bool: dont show redirects (default FALSE)
+ * @param string $from list all pages from this name
+ * @param string $to list all pages to this name
+ * @param bool $hideredirects dont show redirects (default FALSE)
*/
function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', $hideredirects = false ) {
$output = $this->getOutput();
/**
* Show a line of "ABC to DEF" ranges of articles
*
- * @param $inpoint String: lower limit of pagenames
- * @param $outpoint String: upper limit of pagenames
+ * @param string $inpoint lower limit of pagenames
+ * @param string $outpoint upper limit of pagenames
* @param $namespace Integer (Default NS_MAIN)
- * @param $hideredirects Bool: dont show redirects (default FALSE)
+ * @param bool $hideredirects dont show redirects (default FALSE)
* @return string
*/
function showline( $inpoint, $outpoint, $namespace = NS_MAIN, $hideredirects ) {
/**
* @param $namespace Integer (Default NS_MAIN)
- * @param $from String: list all pages from this name (default FALSE)
- * @param $to String: list all pages to this name (default FALSE)
- * @param $hideredirects Bool: dont show redirects (default FALSE)
+ * @param string $from list all pages from this name (default FALSE)
+ * @param string $to list all pages to this name (default FALSE)
+ * @param bool $hideredirects dont show redirects (default FALSE)
*/
function showChunk( $namespace = NS_MAIN, $from = false, $to = false, $hideredirects = false ) {
global $wgContLang;
/**
* @param $ns Integer: the namespace of the article
- * @param $text String: the name of the article
+ * @param string $text the name of the article
* @return array( int namespace, string dbkey, string pagename ) or NULL on error
*/
protected function getNamespaceKeyAndText( $ns, $text ) {
/**
* If the user has already been blocked with similar settings, load that block
* and change the defaults for the form fields to match the existing settings.
- * @param $fields Array HTMLForm descriptor array
+ * @param array $fields HTMLForm descriptor array
* @return Bool whether fields were altered (that is, whether the target is
* already blocked)
*/
/**
* Determine the target of the block, and the type of target
* TODO: should be in Block.php?
- * @param $par String subpage parameter passed to setup, or data value from
+ * @param string $par subpage parameter passed to setup, or data value from
* the HTMLForm
* @param $request WebRequest optionally try and get data from a request too
* @return array( User|string|null, Block::TYPE_ constant|null )
* Validate a block target.
*
* @since 1.21
- * @param String $value Block target to check
+ * @param string $value Block target to check
* @param User $user Performer of the block
* @return Status
*/
/**
* Convert a submitted expiry time, which may be relative ("2 weeks", etc) or absolute
* ("24 May 2034", etc), into an absolute timestamp we can put into the database.
- * @param $expiry String: whatever was typed into the form
+ * @param string $expiry whatever was typed into the form
* @return String: timestamp or "infinity" string for the DB implementation
*/
public static function parseExpiryInput( $expiry ) {
/**
* Return a comma-delimited list of "flags" to be passed to the log
* reader for this block, to provide more information in the logs
- * @param $data Array from HTMLForm data
+ * @param array $data from HTMLForm data
* @param $type Block::TYPE_ constant (USER, RANGE, or IP)
* @return string
*/
/**
* Main execution point
*
- * @param $par String title fragment
+ * @param string $par title fragment
*/
public function execute( $par ) {
$this->setHeaders();
/**
* Show the special page
*
- * @param $isbn string ISBN passed as a subpage parameter
+ * @param string $isbn ISBN passed as a subpage parameter
*/
public function execute( $isbn ) {
$this->setHeaders();
/**
* Returns whether a given ISBN (10 or 13) is valid. True indicates validity.
- * @param $isbn string ISBN passed for check
+ * @param string $isbn ISBN passed for check
* @return bool
*/
public static function isValidISBN( $isbn ) {
/**
* Trim ISBN and remove characters which aren't required
*
- * @param $isbn string Unclean ISBN
+ * @param string $isbn Unclean ISBN
* @return string
*/
private static function cleanIsbn( $isbn ) {
/**
* Format a book source list item
*
- * @param $label string Book source label
- * @param $url string Book source URL
+ * @param string $label Book source label
+ * @param string $url Book source URL
* @return string
*/
private function makeListItem( $label, $url ) {
* Attempt to confirm the user's email address and show success or failure
* as needed; if successful, take the user to log in
*
- * @param $code string Confirmation code
+ * @param string $code Confirmation code
*/
function attemptConfirm( $code ) {
$user = User::newFromConfirmationCode( $code );
* Attempt to invalidate the user's email address and show success or failure
* as needed; if successful, link to main page
*
- * @param $code string Confirmation code
+ * @param string $code Confirmation code
*/
function attemptInvalidate( $code ) {
$user = User::newFromConfirmationCode( $code );
* This method basically executes the exact same code as the parent class, though with
* a hook added, to allow extentions to add additional queries.
*
- * @param $offset String: index offset, inclusive
+ * @param string $offset index offset, inclusive
* @param $limit Integer: exact query limit
* @param $descending Boolean: query direction, false for ascending, true for descending
* @return ResultWrapper
* Special page "deleted user contributions".
* Shows a list of the deleted contributions of a user.
*
- * @param $par String: (optional) user name of the user for which to show the contributions
+ * @param string $par (optional) user name of the user for which to show the contributions
*/
function execute( $par ) {
global $wgQueryPageDefaultLimit;
/**
* Generates the namespace selector form with hidden attributes.
- * @param $options Array: the options to be included.
+ * @param array $options the options to be included.
* @return string
*/
function getForm( $options ) {
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param $titles array of strings, or Title objects
+ * @param array $titles of strings, or Title objects
* @param $output String
*/
private function showTitles( $titles, &$output ) {
*
* @param Title $title
* @param int $namespace
- * @param String $dbKey
+ * @param string $dbKey
* @return bool: Whether this item is valid
*/
private function checkTitle( $title, $namespace, $dbKey ) {
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param $titles Array of strings, or Title objects
+ * @param array $titles of strings, or Title objects
*/
private function watchTitles( $titles ) {
$dbw = wfGetDB( DB_MASTER );
* $titles can be an array of strings or Title objects; the former
* is preferred, since Titles are very memory-heavy
*
- * @param $titles Array of strings, or Title objects
+ * @param array $titles of strings, or Title objects
*/
private function unwatchTitles( $titles ) {
$dbw = wfGetDB( DB_MASTER );
* form is open (bug 32126), but we know that invalid items will
* be harmless so we can override it here.
*
- * @param $value String the value the field was submitted with
- * @param $alldata Array the data collected from the form
+ * @param string $value the value the field was submitted with
+ * @param array $alldata the data collected from the form
* @return Mixed Bool true on success, or String error to display.
*/
function validate( $value, $alldata ) {
/**
* Validate target User
*
- * @param $target String: target user name
+ * @param string $target target user name
* @return User object on success or a string on error
*/
public static function getTarget( $target ) {
* Check whether a user is allowed to send email
*
* @param $user User object
- * @param $editToken String: edit token
+ * @param string $editToken edit token
* @return null on success or string on error
*/
public static function getPermissionsError( $user, $editToken ) {
/**
* Form to ask for target user name.
*
- * @param $name String: user name submitted.
+ * @param string $name user name submitted.
* @return String: form asking for user name.
*/
protected function userForm( $name ) {
/**
* Do the actual page exporting
*
- * @param $page String: user input on what page(s) to export
+ * @param string $page user input on what page(s) to export
* @param $history Mixed: one of the WikiExporter history export constants
* @param $list_authors Boolean: Whether to add distinct author list (when
* not returning full history)
/**
*
- * @param $dupes Array of File objects
+ * @param array $dupes of File objects
*/
function showList( $dupes ) {
$html = array();
* Function to wrap the summary.
* It must be given a valid state as a second parameter or an exception will
* be thrown.
- * @param $html String: The raw HTML.
- * @param $state String: State, one of 'noframework', 'unknownframework' or 'frameworkfound'
+ * @param string $html The raw HTML.
+ * @param string $state State, one of 'noframework', 'unknownframework' or 'frameworkfound'
* @throws MWException
* @return string
*/
/**
* Create a user-readable list of permissions from the given array.
*
- * @param $permissions Array of permission => bool (from $wgGroupPermissions items)
- * @param $revoke Array of permission => bool (from $wgRevokePermissions items)
- * @param $add Array of groups this group is allowed to add or true
- * @param $remove Array of groups this group is allowed to remove or true
- * @param $addSelf Array of groups this group is allowed to add to self or true
- * @param $removeSelf Array of group this group is allowed to remove from self or true
+ * @param array $permissions of permission => bool (from $wgGroupPermissions items)
+ * @param array $revoke of permission => bool (from $wgRevokePermissions items)
+ * @param array $add of groups this group is allowed to add or true
+ * @param array $remove of groups this group is allowed to remove or true
+ * @param array $addSelf of groups this group is allowed to add to self or true
+ * @param array $removeSelf of group this group is allowed to remove from self or true
* @return string List of all granted permissions, separated by comma separator
*/
private function formatPermissions( $permissions, $revoke, $add, $remove, $addSelf, $removeSelf ) {
/**
* @param $context IContextSource
- * @param $par array (Default null)
+ * @param array $par (Default null)
* @param $including boolean Whether this page is being transcluded in
* another page
*/
/**
* Format a link to a group description page
*
- * @param $group String: group name
- * @param $username String Username
+ * @param string $group group name
+ * @param string $username Username
* @return string
*/
protected static function buildGroupLink( $group, $username ) {
/**
* Show the special page
*
- * @param $par string (optional) A group to list users from
+ * @param string $par (optional) A group to list users from
*/
public function execute( $par ) {
$this->setHeaders();
* Make a link to "what links here" for the specified title
*
* @param $title Title being queried
- * @param $caption String: text to display on the link
+ * @param string $caption text to display on the link
* @return String
*/
function makeWlhLink( $title, $caption ) {
/**
* Show the form
*
- * @param $err Array: error messages. Each item is an error message.
+ * @param array $err error messages. Each item is an error message.
* It may either be a string message name or array message name and
* parameters, like the second argument to OutputPage::wrapWikiMsg().
*/
/**
* Entry point : initialise variables and call subfunctions.
- * @param $par String: becomes "FOO" when called like Special:Prefixindex/FOO (default null)
+ * @param string $par becomes "FOO" when called like Special:Prefixindex/FOO (default null)
*/
function execute( $par ) {
global $wgContLang;
/**
* HTML for the top form
* @param $namespace Integer: a namespace constant (default NS_MAIN).
- * @param $from String: dbKey we are starting listing at.
- * @param $hideredirects Bool: hide redirects (default FALSE)
+ * @param string $from dbKey we are starting listing at.
+ * @param bool $hideredirects hide redirects (default FALSE)
* @return string
*/
function namespacePrefixForm( $namespace = NS_MAIN, $from = '', $hideredirects = false ) {
/**
* @param $namespace Integer, default NS_MAIN
* @param $prefix String
- * @param $from String: list all pages from this name (default FALSE)
- * @param $hideredirects Bool: hide redirects (default FALSE)
+ * @param string $from list all pages from this name (default FALSE)
+ * @param bool $hideredirects hide redirects (default FALSE)
*/
function showPrefixChunk( $namespace = NS_MAIN, $prefix, $from = null, $hideredirects = false ) {
global $wgContLang;
/**
* @param $namespace Integer
- * @param $type String: restriction type
- * @param $level String: restriction level
- * @param $sizetype String: "min" or "max"
+ * @param string $type restriction type
+ * @param string $level restriction level
+ * @param string $sizetype "min" or "max"
* @param $size Integer
* @param $indefOnly Boolean: only indefinie protection
* @param $cascadeOnly Boolean: only cascading protection
/**
* Send output to the OutputPage object, only called if not used feeds
*
- * @param $rows Array of database rows
+ * @param array $rows of database rows
* @param $opts FormOptions
*/
public function webOutput( $rows, $opts ) {
/**
* Filter $rows by categories set in $opts
*
- * @param $rows Array of database rows
+ * @param array $rows of database rows
* @param $opts FormOptions
*/
function filterByCategories( &$rows, FormOptions $opts ) {
* Makes change an option link which carries all the other options
*
* @param $title Title
- * @param $override Array: options to override
- * @param $options Array: current options
+ * @param array $override options to override
+ * @param array $options current options
* @param $active Boolean: whether to show the link in bold
* @return string
*/
/**
* Put together a rev_deleted bitfield
- * @param $bitPars array extractBitParams() params
- * @param $oldfield int current bitfield
+ * @param array $bitPars extractBitParams() params
+ * @param int $oldfield current bitfield
* @return array
*/
public static function extractBitfield( $bitPars, $oldfield ) {
/**
* Entry point
*
- * @param $par String or null
+ * @param string $par or null
*/
public function execute( $par ) {
$this->setHeaders();
* Format a single hit result
*
* @param $result SearchResult
- * @param $terms Array: terms to highlight
+ * @param array $terms terms to highlight
*
* @return string
*/
* @param $lastInterwiki String
* @param $terms Array
* @param $query String
- * @param $customCaptions Array: iw prefix -> caption
+ * @param array $customCaptions iw prefix -> caption
*
* @return string
*/
/**
* Generates the power search box at [[Special:Search]]
*
- * @param $term String: search term
+ * @param string $term search term
* @param $opts array
* @return String: HTML form
*/
* Make a search link with some target namespaces
*
* @param $term String
- * @param $namespaces Array ignored
- * @param $label String: link's text
- * @param $tooltip String: link's tooltip
- * @param $params Array: query string parameters
+ * @param array $namespaces ignored
+ * @param string $label link's text
+ * @param string $tooltip link's tooltip
+ * @param array $params query string parameters
* @return String: HTML fragment
*/
protected function makeSearchLink( $term, $namespaces, $label, $tooltip, $params = array() ) {
/**
* Check if query starts with image: prefix
*
- * @param $term String: the string to check
+ * @param string $term the string to check
* @return Boolean
*/
protected function startsWithImage( $term ) {
/**
* Check if query starts with all: prefix
*
- * @param $term String: the string to check
+ * @param string $term the string to check
* @return Boolean
*/
protected function startsWithAll( $term ) {
* given title prefix.
* Returns result wrapper with (ar_namespace, ar_title, count) fields.
*
- * @param $prefix String: title prefix
+ * @param string $prefix title prefix
* @return ResultWrapper
*/
public static function listPagesByPrefix( $prefix ) {
* Once restored, the items will be removed from the archive tables.
* The deletion log will be updated with an undeletion notice.
*
- * @param $timestamps Array: pass an empty array to restore all revisions, otherwise list the ones to undelete.
+ * @param array $timestamps pass an empty array to restore all revisions, otherwise list the ones to undelete.
* @param $comment String
* @param $fileVersions Array
* @param $unsuppress Boolean
* to the cur/old tables. If the page currently exists, all revisions will
* be stuffed into old, otherwise the most recent will go into cur.
*
- * @param $timestamps Array: pass an empty array to restore all revisions, otherwise list the ones to undelete.
+ * @param array $timestamps pass an empty array to restore all revisions, otherwise list the ones to undelete.
* @param $unsuppress Boolean: remove all ar_deleted/fa_deleted restrictions of seletected revs
*
* @param $comment String
*
* @param $rev Revision
* @param $titleObj Title
- * @param $ts string Timestamp
+ * @param string $ts Timestamp
* @return string
*/
function getPageLink( $rev, $titleObj, $ts ) {
*
* @param $file File
* @param $titleObj Title
- * @param $ts string A timestamp
- * @param $key String: a storage key
+ * @param string $ts A timestamp
+ * @param string $key a storage key
*
* @return String: HTML fragment
*/
/**
* Get an UploadForm instance with title and text properly set.
*
- * @param $message String: HTML string to add to the form
- * @param $sessionKey String: session key in case this is a stashed upload
+ * @param string $message HTML string to add to the form
+ * @param string $sessionKey session key in case this is a stashed upload
* @param $hideIgnoreWarning Boolean: whether to hide "ignore warning" check box
* @return UploadForm
*/
* essentially means that UploadBase::VERIFICATION_ERROR and
* UploadBase::EMPTY_FILE should not be passed here.
*
- * @param $message String: HTML message to be passed to mainUploadForm
+ * @param string $message HTML message to be passed to mainUploadForm
*/
protected function showRecoverableUploadError( $message ) {
$sessionKey = $this->mUpload->stashSession();
/**
* Show the upload form with error message, but do not stash the file.
*
- * @param $message string HTML string
+ * @param string $message HTML string
*/
protected function showUploadError( $message ) {
$message = '<h2>' . $this->msg( 'uploadwarning' )->escaped() . "</h2>\n" .
/**
* Provides output to the user for a result of UploadBase::verifyUpload
*
- * @param $details Array: result of UploadBase::verifyUpload
+ * @param array $details result of UploadBase::verifyUpload
* @throws MWException
*/
protected function processVerificationError( $details ) {
* Formats a result of UploadBase::getExistsWarning as HTML
* This check is static and can be done pre-upload via AJAX
*
- * @param $exists Array: the result of UploadBase::getExistsWarning
+ * @param array $exists the result of UploadBase::getExistsWarning
* @return String: empty string if there is no warning or an HTML fragment
*/
public static function getExistsWarning( $exists ) {
/**
* Get a list of warnings
*
- * @param $filename String: local filename, e.g. 'file exists', 'non-descriptive filename'
+ * @param string $filename local filename, e.g. 'file exists', 'non-descriptive filename'
* @return Array: list of warning messages
*/
public static function ajaxGetExistsWarning( $filename ) {
/**
* Execute page -- can output a file directly or show a listing of them.
*
- * @param $subPage String: subpage, e.g. in http://example.com/wiki/Special:UploadStash/foo.jpg, the "foo.jpg" part
+ * @param string $subPage subpage, e.g. in http://example.com/wiki/Special:UploadStash/foo.jpg, the "foo.jpg" part
* @return Boolean: success
*/
public function execute( $subPage ) {
* If file available in stash, cats it out to the client as a simple HTTP response.
* n.b. Most sanity checking done in UploadStashLocalFile, so this is straightforward.
*
- * @param $key String: the key of a particular requested file
+ * @param string $key the key of a particular requested file
* @throws HttpError
* @return bool
*/
/**
* Scale a file (probably with a locally installed imagemagick, or similar) and output it to STDOUT.
* @param $file File
- * @param $params array Scaling parameters ( e.g. array( width => '50' ) );
- * @param $flags int Scaling flags ( see File:: constants )
+ * @param array $params Scaling parameters ( e.g. array( width => '50' ) );
+ * @param int $flags Scaling flags ( see File:: constants )
* @throws MWException
* @throws UploadStashFileNotFoundException
* @return boolean success
/**
* Output HTTP response of raw content
* Side effect: writes HTTP response to STDOUT.
- * @param $content String content
- * @param $contentType String mime type
+ * @param string $content content
+ * @param string $contentType mime type
* @throws SpecialUploadStashTooLargeException
* @return bool
*/
* Output headers for streaming
* XXX unsure about encoding as binary; if we received from HTTP perhaps we should use that encoding, concatted with semicolon to mimeType as it usually is.
* Side effect: preps PHP to write headers to STDOUT.
- * @param String $contentType : string suitable for content-type header
- * @param String $size: length in bytes
+ * @param string $contentType : string suitable for content-type header
+ * @param string $size: length in bytes
*/
private static function outputFileHeaders( $contentType, $size ) {
header( "Content-Type: $contentType", true );
/**
* Increment the login attempt throttle hit count for the (username,current IP)
* tuple unless the throttle was already reached.
- * @param $username string The user name
+ * @param string $username The user name
* @return Bool|Integer The integer hit count or True if it is already at the limit
*/
public static function incLoginThrottle( $username ) {
/**
* Clear the login attempt throttle hit count for the (username,current IP) tuple.
- * @param $username string The user name
+ * @param string $username The user name
* @return void
*/
public static function clearLoginThrottle( $username ) {
/**
* @param $u User object
* @param $throttle Boolean
- * @param $emailTitle String: message name of email title
- * @param $emailText String: message name of email text
+ * @param string $emailTitle message name of email title
+ * @param string $emailText message name of email text
* @return Status object
*/
function mailPasswordInternal( $u, $throttle = true, $emailTitle = 'passwordremindertitle', $emailText = 'passwordremindertext' ) {
/**
* Display an "successful action" page.
*
- * @param $title string|Message page's title
+ * @param string|Message $title page's title
* @param $msgname string
* @param $injected_html string
*/
* Create a language selector link for a particular language
* Links back to this page preserving type and returnto
*
- * @param $text string Link text
- * @param $lang string Language code
+ * @param string $text Link text
+ * @param string $lang Language code
* @return string
*/
function makeLanguageSelectorLink( $text, $lang ) {
* Save user groups changes in the database.
* Data comes from the editUserGroupsForm() form function
*
- * @param $username String: username to apply changes to.
- * @param $reason String: reason for group change
+ * @param string $username username to apply changes to.
+ * @param string $reason reason for group change
* @return null
*/
function saveUserGroups( $username, $reason = '' ) {
* Save user groups changes in the database.
*
* @param $user User object
- * @param $add Array of groups to add
- * @param $remove Array of groups to remove
- * @param $reason String: reason for group change
+ * @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
*/
function doSaveUserGroups( $user, $add, $remove, $reason = '' ) {
/**
* Edit user groups membership
- * @param $username String: name of the user.
+ * @param string $username name of the user.
*/
function editUserGroupsForm( $username ) {
$status = $this->fetchUser( $username );
* form will be able to manipulate based on the current user's system
* permissions.
*
- * @param $groups Array: list of groups the given user is in
+ * @param array $groups list of groups the given user is in
* @return Array: Tuple of addable, then removable groups
*/
protected function splitGroups( $groups ) {
* Adds a table with checkboxes where you can select what groups to add/remove
*
* @todo Just pass the username string?
- * @param $usergroups Array: groups the user belongs to
+ * @param array $usergroups groups the user belongs to
* @param $user User a user object
* @return string XHTML table element with checkboxes
*/
}
/**
- * @param $group string: the name of the group to check
+ * @param string $group the name of the group to check
* @return bool Can we add the group?
*/
private function canAdd( $group ) {
/**
* Convert an array of items into a list for display.
*
- * @param $list Array of elements to display
+ * @param array $list of elements to display
* @param $sort Boolean: whether to sort the items in $list
*
* @return String
/**
* Retrieve the revision number of a Subversion working directory.
*
- * @param $dir String: directory of the svn checkout
+ * @param string $dir directory of the svn checkout
*
* @return Integer: revision number as int
*/
}
/**
- * @param $dir String: directory of the git checkout
+ * @param string $dir directory of the git checkout
* @return bool|String sha1 of commit HEAD points to
*/
public static function getGitHeadSha1( $dir ) {
}
/**
- * @param $level int Recursion level
+ * @param int $level Recursion level
* @param $target Title Target title
- * @param $limit int Number of entries to display
+ * @param int $limit Number of entries to display
* @param $from Title Display from this article ID
* @param $back Title Display from this article ID at backwards scrolling
*/
/**
* Initialize the path information
- * @param $name string the desired destination name
- * @param $tempPath string the temporary path
- * @param $fileSize int the file size
- * @param $removeTempFile bool (false) remove the temporary file?
+ * @param string $name the desired destination name
+ * @param string $tempPath the temporary path
+ * @param int $fileSize the file size
+ * @param bool $removeTempFile (false) remove the temporary file?
* @throws MWException
*/
public function initializePathInfo( $name, $tempPath, $fileSize, $removeTempFile = false ) {
}
/**
- * @param $srcPath String: the source path
+ * @param string $srcPath the source path
* @return string the real path if it was a virtual URL
*/
function getRealPath( $srcPath ) {
/**
* Verify the mime type
*
- * @param $mime string representing the mime
+ * @param string $mime representing the mime
* @return mixed true if the file is verified, an array otherwise
*/
protected function verifyMimeType( $mime ) {
/**
* Checks if the mime type of the uploaded file matches the file extension.
*
- * @param $mime String: the mime type of the uploaded file
- * @param $extension String: the filename extension that the file is to be served with
+ * @param string $mime the mime type of the uploaded file
+ * @param string $extension the filename extension that the file is to be served with
* @return Boolean
*/
public static function verifyExtension( $mime, $extension ) {
* potentially harmful. The present implementation will produce false
* positives in some situations.
*
- * @param $file String: pathname to the temporary upload file
- * @param $mime String: the mime type of the file
- * @param $extension String: the extension of the file
+ * @param string $file pathname to the temporary upload file
+ * @param string $mime the mime type of the file
+ * @param string $extension the extension of the file
* @return Boolean: true if the file contains something looking like embedded scripts
*/
public static function detectScript( $file, $mime, $extension ) {
* This relies on the $wgAntivirus and $wgAntivirusSetup variables.
* $wgAntivirusRequired may be used to deny upload if the scan fails.
*
- * @param $file String: pathname to the temporary upload file
+ * @param string $file pathname to the temporary upload file
* @return mixed false if not virus is found, NULL if the scan fails or is disabled,
* or a string containing feedback from the virus scanner if a virus was found.
* If textual feedback is missing but a virus was found, this function returns true.
* Check if a user is the last uploader
*
* @param $user User object
- * @param $img String: image name
+ * @param string $img image name
* @return Boolean
*/
public static function userCanReUpload( User $user, $img ) {
/**
* Add a chunk to the temporary directory
*
- * @param $chunkPath string path to temporary chunk file
- * @param $chunkSize int size of the current chunk
- * @param $offset int offset of current chunk ( mutch match database chunk offset )
+ * @param string $chunkPath path to temporary chunk file
+ * @param int $chunkSize size of the current chunk
+ * @param int $offset offset of current chunk ( mutch match database chunk offset )
* @return Status
*/
public function addChunk( $chunkPath, $chunkSize, $offset ) {
* Get a file and its metadata from the stash.
* The noAuth param is a bit janky but is required for automated scripts which clean out the stash.
*
- * @param $key String: key under which file information is stored
+ * @param string $key key under which file information is stored
* @param $noAuth Boolean (optional) Don't check authentication. Used by maintenance scripts.
* @throws UploadStashFileNotFoundException
* @throws UploadStashNotLoggedInException
/**
* Getter for file metadata.
*
- * @param $key String: key under which file information is stored
+ * @param string $key key under which file information is stored
* @return Array
*/
public function getMetadata ( $key ) {
/**
* Getter for fileProps
*
- * @param $key String: key under which file information is stored
+ * @param string $key key under which file information is stored
* @return Array
*/
public function getFileProps ( $key ) {
/**
* Stash a file in a temp directory and record that we did this in the database, along with other metadata.
*
- * @param $path String: path to file you want stashed
- * @param $sourceType String: 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
/**
* Helper function: do the actual database query to fetch file metadata.
*
- * @param $key String: key
+ * @param string $key key
* @param $readFromDB: constant (default: DB_SLAVE)
* @return boolean
*/
/**
* Helper function: Initialize the UploadStashFile for a given file.
*
- * @param $key String: key under which to store the object
+ * @param string $key key under which to store the object
* @throws UploadStashZeroLengthFileException
* @return bool
*/
* 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 $path String: path to file
- * @param $key String: key to store the path and any stashed data under
+ * @param string $path path to file
+ * @param string $key key to store the path and any stashed data under
* @throws UploadStashBadPathException
* @throws UploadStashFileNotFoundException
*/
* The actual argument is the result of thumbName although we seem to have
* buggy code elsewhere that expects a boolean 'suffix'
*
- * @param $thumbName String: name of thumbnail (e.g. "120px-123456.jpg" ), or false to just get the path
+ * @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 ) {
* We override this because we want to use the pretty url name instead of the
* ugly file name.
*
- * @param $params Array: handler-specific parameters
+ * @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
*/
* the thumbnail urls be predictable. However, in our model the URL is not based on the filename
* (that's hidden in the db)
*
- * @param $thumbName String: basename of thumbnail file -- however, we don't want to use the file exactly
+ * @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 ) {