/**
* Get the link parameters for MediaTransformOutput::toHtml() from given
* frame parameters supplied by the Parser.
- * @param $frameParams The frame parameters
- * @param $query An optional query string to add to description page links
+ * @param $frameParams array The frame parameters
+ * @param $query string An optional query string to add to description page links
+ * @return array
*/
private static function getImageLinkMTOParams( $frameParams, $query = '' ) {
$mtoParams = array();
* Called by Linker::formatComment.
*
* @param $comment String: comment text
- * @param $title An optional title object used to links to sections
+ * @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
*/
*
* @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 $title An optional title object used to links to sections
+ * @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
*/
* Generate a table of contents from a section tree
* Currently unused.
*
- * @param $tree Return value of ParserOutput::getSections()
+ * @param $tree array Return value of ParserOutput::getSections()
* @return String: HTML fragment
*/
public static function generateTOC( $tree ) {
* Format a size in bytes for output, using an appropriate
* unit (B, KB, MB or GB) according to the magnitude in question
*
- * @param $size Size to format
+ * @param $size int Size to format
* @return String
*/
public static function formatSize( $size ) {
* @param $prefix String: text before link text
* @param $aprops String: extra attributes to the a-element
* @param $style String: style to apply - if empty, use getInternalLinkAttributesObj instead
- * @return the a-element
+ * @return string the a-element
*/
static function makeKnownLinkObj(
$title, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = ''
interface LCStore {
/**
* Get a value.
- * @param $code Language code
- * @param $key Cache key
+ * @param $code string Language code
+ * @param $key string Cache key
*/
function get( $code, $key );
$this->unload( $code );
}
}
-}
\ No newline at end of file
+}
/**
* Get/set the ParserOptions object to use for wikitext parsing
*
- * @param $options either the ParserOption to use or null to only get the
+ * @param $options ParserOptions|null either the ParserOption to use or null to only get the
* current ParserOption object
* @return ParserOptions object
*/
* Add a "return to" link pointing to a specified title,
* or the title indicated in the request, or else the main page
*
- * @param $unused No longer used
+ * @param $unused
* @param $returnto Title or String to return to
* @param $returntoquery String: query string for the return to link
*/
}
/**
- * @param $unused Unused
+ * @param $unused
* @param $addContentType bool
*
* @return string HTML tag links to be put in the header.
* @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 Reference The variable to insert the value into.
+ * @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.
*/
* Make a <script> tag containing global variables
*
* @deprecated in 1.19
- * @param $unused Unused
+ * @param $unused
* @return string HTML fragment
*/
public static function makeGlobalVariablesScript( $unused ) {
* with action=render, $wgServer is prepended.
*
- * @param $query \twotypes{\string,\array} an optional query string,
+ * @param $query string|array 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.
/**
* Recursively normalizes UTF-8 strings in the given array.
*
- * @param $data string or array
- * @return cleaned-up version of the given
+ * @param $data string|array
+ * @return array|string cleaned-up version of the given
* @private
*/
function normalizeUnicode( $data ) {
* @param $dbw DatabaseBase
* @param $redirectTitle Title object pointing to the redirect target,
* or NULL if this is not a redirect
- * @param $lastRevIsRedirect If given, will optimize adding and
+ * @param $lastRevIsRedirect null|bool If given, will optimize adding and
* removing rows in redirect table.
* @return bool true on success, false on failure
* @private
}
/**
- * @param $section empty/null/false or a section number (0, 1, 2, T1, T2...)
+ * @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
* edit-already-exists error will be returned. These two conditions are also possible with
* auto-detection due to MediaWiki's performance-optimised locking strategy.
*
- * @param $baseRevId the revision ID this edit was based off, if any
+ * @param $baseRevId int the revision ID this edit was based off, if any
* @param $user User the user doing the edit
*
* @return Status object. Possible errors:
* Deletes the article with database consistency, writes logs, purges caches
*
* @param $reason string delete reason for deletion log
- * @param $suppress bitfield
+ * @param $suppress int bitfield
* Revision::DELETED_TEXT
* Revision::DELETED_COMMENT
* Revision::DELETED_USER
* Deletes the article with database consistency, writes logs, purges caches
*
* @param $reason string delete reason for deletion log
- * @param $suppress bitfield
+ * @param $suppress int bitfield
* Revision::DELETED_TEXT
* Revision::DELETED_COMMENT
* Revision::DELETED_USER
private $text;
/**
- * @var ParserOutput|false
+ * @var ParserOutput|bool
*/
private $parserOutput = false;
private $isDirty = false;
/**
- * @var Status|false
+ * @var Status|bool
*/
private $error = false;
/**
* Get a Status object in case of error or false otherwise
*
- * @return Status|false
+ * @return Status|bool
*/
public function getError() {
return $this->error;
/**
* Shortcut for creating fieldsets.
*
- * @param $legend Legend of the fieldset. If evaluates to false, legend is not added.
- * @param $content Pre-escaped content for the fieldset. If false, only open fieldset is returned.
+ * @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.
*
* @return string
* Find the location of the central directory, as would be seen by a
* ZIP64-compliant reader.
*
- * @return List containing offset, size and end position.
+ * @return array List containing offset, size and end position.
*/
function findZip64CentralDirectory() {
// The spec is ambiguous about the exact rules of precedence between the
* 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 The byte offset of the start of the block.
- * @param $length The number of bytes to return. If omitted, the remainder
+ * @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
* of the file will be returned.
*
* @return string
* Unpack a binary structure. This is like the built-in unpack() function
* except nicer.
*
- * @param $string The binary data input
+ * @param $string string The binary data input
*
- * @param $struct An associative array giving structure members and their
+ * @param $struct array 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 The offset into the string at which to start unpacking.
+ * @param $offset int The offset into the string at which to start unpacking.
*
- * @return Unpacked associative array. Note that large integers in the input
+ * @return array Unpacked associative array. Note that large integers in the input
* may be represented as floating point numbers in the return value, so
* the use of weak comparison is advised.
*/
* boolean.
*
* @param $value integer
- * @param $bitIndex The index of the bit, where 0 is the LSB.
+ * @param $bitIndex int The index of the bit, where 0 is the LSB.
+ * @return bool
*/
function testBit( $value, $bitIndex ) {
return (bool)( ( $value >> $bitIndex ) & 1 );
* Returns a sentence describing the log action. Usually
* a Message object is returned, but old style log types
* and entries might return pre-escaped html string.
- * @return Message|pre-escaped html
+ * @return Message|string pre-escaped html
*/
protected function getActionMessage() {
$message = $this->msg( $this->getMessageKey() );
* Convert a comma-delimited list of block log flags
* into a more readable (and translated) form
*
- * @param $flags Flags to format
+ * @param $flags string Flags to format
* @param $lang Language object to use
* @return String
*/
/** Main entry point for jpeg's.
*
* @param $filename string filename (with full path)
- * @return metadata result array.
+ * @return array metadata result array.
* @throws MWException on invalid file.
*/
static function Jpeg ( $filename ) {
* @private
*
* @param $num Mixed: the value to format
- * @param $round digits to round to or false.
+ * @param $round float|int digits to round to or false.
* @return mixed A floating point number or whatever we were fed
*/
static function formatNum( $num, $round = false ) {
return $a;
}
- /** Fetch the human readable version of a news code.
+ /**
+ * Fetch the human readable version of a news code.
* A news code is an 8 digit code. The first two
* digits are a general classification, so we just
* translate that.
* a string, not an int.
*
* @param $val String: The 8 digit news code.
- * @return The human readable form
+ * @return srting The human readable form
*/
static private function convertNewsCode( $val ) {
if ( !preg_match( '/^\d{8}$/D', $val ) ) {
* match the handler class, a Status object should be returned containing
* relevant errors.
*
- * @param $fileName The local path to the file.
+ * @param $fileName string The local path to the file.
* @return Status object
*/
function verifyUpload( $fileName ) {
* @param $height Integer: height (output only)
* @param $srcWidth Integer: width of the source image
* @param $srcHeight Integer: height of the source image
- * @param $mimeType Unused
+ * @param $mimeType
* @return bool to indicate that an error should be returned to the user.
*/
function validateThumbParams( &$width, &$height, $srcWidth, $srcHeight, $mimeType ) {
/**
* Helper function for jpegSegmentSplitter
* @param &$fh FileHandle for jpeg file
- * @return data content of segment.
+ * @return string data content of segment.
*/
private static function jpegExtractMarker( &$fh ) {
$size = wfUnpack( "nint", fread( $fh, 2 ), 2 );
- if ( $size['int'] <= 2 ) throw new MWException( "invalid marker size in jpeg" );
+ if ( $size['int'] <= 2 ) {
+ throw new MWException( "invalid marker size in jpeg" );
+ }
$segment = fread( $fh, $size['int'] - 2 );
- if ( strlen( $segment ) !== $size['int'] - 2 ) throw new MWException( "Segment shorter than expected" );
+ if ( strlen( $segment ) !== $size['int'] - 2 ) {
+ throw new MWException( "Segment shorter than expected" );
+ }
return $segment;
}
/**
* Delete all objects expiring before a certain date.
- * @param $date The reference date in MW format
- * @param $progressCallback Optional, a function which will be called
+ * @param $date string 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.
*
/**
* Accessor/mutator for the output type
*
- * @param $x New value or null to just get the current one
+ * @param $x int|null New value or null to just get the current one
* @return Integer
*/
function OutputType( $x = null ) {
/**
* Accessor/mutator for the ParserOptions object
*
- * @param $x New value or null to just get the current one
- * @return Current ParserOptions object
+ * @param $x ParserOptions New value or null to just get the current one
+ * @return ParserOptions Current ParserOptions object
*/
function Options( $x = null ) {
return wfSetVar( $this->mOptions, $x );
* element appropriate to the prefix character passed into them.
* @private
*
- * @param $char char
+ * @param $char string
*
* @return string
*/
* 'post-expand-template-inclusion' (corresponding messages:
* 'post-expand-template-inclusion-warning',
* 'post-expand-template-inclusion-category')
- * @param $current Current value
- * @param $max Maximum allowed, when an explicit limit has been
+ * @param $current int|null Current value
+ * @param $max int|null Maximum allowed, when an explicit limit has been
* exceeded, provide the values (optional)
*/
- function limitationWarn( $limitationType, $current=null, $max=null) {
+ function limitationWarn( $limitationType, $current = null, $max = null) {
# does no harm if $current and $max are present but are unnecessary for the message
$warning = wfMsgExt( "$limitationType-warning", array( 'parsemag', 'escape' ), $current, $max );
$this->mOutput->addWarning( $warning );
* 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
- * @return File|false
+ * @return File|bool
*/
function fetchFile( $title, $options = array() ) {
$res = $this->fetchFileAndTitle( $title, $options );
*
* @param $tag Mixed: the tag to use, e.g. 'hook' for <hook>
* @param $callback Mixed: the callback function (and object) to use for the tag
- * @return The old value of the mTagHooks array associated with the hook
+ * @return Mixed|null The old value of the mTagHooks array associated with the hook
*/
public function setHook( $tag, $callback ) {
$tag = strtolower( $tag );
- if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" );
+ if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
+ throw new MWException( "Invalid character {$m[0]} in setHook('$tag', ...) call" );
+ }
$oldVal = isset( $this->mTagHooks[$tag] ) ? $this->mTagHooks[$tag] : null;
$this->mTagHooks[$tag] = $callback;
if ( !in_array( $tag, $this->mStripList ) ) {
*
* @param $tag Mixed: the tag to use, e.g. 'hook' for <hook>
* @param $callback Mixed: the callback function (and object) to use for the tag
- * @return The old value of the mTagHooks array associated with the hook
+ * @return Mixed|null The old value of the mTagHooks array associated with the hook
*/
function setTransparentTagHook( $tag, $callback ) {
$tag = strtolower( $tag );
- if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) throw new MWException( "Invalid character {$m[0]} in setTransparentHook('$tag', ...) call" );
+ if ( preg_match( '/[<>\r\n]/', $tag, $m ) ) {
+ throw new MWException( "Invalid character {$m[0]} in setTransparentHook('$tag', ...) call" );
+ }
$oldVal = isset( $this->mTransparentTagHooks[$tag] ) ? $this->mTransparentTagHooks[$tag] : null;
$this->mTransparentTagHooks[$tag] = $callback;
* section does not exist, $oldtext is returned unchanged.
*
* @param $oldtext String: former text of the article
- * @param $section Numeric: section identifier
+ * @param $section int section identifier
* @param $text String: replacing text
* @return String: modified text
*/
/**
* Mutator for $mDefaultSort
*
- * @param $sort New value
+ * @param $sort string New value
*/
public function setDefaultSort( $sort ) {
$this->mDefaultSort = $sort;
*
* @param $text String: text string to be stripped of wikitext
* for use in a Section anchor
- * @return Filtered text string
+ * @return string Filtered text string
*/
public function stripSectionName( $text ) {
# Strip internal link markup
* If the $data array has been stored persistently, the caller should first
* check whether it is still valid, by calling isValidHalfParsedText().
*
- * @param $data Serialized data
+ * @param $data array Serialized data
* @return String
*/
function unserializeHalfParsedText( $data ) {
* @param $flags Integer: a combination of the following flags:
* SLH_PATTERN Use a regex link pattern rather than a namespace
*
- * @return The old callback function for this name, if any
+ * @return callback|null The old callback function for this name, if any
*/
public function setLinkHook( $ns, $callback, $flags = 0 ) {
if( $flags & SLH_PATTERN && !is_string($ns) )
*
* @param $text String: HTML to check
* @param $stderr Boolean: Whether to read result from STDERR rather than STDOUT
- * @param &$retval Exit code (-1 on internal error)
+ * @param &$retval int Exit code (-1 on internal error)
* @return mixed String or null
*/
private static function execExternalTidy( $text, $stderr = false, &$retval = null ) {
*
* @param $text String: HTML to check
* @param $stderr Boolean: Whether to read result from error status instead of output
- * @param &$retval Exit code (-1 on internal error)
+ * @param &$retval int Exit code (-1 on internal error)
* @return mixed String or null
*/
private static function execInternalTidy( $text, $stderr = false, &$retval = null ) {
/**
* Recursive function the format the current profiling array into a tree
*
- * @param $stack profiling array
+ * @param $stack array profiling array
*/
function remapCallTree( $stack ) {
if( count( $stack ) < 2 ){
* 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 Module info array. For backwards compatibility with 1.17alpha,
+ * @param $info array 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
* Returns JS code to call to mw.loader.implement for a module with
* given properties.
*
- * @param $name Module name
+ * @param $name string Module name
* @param $scripts Mixed: List of URLs to JavaScript files or String of JavaScript code
* @param $styles Mixed: List of CSS strings keyed by media type, or list of lists of URLs to
* CSS files keyed by media type
}
/**
- * @return Double|null if not supported
+ * @return float|null if not supported
*/
function getScore() {
return null;
/**
* Get the base part of the search query.
*
- * @param &$query Search query array
+ * @param &$query array Search query array
* @param $filteredTerm String
* @param $fulltext Boolean
* @since 1.18 (changed)
/**
* Show the special page
*
- * @param $isbn ISBN passed as a subpage parameter
+ * @param $isbn string 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 ISBN passed for check
+ * @param isbn string ISBN passed for check
*/
public static function isValidISBN( $isbn ) {
$isbn = self::cleanIsbn( $isbn );
/**
* Trim ISBN and remove characters which aren't required
*
- * @param $isbn Unclean ISBN
+ * @param $isbn string Unclean ISBN
* @return string
*/
private static function cleanIsbn( $isbn ) {
/**
* Format a book source list item
*
- * @param $label Book source label
- * @param $url Book source URL
+ * @param $label string Book source label
+ * @param $url string 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 Confirmation code
+ * @param $code string 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 Confirmation code
+ * @param $code string Confirmation code
*/
function attemptInvalidate( $code ) {
$user = User::newFromConfirmationCode( $code );
* Build a set of links for convenient navigation
* between watchlist viewing and editing modes
*
- * @param $unused Unused
+ * @param $unused
* @return string
*/
public static function buildTools( $unused ) {
*
* @param $rev Revision
* @param $titleObj Title
- * @param $ts Timestamp
+ * @param $ts string Timestamp
* @return string
*/
function getPageLink( $rev, $titleObj, $ts ) {
*
* @param $file File
* @param $titleObj Title
- * @param $ts A timestamp
+ * @param $ts string A timestamp
* @param $key String: a storage key
*
* @return String: HTML fragment
/**
* @param $srcPath String: the source path
- * @return the real path if it was a virtual URL
+ * @return stringthe real path if it was a virtual URL
*/
function getRealPath( $srcPath ) {
$repo = RepoGroup::singleton()->getLocalRepo();
/**
* Returns the virtual chunk location:
- * @param unknown_type $index
+ * @param $index
*/
function getVirtualChunkLocation( $index ){
return $this->repo->getVirtualUrl( 'temp' ) .
) .
$this->getChunkFileKey( $index );
}
+
/**
* Add a chunk to the temporary directory
*
- * @param $chunkPath path to temporary chunk file
- * @param $chunkSize size of the current chunk
- * @param $offset offset of current chunk ( mutch match database chunk offset )
+ * @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 )
* @return Status
*/
public function addChunk( $chunkPath, $chunkSize, $offset ) {
/**
* Remove a temporarily kept file stashed by saveTempUploadedFile().
- * @return success
+ * @return bool success
*/
public function unsaveUploadedFile() {
return $this->stash->removeFile( $this->mFileKey );