* Update user information in the external authentication database.
* Return true if successful.
*
- * @param $user User object.
- * @return Boolean
+ * @param User $user User object.
+ * @return bool
*/
public function updateExternalDB( $user ) {
return true;
* Sanitizer that have define()s outside of their class definition. Of course
* this wouldn't be necessary if everything in MediaWiki was class-based. Sigh.
*
- * @param $class string
- * @return Boolean Return the results of class_exists() so we know if we were successful
+ * @param string $class
+ * @return bool Return the results of class_exists() so we know if we were successful
*/
static function loadClass( $class ) {
return class_exists( $class );
/**
* Get the groups for the given user based on $wgAutopromote.
*
- * @param $user User The user to get the groups for
+ * @param User $user The user to get the groups for
* @return array Array of groups to promote to.
*/
public static function getAutopromoteGroups( User $user ) {
*
* Does not return groups the user already belongs to or has once belonged.
*
- * @param $user User The user to get the groups for
- * @param string $event key in $wgAutopromoteOnce (each one has groups/criteria)
+ * @param User $user The user to get the groups for
+ * @param string $event Key in $wgAutopromoteOnce (each one has groups/criteria)
*
* @return array Groups the user should be promoted to.
*
* This function evaluates the former type recursively, and passes off to
* self::checkCondition for evaluation of the latter type.
*
- * @param $cond Mixed: a condition, possibly containing other conditions
- * @param $user User The user to check the conditions against
+ * @param mixed $cond A condition, possibly containing other conditions
+ * @param User $user The user to check the conditions against
* @return bool Whether the condition is true
*/
private static function recCheckCondition( $cond, User $user ) {
* APCOND_AGE. Other types will throw an exception if no extension evaluates them.
*
* @param array $cond A condition, which must not contain other conditions
- * @param $user User The user to check the condition against
+ * @param User $user The user to check the condition against
* @throws MWException
* @return bool Whether the condition is true for the user
*/
/**
* Factory function.
*
- * @param $title Title for the category page
- * @return Category|bool on a totally invalid name
+ * @param Title $title Title for the category page
+ * @return Category|bool On a totally invalid name
*/
public static function newFromTitle( $title ) {
$cat = new self();
/**
* Factory function.
*
- * @param $id Integer: a category id
+ * @param int $id A category id
* @return Category
*/
public static function newFromID( $id ) {
/**
* Factory function, for constructing a Category object from a result set
*
- * @param $row Result set row, must contain the cat_xxx fields. If the
+ * @param object $row Result set row, must contain the cat_xxx fields. If the
* fields are null, the resulting Category object will represent an empty
* category if a title object was given. If the fields are null and no
* title was given, this method fails and returns false.
- * @param Title $title optional title object for the category represented by
+ * @param Title $title Optional title object for the category represented by
* the given row. May be provided if it is already known, to avoid having
* to re-create a title object later.
* @return Category
/**
* Fetch a TitleArray of up to $limit category members, beginning after the
* category sort key $offset.
- * @param $limit integer
- * @param $offset string
- * @return TitleArray object for category members.
+ * @param int $limit
+ * @param string $offset
+ * @return TitleArray TitleArray object for category members.
*/
public function getMembers( $limit = false, $offset = '' ) {
wfProfileIn( __METHOD__ );
/**
* Initializes the instance. Do this prior to calling run().
- * @param $article_ids Array of article IDs
- * @param $categories FIXME
+ * @param array $article_ids Array of article IDs
+ * @param array $categories FIXME
* @param string $mode FIXME, default 'AND'.
* @todo FIXME: $categories/$mode
*/
* This functions recurses through the parent representation, trying to match the conditions
* @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
+ * @param array $path Used to check for recursion loops
* @return bool Does this match the conditions?
*/
function check( $id, &$conds, $path = array() ) {
*
* @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
+ * @return string Short description of the tag from "mediawiki:tag-$tag" if this message exists,
+ * html-escaped version of $tag otherwise
*/
public static function tagDescription( $tag ) {
$msg = wfMessage( "tag-$tag" );
* Add tags to a change given its rc_id, rev_id and/or log_id
*
* @param string|array $tags Tags to add to the change
- * @param $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 int $rc_id rc_id of the change to add the tags to
+ * @param int $rev_id rev_id of the change to add the tags to
+ * @param int $log_id Log_id of the change to add the tags to
* @param string $params params to put in the ct_params field of table 'change_tag'
*
* @throws MWException
- * @return bool: false if no changes are made, otherwise true
+ * @return bool false if no changes are made, otherwise true
*
* @exception MWException when $rc_id, $rev_id and $log_id are all null
*/
*
* @param string|array $tables Table 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 array $options options, see Database::select
+ * @param string|array $conds Conditions used in query, see DatabaseBase::select
+ * @param array $join_conds Join conditions, see DatabaseBase::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 string $selected tag to select by default
- * @param $fullForm Boolean:
+ * @param bool $fullForm
* - if false, then it returns an array of (label, form).
* - if true, it returns an entire form around the selector.
- * @param $title Title object to send the form to.
+ * @param Title $title Title object to send the form to.
* Used when, and only when $fullForm is true.
- * @return String or array:
+ * @return string|array
* - if $fullForm is false: Array with
* - if $fullForm is true: String, html fragment
*/
*
* Tries memcached first.
*
- * @return Array of strings: tags
+ * @return array Array of strings: tags
*/
public static function listDefinedTags() {
// Caching...
/**
* Constructor
*
- * @param string $format feed's format (either 'rss' or 'atom')
- * @param string $type 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 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
+ * @param string $title Feed's title
+ * @param string $description Feed's description
+ * @param string $url Url of origin page
+ * @return ChannelFeed|bool ChannelFeed subclass or false on failure
*/
public function getFeedObject( $title, $description, $url ) {
global $wgSitename, $wgLanguageCode, $wgFeedClasses;
/**
* Save to feed result to $messageMemc
*
- * @param string $feed feed's content
- * @param string $timekey memcached key of the last modification
- * @param string $key 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 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
+ * @param int $lastmod Timestamp of the last item in the recentchanges table
+ * @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 ) {
global $wgFeedCacheTimeout, $wgOut, $messageMemc;
/**
* Generate the feed items given a row from the database, printing the feed.
- * @param $rows DatabaseBase resource with recentchanges rows
- * @param $feed Feed object
+ * @param object $rows DatabaseBase resource with recentchanges rows
+ * @param Feed $feed
*/
public static function generateFeed( $rows, &$feed ) {
wfProfileIn( __METHOD__ );
/**
* Generate the feed items given a row from the database.
- * @param $rows DatabaseBase resource with recentchanges rows
+ * @param object $rows DatabaseBase resource with recentchanges rows
*/
public static function buildItems( $rows ) {
wfProfileIn( __METHOD__ );
* cookies. Used internally after a request to parse the
* Set-Cookie headers.
*
- * @param string $value the value of the cookie
- * @param array $attr 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 2-letter top-level domains for single-domain use (probably
* not a big problem in practice, but there are test cases)
*
- * @param string $domain the domain to validate
+ * @param string $domain The domain to validate
* @param string $originDomain (optional) the domain the cookie originates from
- * @return Boolean
+ * @return bool
*/
public static function validateCookieDomain( $domain, $originDomain = null ) {
// Don't allow a trailing dot
/**
* Serialize the cookie jar into a format useful for HTTP Request headers.
*
- * @param string $path the path that will be used. Required.
- * @param string $domain the domain that will be used. Required.
- * @return String
+ * @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 ) {
$ret = '';
}
/**
- * @param $domain
+ * @param string $domain
* @return bool
*/
protected function canServeDomain( $domain ) {
}
/**
- * @param $path
+ * @param string $path
* @return bool
*/
protected function canServePath( $path ) {
/**
* Set a cookie in the cookie jar. Make sure only one cookie per-name exists.
* @see Cookie::set()
+ * @param string $name
+ * @param string $value
+ * @param array $attr
*/
public function setCookie( $name, $value, $attr ) {
/* cookies: case insensitive, so this should work.
/**
* @see Cookie::serializeToHttpRequest
+ * @param string $path
+ * @param string $domain
* @return string
*/
public function serializeToHttpRequest( $path, $domain ) {
/**
* Parse the content of an Set-Cookie HTTP Response header.
*
- * @param $cookie String
- * @param string $domain cookie's domain
+ * @param string $cookie
+ * @param string $domain Cookie's domain
* @return null
*/
public function parseCookieResponseHeader( $cookie, $domain ) {
* If the feed should be purged; $timekey and $key will be removed from
* $messageMemc
*
- * @param string $timekey cache key of the timestamp of the last item
- * @param string $key 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 string $type feed type, as requested by the user
- * @return Boolean
+ * @return bool
*/
public static function checkFeedOutput( $type ) {
global $wgOut, $wgFeed, $wgFeedClasses;
/**
* Format a diff for the newsfeed
*
- * @param $row Object: row from the recentchanges table
- * @return String
+ * @param object $row Row from the recentchanges table
+ * @return string
*/
public static function formatDiff( $row ) {
$titleObj = Title::makeTitle( $row->rc_namespace, $row->rc_title );
/**
* Really format a diff for the newsfeed
*
- * @param $title Title object
- * @param $oldid Integer: old revision's id
- * @param $newid Integer: new revision's id
- * @param $timestamp Integer: new revision's timestamp
- * @param string $comment new revision's comment
- * @param string $actiontext text of the action; in case of log event
- * @return String
+ * @param Title $title Title object
+ * @param int $oldid Old revision's id
+ * @param int $newid New revision's id
+ * @param int $timestamp New revision's timestamp
+ * @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 = '' ) {
global $wgFeedDiffCutoff, $wgLang;
* Generates a diff link. Used when the full diff is not wanted for example
* when $wgFeedDiffCutoff is 0.
*
- * @param $title Title object: used to generate the diff URL
- * @param $newid Integer newid for this diff
- * @param $oldid Integer|null oldid for the diff. Null means it is a new article
+ * @param Title $title Title object: used to generate the diff URL
+ * @param int $newid Newid for this diff
+ * @param int|null $oldid Oldid for the diff. Null means it is a new article
* @return string
*/
protected static function getDiffLink( Title $title, $newid, $oldid = null ) {
* Might be 'cleaner' to use DOM or XSLT or something,
* but *gack* it's a pain in the ass.
*
- * @param string $text diff's HTML output
- * @return String: modified HTML
+ * @param string $text Diff's HTML output
+ * @return string Modified HTML
*/
public static function applyDiffStyle( $text ) {
$styles = array(
* showing an appropriate message depending upon whether
* it's a current file or an old version
*
- * @param string $message message base
- * @return String
+ * @param string $message Message base
+ * @return string
*/
private function prepareMessage( $message ) {
global $wgLang;
/**
* Is the provided `oldimage` value valid?
*
+ * @param string $oldimage
* @return bool
*/
public static function isValidOldSpec( $oldimage ) {
* value was provided, does it correspond to an
* existing, local, old version of this file?
*
- * @param $file File
- * @param $oldfile File
- * @param $oldimage File
+ * @param File $file
+ * @param File $oldfile
+ * @param File $oldimage
* @return bool
*/
public static function haveDeletableFile( &$file, &$oldfile, $oldimage ) {
* Get a fully-qualified path for a source file relative to $IP.
* @deprecated since 1.22
*
- * @param $file string
+ * @param string $file
*
* @return string
*/
/**
* @deprecated since 1.22
- * @param $file string
+ * @param string $file
* @return string
*/
static function compiledPath( $file ) {
/**
* @deprecated since 1.22
- * @param $file string
+ * @param string $file
* @return string
*/
static function extCompiledPath( $file ) {
* Deprecated wrapper for class_exists()
* @deprecated since 1.22
*
- * @param $class string
+ * @param string $class
*
* @return bool
*/
* Deprecated wrapper for method_exists()
* @deprecated since 1.22
*
- * @param $class string
- * @param $method string
+ * @param string $class
+ * @param string $method
*
* @return bool
*/
* Deprecated wrapper for function_exists()
* @deprecated since 1.22
*
- * @param $function string
+ * @param string $function
*
* @return bool
*/
* Deprecated wrapper for call_user_func_array()
* @deprecated since 1.22
*
- * @param $className string
- * @param $methodName string
- * @param $args array
+ * @param string $className
+ * @param string $methodName
+ * @param array $args
*
* @return mixed
*/
/**
* Constructor
*
- * @param $params array
+ * @param array $params
*/
public function __construct( $params ) {
parent::__construct( $params );
}
/**
- * @param $str
+ * @param string $str
* @return array
*/
protected function trimStars( $str ) {
}
/**
- * @param $list
- * @param $path
- * @param $item
+ * @param array $list
+ * @param array $path
+ * @param mixed $item
*/
protected function stackItem( &$list, $path, $item ) {
$position =& $list;
}
/**
- * @param $tagset
- * @param $depth int
+ * @param array $tagset
+ * @param int $depth
*/
protected function makeHtml( $tagset, $depth = 0 ) {
foreach ( $tagset as $key => $val ) {
}
/**
- * @param $message
- * @param $value
- * @param $attribs null
- * @param $depth int
+ * @param string $message
+ * @param string $value
+ * @param null|array $attribs
+ * @param int $depth
* @return string
*/
protected function outputOption( $message, $value, $attribs = null, $depth = 0 ) {
/**
* Accessor for $this->html
*
- * @param $value bool
+ * @param bool $value
*
* @return string
*/
/**
* Check whether $content contains a link to $filterEntry
*
- * @param $content Content: content to check
- * @param string $filterEntry domainparts, see makeRegex() for more details
- * @return Integer: 0 if no match or 1 if there's at least one match
+ * @param Content $content Content to check
+ * @param string $filterEntry Domainparts, see makeRegex() for more details
+ * @return int 0 if no match or 1 if there's at least one match
*/
static function matchEntry( Content $content, $filterEntry ) {
if ( !( $content instanceof TextContent ) ) {
*
* @param string $filterEntry URL, if it begins with "*.", it'll be
* replaced to match any subdomain
- * @return String: regex pattern, for preg_match()
+ * @return string Regex pattern, for preg_match()
*/
private static function makeRegex( $filterEntry ) {
$regex = '!http://';
* This function does the same as wfMakeUrlIndexes(), except it also takes care
* of adding wildcards
*
- * @param String $filterEntry domainparts
- * @param String $protocol protocol (default http://)
- * @return Array to be passed to DatabaseBase::buildLike() or false on error
+ * @param string $filterEntry Domainparts
+ * @param string $protocol Protocol (default http://)
+ * @return array Array to be passed to DatabaseBase::buildLike() or false on error
*/
public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) {
$db = wfGetDB( DB_MASTER );
* Filters an array returned by makeLikeArray(), removing everything past first
* pattern placeholder.
*
- * @param array $arr array to filter
- * @return array filtered array
+ * @param array $arr Array to filter
+ * @return array Filtered array
*/
public static function keepOneWildcard( $arr ) {
if ( !is_array( $arr ) ) {
* Set the timezone of this timestamp to the specified timezone.
*
* @since 1.22
- * @param String $timezone Timezone to set
+ * @param string $timezone Timezone to set
* @throws TimestampException
*/
public function setTimezone( $timezone ) {
/**
* Get the message blobs for a set of modules
*
- * @param $resourceLoader ResourceLoader object
+ * @param ResourceLoader $resourceLoader
* @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
* present, it is not regenerated; instead, the preexisting blob
* is fetched and returned.
*
- * @param string $name module name
- * @param $module ResourceLoaderModule object
- * @param string $lang language code
+ * @param string $name Module name
+ * @param ResourceLoaderModule $module
+ * @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 string $name module name
- * @param $module ResourceLoaderModule object
- * @param string $lang language code
- * @return String Regenerated message blob, or null if there was no blob for the given module/language pair
+ * @param string $name Module name
+ * @param ResourceLoaderModule $module
+ * @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 ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Update a single message in all message blobs it occurs in.
*
- * @param string $key message key
+ * @param string $key Message key
*/
public static function updateMessage( $key ) {
try {
/**
* Create an update queue for updateMessage()
*
- * @param string $key message key
- * @param array $prevUpdates updates queue to refresh or null to build a fresh update queue
- * @return Array: updates 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 ) {
$dbw = wfGetDB( DB_MASTER );
/**
* Reencode a message blob with the updated value for a message
*
- * @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
+ * @param string $blob Message blob (JSON object)
+ * @param string $key Message key
+ * @param string $lang Language code
+ * @return string Message blob with $key replaced with its new value
*/
private static function reencodeBlob( $blob, $key, $lang ) {
$decoded = FormatJson::decode( $blob, true );
* Get the message blobs for a set of modules from the database.
* Modules whose blobs are not in the database are silently dropped.
*
- * @param $resourceLoader ResourceLoader object
- * @param array $modules of module names
- * @param string $lang language code
+ * @param ResourceLoader $resourceLoader
+ * @param array $modules Array 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 string $lang language code
- * @return String: JSON object
+ * @param ResourceLoaderModule $module
+ * @param string $lang Language code
+ * @return string JSON object
*/
private static function generateMessageBlob( ResourceLoaderModule $module, $lang ) {
$messages = array();
* separated string or null if the mime type was unrecognized. Resolves
* mime type aliases.
*
- * @param $mime string
+ * @param string $mime
* @return string|null
*/
public function getExtensionsForType( $mime ) {
* Returns a list of mime types for a given file extension as a space
* separated string or null if the extension was unrecognized.
*
- * @param $ext string
+ * @param string $ext
* @return string|null
*/
public function getTypesForExtension( $ext ) {
* Returns a single mime type for a given file extension or null if unknown.
* This is always the first type from the list returned by getTypesForExtension($ext).
*
- * @param $ext string
+ * @param string $ext
* @return string|null
*/
public function guessTypesForExtension( $ext ) {
* match was found, null if the mime type is unknown, and false if the
* mime type is known but no matches where found.
*
- * @param $extension string
- * @param $mime string
+ * @param string $extension
+ * @param string $mime
* @return bool|null
*/
public function isMatchingExtension( $extension, $mime ) {
* Returns true if the mime type is known to represent an image format
* supported by the PHP GD library.
*
- * @param $mime string
+ * @param string $mime
*
* @return bool
*/
*
* @todo Be more accurate when using fancy mime detector plugins;
* right now this is the bare minimum getimagesize() list.
+ * @param string $extension
* @return bool
*/
function isRecognizableExtension( $extension ) {
* If $mime is "application/x-opc+zip" and isMatchingExtension( $ext, $mime )
* gives true, return the result of guessTypesForExtension($ext).
*
- * @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
+ * @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
+ * @return string The mime type
*/
public function improveTypeFromExtension( $mime, $ext ) {
if ( $mime === 'unknown/unknown' ) {
* detection (namely XML based formats like XHTML or SVG, as well as ZIP
* based formats like OPC/ODF files).
*
- * @param string $file the file to check
+ * @param string $file The file to check
* @param string|bool $ext The file extension, or true (default) to extract it from the filename.
* Set it to false to ignore the extension. DEPRECATED! Set to false, use
* improveTypeFromExtension($mime, $ext) later to improve mime type.
*
- * @return string the mime type of $file
+ * @return string The mime type of $file
*/
public function guessMimeType( $file, $ext = true ) {
if ( $ext ) { // TODO: make $ext default to false. Or better, remove it.
* Set it to false to ignore the extension. DEPRECATED! Set to false, use
* improveTypeFromExtension($mime, $ext) later to improve mime type.
*
- * @return string the mime type of $file
+ * @return string The mime type of $file
*/
private function detectMimeType( $file, $ext = true ) {
global $wgMimeDetectorCommand;
* @todo analyse file if need be
* @todo look at multiple extension, separately and together.
*
- * @param string $path 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 string $mime 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.
+ * @return string A value to be used with the MEDIATYPE_xxx constants.
*/
function getMediaType( $path = null, $mime = null ) {
if ( !$mime && !$path ) {
*
* This function relies on the mapping defined by $this->mMediaTypes
* @access private
+ * @param string $extMime
* @return int|string
*/
function findMediaType( $extMime ) {
* Get the MIME types that various versions of Internet Explorer would
* detect from a chunk of the content.
*
- * @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
+ * @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 ) {
$ca = $this->getIEContentAnalyzer();
* Special namespaces are defined in includes/Defines.php and have
* a value below 0 (ex: NS_SPECIAL = -1 , NS_MEDIA = -2)
*
- * @param $index
- * @param $method
+ * @param int $index
+ * @param string $method
*
* @throws MWException
* @return bool
/**
* Can pages in the given namespace be moved?
*
- * @param int $index 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 int $index namespace index
+ * @param int $index Namespace index
* @return bool
* @since 1.19
*/
/**
* Is the given namespace a talk namespace?
*
- * @param int $index namespace index
+ * @param int $index Namespace index
* @return bool
*/
public static function isTalk( $index ) {
/**
* Get the talk namespace index for a given namespace
*
- * @param int $index namespace index
+ * @param int $index Namespace index
* @return int
*/
public static function getTalk( $index ) {
* For talk namespaces, returns the subject (non-talk) namespace
* For subject (non-talk) namespaces, returns the talk namespace
*
- * @param int $index namespace index
- * @return int or null if no associated namespace could be found
+ * @param int $index Namespace index
+ * @return int|null If no associated namespace could be found
*/
public static function getAssociated( $index ) {
self::isMethodValidFor( $index, __METHOD__ );
/**
* Returns whether the specified namespace exists
*
- * @param $index
+ * @param int $index
*
* @return bool
* @since 1.19
* Returns array of all defined namespaces with their canonical
* (English) names.
*
- * @param bool $rebuild rebuild namespace list (default = false). Used for testing.
+ * @param bool $rebuild Rebuild namespace list (default = false). Used for testing.
*
* @return array
* @since 1.17
/**
* Returns the canonical (English) name for a given index
*
- * @param int $index namespace index
- * @return string or false if no canonical definition.
+ * @param int $index Namespace index
+ * @return string|false If no canonical definition.
*/
public static function getCanonicalName( $index ) {
$nslist = self::getCanonicalNamespaces();
* Returns the index for a given canonical name, or NULL
* The input *must* be converted to lower case first
*
- * @param string $name namespace name
+ * @param string $name Namespace name
* @return int
*/
public static function getCanonicalIndex( $name ) {
/**
* Can this namespace ever have a talk namespace?
*
- * @param int $index 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 int $index index to check
+ * @param int $index Index to check
* @return bool
*/
public static function isContent( $index ) {
/**
* Can pages in a namespace be watched?
*
- * @param $index Int
+ * @param int $index
* @return bool
*/
public static function isWatchable( $index ) {
/**
* Get a list of all namespace indices which are considered to contain content
- * @return array of namespace indices
+ * @return array Array of namespace indices
*/
public static function getContentNamespaces() {
global $wgContentNamespaces;
* List all namespace indices which are considered subject, aka not a talk
* or special namespace. See also MWNamespace::isSubject
*
- * @return array of namespace indices
+ * @return array Array of namespace indices
*/
public static function getSubjectNamespaces() {
return array_filter(
* List all namespace indices which are considered talks, aka not a subject
* or special namespace. See also MWNamespace::isTalk
*
- * @return array of namespace indices
+ * @return array Array of namespace indices
*/
public static function getTalkNamespaces() {
return array_filter(
*
* @since 1.21
* @param int $index Index to check
- * @return null|string default model name for the given namespace, if set
+ * @return null|string Default model name for the given namespace, if set
*/
public static function getNamespaceContentModel( $index ) {
global $wgNamespaceContentModels;
/**
* Standard output handler for use with ob_start
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
* Handler that compresses data with gzip if allowed by the Accept header.
* Unlike ob_gzhandler, it works for HEAD requests too.
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
/**
* Mangle flash policy tags which open up the site to XSS attacks.
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
/**
* Add a Content-Length header if possible. This makes it cooperate with squid better.
*
- * @param $length int
+ * @param int $length
*/
function wfDoContentLength( $length ) {
if ( !headers_sent() && isset( $_SERVER['SERVER_PROTOCOL'] ) && $_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.0' ) {
/**
* Replace the output with an error if the HTML is not valid
*
- * @param $s string
+ * @param string $s
*
* @return string
*/
* like page existence and information for stub color and redirect hints.
* This should be done for live data and cached data.
*
- * @param $db DatabaseBase connection
+ * @param DatabaseBase $db
* @param ResultWrapper $res
*/
public function preprocessResults( $db, $res ) {
/**
* Get the expiry time for a given action, by combining the relevant inputs.
*
- * @param $action string
+ * @param string $action
*
* @return string 14-char timestamp or "infinity", or false if the input was invalid
*/
/**
* Show the input form with optional error message
*
- * @param string $err 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;
/**
* Save submitted protection form
*
- * @return Boolean: success
+ * @return bool Success
*/
function save() {
global $wgRequest, $wgUser, $wgOut;
/**
* Build the input form
*
- * @return String: HTML form
+ * @return string HTML form
*/
function buildForm() {
global $wgUser, $wgLang, $wgOut;
/**
* Build protection level selector
*
- * @param string $action action to protect
- * @param string $selected current protection level
- * @return String: HTML fragment
+ * @param string $action Action to protect
+ * @param string $selected Current protection level
+ * @return string HTML fragment
*/
function buildSelector( $action, $selected ) {
global $wgUser;
/**
* Prepare the label for a protection selector option
*
- * @param string $permission permission required
- * @return String
+ * @param string $permission Permission required
+ * @return string
*/
private function getOptionLabel( $permission ) {
if ( $permission == '' ) {
/**
* Show protection long extracts for this page
*
- * @param $out OutputPage
+ * @param OutputPage $out
* @access private
*/
function showLogExtract( &$out ) {
/**
* Get a DB connection to be used for slow recache queries
+ * @return DatabaseBase
*/
function getRecacheDB() {
return wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) );
}
/**
- * @param $offset
+ * @param int $offset
* @return string
*/
function openList( $offset ) {
/**
* Construct a revision list for a given title
- * @param $context IContextSource
- * @param $title Title
+ * @param IContextSource $context
+ * @param Title $title
*/
function __construct( IContextSource $context, Title $title ) {
$this->setContext( $context );
/**
* Select items only where the ID is any of the specified values
- * @param $ids Array
+ * @param array $ids
*/
function filterByIds( array $ids ) {
$this->ids = $ids;
/**
* Start iteration. This must be called before current() or next().
- * @return First list item
+ * @return Revision First list item
*/
public function reset() {
if ( !$this->res ) {
/**
* Get the current list item, or false if we are at the end
+ * @return Revision
*/
public function current() {
return $this->current;
/**
* Move the iteration pointer to the next list item, and return it.
+ * @return Revision
*/
public function next() {
$this->res->next();
/**
* Do the DB query to iterate through the objects.
- * @param $db DatabaseBase object to use for the query
+ * @param DatabaseBase $db DatabaseBase object to use for the query
*/
abstract public function doQuery( $db );
/**
* Create an item object from a DB result row
- * @param $row stdclass
+ * @param object $row
*/
abstract public function newItem( $row );
}
var $row;
/**
- * @param $list RevisionListBase
- * @param $row DB result row
+ * @param RevisionListBase $list
+ * @param object $row DB result row
*/
public function __construct( $list, $row ) {
$this->list = $list;
/**
* Get the ID, as it would appear in the ids URL parameter
- * @return
+ * @return int
*/
public function getId() {
$field = $this->getIdField();
/**
* Get the date, formatted in user's language
- * @return String
+ * @return string
*/
public function formatDate() {
return $this->list->getLanguage()->userDate( $this->getTimestamp(),
/**
* Get the time, formatted in user's language
- * @return String
+ * @return string
*/
public function formatTime() {
return $this->list->getLanguage()->userTime( $this->getTimestamp(),
/**
* Get the timestamp in MW 14-char form
- * @return Mixed
+ * @return mixed
*/
public function getTimestamp() {
$field = $this->getTimestampField();
}
/**
- * @param $db DatabaseBase
+ * @param DatabaseBase $db
* @return mixed
*/
public function doQuery( $db ) {
* HTML5 definition of id attribute
*
* @param string $id id to escape
- * @param $options Mixed: string or array of strings (default is array()):
+ * @param string|array $options String or array of strings (default is array()):
* 'noninitial': This is a non-initial fragment of an id, not a full id,
* so don't pay attention if the first character isn't valid at the
* beginning of an id. Only matters if $wgExperimentalHtmlIds is
* This allows (generally harmless) entities like   to survive.
*
* @param string $html HTML to escape
- * @return string: escaped input
+ * @return string Escaped input
*/
static function escapeHtmlAllowEntities( $html ) {
$html = Sanitizer::decodeCharReferences( $html );
var $bodyRemaining;
/**
- * @param $server string
- * @param $options array
+ * @param string $server
+ * @param array $options
*/
public function __construct( $server, $options = array() ) {
$parts = explode( ':', $server, 2 );
/**
* Get the host's IP address.
* Does not support IPv6 at present due to the lack of a convenient interface in PHP.
+ * @return string
*/
protected function getIP() {
if ( $this->ip === null ) {
/**
* Queue a purge operation
*
- * @param $url string
+ * @param string $url
*/
public function queuePurge( $url ) {
global $wgSquidPurgeUseHostHeader;
}
/**
- * @param $line
+ * @param string $line
* @return
*/
protected function processStatusLine( $line ) {
}
/**
- * @param $line string
+ * @param string $line
*/
protected function processHeaderLine( $line ) {
if ( preg_match( '/^Content-Length: (\d+)$/i', $line, $m ) ) {
}
/**
- * @param $msg string
+ * @param string $msg
*/
protected function log( $msg ) {
wfDebugLog( 'squid', __CLASS__ . " ($this->host): $msg" );
var $timeout = 5;
/**
- * @param $options array
+ * @param array $options
*/
function __construct( $options = array() ) {
if ( isset( $options['timeout'] ) ) {
}
/**
- * @param $client SquidPurgeClient
+ * @param SquidPurgeClient $client
* @return void
*/
public function addClient( $client ) {
* @ingroup StatCounter
*/
class StatCounter {
- /** @var Array */
+ /** @var array */
protected $deltas = array(); // (key => count)
protected function __construct() {}
* Increment a key by delta $count
*
* @param string $key
- * @param integer $count
+ * @param int $count
* @return void
*/
public function incr( $key, $count = 1 ) {
/**
* Constructor.
*
- * @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 constructor of the real
- * object.
+ * @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 constructor of the real object.
*/
function __construct( $global = null, $class = null, $params = array() ) {
$this->mGlobal = $global;
* Returns a bool value whenever $obj is a stub object. Can be used to break
* a infinite loop when unstubbing an object.
*
- * @param $obj Object to check.
- * @return Boolean: true if $obj is not an instance of StubObject class.
+ * @param object $obj Object to check.
+ * @return bool True if $obj is not an instance of StubObject class.
*/
static function isRealObject( $obj ) {
return is_object( $obj ) && !$obj instanceof StubObject;
* infinite loop when unstubbing an object or to avoid reference parameter
* breakage.
*
- * @param $obj Object to check.
+ * @param object $obj Object to check.
* @return void
*/
static function unstub( $obj ) {
* This function will also call the function with the same name in the real
* object.
*
- * @param string $name name of the function called
- * @param array $args 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 string $name name of the function called
- * @param array $args 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 string $name name of the method called in this object.
- * @param $level Integer: level to go in the stack trace to get the function
- * who called this function.
+ * @param string $name Name of the method called in this object.
+ * @param int $level Level to go in the stack trace to get the function
+ * who called this function.
* @throws MWException
*/
function _unstub( $name = '_unstub', $level = 2 ) {
/**
* Create a WatchedItem object with the given user and title
* @since 1.22 $checkRights parameter added
- * @param $user User: the user to use for (un)watching
- * @param $title Title: the title we're going to (un)watch
- * @param $checkRights int: Whether to check the 'viewmywatchlist' and 'editmywatchlist' rights.
+ * @param User $user The user to use for (un)watching
+ * @param Title $title The title we're going to (un)watch
+ * @param int $checkRights Whether to check the 'viewmywatchlist' and 'editmywatchlist' rights.
* Pass either WatchedItem::IGNORE_USER_RIGHTS or WatchedItem::CHECK_USER_RIGHTS.
- * @return WatchedItem object
+ * @return WatchedItem
*/
public static function fromUserTitle( $user, $title, $checkRights = WatchedItem::CHECK_USER_RIGHTS ) {
$wl = new WatchedItem;
/**
* Check permissions
- * @param $what string: 'viewmywatchlist' or 'editmywatchlist'
+ * @param string $what 'viewmywatchlist' or 'editmywatchlist'
*/
private function isAllowed( $what ) {
return !$this->mCheckRights || $this->mUser->isAllowed( $what );
/**
* Get the notification timestamp of this entry.
*
- * @return false|null|string: false if the page is not watched, the value of
- * the wl_notificationtimestamp field otherwise
+ * @return false|null|string false if the page is not watched, the value of
+ * the wl_notificationtimestamp field otherwise
*/
public function getNotificationTimestamp() {
if ( !$this->isAllowed( 'viewmywatchlist' ) ) {
/**
* Reset the notification timestamp of this entry
*
- * @param $force Whether to force the write query to be executed even if the
- * page is not watched or the notification timestamp is already NULL.
+ * @param bool $force Whether to force the write query to be executed even if the
+ * page is not watched or the notification timestamp is already NULL.
* @param int $oldid The revision id being viewed. If not given or 0, latest revision is assumed.
*/
public function resetNotificationTimestamp( $force = '', $oldid = 0 ) {
}
/**
- * Given a title and user (assumes the object is setup), add the watch to the
- * database.
+ * Given a title and user (assumes the object is setup), add the watch to the database.
* @return bool
*/
public function addWatch() {
* Check if the given title already is watched by the user, and if so
* add watches on a new title. To be used for page renames and such.
*
- * @param $ot Title: page title to duplicate entries from, if present
- * @param $nt Title: page title to add watches on
+ * @param Title $ot Page title to duplicate entries from, if present
+ * @param Title $nt Page title to add watches on
*/
public static function duplicateEntries( $ot, $nt ) {
WatchedItem::doDuplicateEntries( $ot->getSubjectPage(), $nt->getSubjectPage() );
/**
* Handle duplicate entries. Backend for duplicateEntries().
*
- * @param $ot Title
- * @param $nt Title
+ * @param Title $ot
+ * @param Title $nt
*
* @return bool
*/
private $context;
/**
- * @param $x null|WebRequest
+ * @param null|WebRequest $x
* @return WebRequest
*/
public function request( WebRequest $x = null ) {
}
/**
- * @param $x null|OutputPage
+ * @param null|OutputPage $x
* @return OutputPage
*/
public function output( OutputPage $x = null ) {
/**
* Parse the request to get the Title object
*
- * @return Title object to be $wgTitle
+ * @return Title Title object to be $wgTitle
*/
private function parseTitle() {
global $wgContLang;
/**
* Returns the name of the action that will be executed.
*
- * @return string: action
+ * @return string Action
*/
public function getAction() {
static $action = null;
* Initialize the main Article object for "standard" actions (view, etc)
* Create an Article object for the page, following redirects if needed.
*
- * @return mixed an Article, or a string to redirect to another URL
+ * @return mixed An Article, or a string to redirect to another URL
*/
private function initializeArticle() {
global $wgDisableHardRedirects;
/**
* Perform one of the "standard" actions
*
- * @param $page Page
- * @param $requestTitle The original title, before any redirects were applied
+ * @param Page $page
+ * @param Title $requestTitle The original title, before any redirects were applied
*/
private function performAction( Page $page, Title $requestTitle ) {
global $wgUseSquid, $wgSquidMaxage;
/**
* Get width and height from the bmp header.
*
- * @param $image
+ * @param File $image
* @param string $filename
* @return array
*/
*/
class BitmapHandler_ClientOnly extends BitmapHandler {
/**
- * @param $image File
- * @param $params
+ * @param File $image
+ * @param array $params
* @return bool
*/
function normaliseParams( $image, &$params ) {
* Get metadata, unserializing it if neccessary.
*
* @param File $file The DjVu file in question
- * @return String XML metadata as a string.
+ * @return string XML metadata as a string.
*/
private function getUnserializedMetadata( File $file ) {
$metadata = $file->getMetadata();
/**
* Return data in the style of getimagesize()
- * @return array or false on failure
+ * @return array|bool Array or false on failure
*/
public function getImageSize() {
$data = $this->getInfo();
/**
* Hack to temporarily work around djvutoxml bug
- * @param $dump
+ * @param string $dump
* @return string
*/
function convertDumpToXML( $dump ) {
}
/**
- * @param $image
+ * @param File $image
* @param array $metadata
* @return bool|int
*/
* the width and height we normally work with is logical, and will match
* any produced output views.
*
- * @param $file File
+ * @param File $file
* @return int 0, 90, 180 or 270
*/
public function getRotation( $file ) {
* @param bool $noHtml If to avoid returning anything resembling HTML.
* (Ugly hack for backwards compatibility with old MediaWiki).
* @param bool|IContextSource $context
- * @return String single value (in wiki-syntax).
+ * @return string Single value (in wiki-syntax).
* @since 1.23
*/
public static function flattenArrayContentLang( $vals, $type = 'ul',
* 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.
- * @param $noHtml Boolean If to avoid returning anything resembling HTML.
+ * @param bool $noHtml If to avoid returning anything resembling HTML.
* (Ugly hack for backwards compatibility with old mediawiki).
- * @return String single value (in wiki-syntax).
+ * @return string Single value (in wiki-syntax).
* @since 1.23
*/
public function flattenArrayReal( $vals, $type = 'ul', $noHtml = false ) {
/** Helper function for creating lists of translations.
*
- * @param string $value value (this is not escaped)
- * @param string $lang lang code of item or false
+ * @param string $value Value (this is not escaped)
+ * @param string $lang Lang code of item or false
* @param bool $default If it is default value.
* @param bool $noHtml If to avoid html (for back-compat)
* @throws MWException
* This is used by the media handlers that use the FormatMetadata class
*
* @param array $metadataArray Metadata array
- * @return array for use displaying metadata.
+ * @return array Array for use displaying metadata.
*/
function formatMetadataHelper( $metadataArray ) {
$result = array(
* Get a list of metadata items which should be displayed when
* the metadata table is collapsed.
*
- * @return array of strings
+ * @return array Array of strings
*/
protected function visibleMetadataFields() {
return FormatMetadata::getVisibleFields();
* Shown in file history box on image description page.
*
* @param File $file
- * @return String Dimensions
+ * @return string Dimensions
*/
function getDimensionsString( $file ) {
return '';
* Get list of languages file can be viewed in.
*
* @param File $file
- * @return Array Array of language codes, or empty array if unsupported.
+ * @return array Array of language codes, or empty array if unsupported.
* @since 1.23
*/
public function getAvailableLanguages( File $file ) {
* type do not support alternative language renderings.
*
* @param File $file
- * @return String language code or null if multi-language not supported for filetype.
+ * @return string Language code or null if multi-language not supported for filetype.
* @since 1.23
*/
public function getDefaultRenderLanguage( File $file ) {
}
/**
- * @param $title string
+ * @param string $title
* @param string|array $params Query parameters to add
* @return array
*/
* this list.
*
* @param File $file
- * @return Array of language codes, or empty if no language switching supported.
+ * @return array Array of language codes, or empty if no language switching supported.
*/
public function getAvailableLanguages( File $file ) {
$metadata = $file->getMetadata();
/**
* What language to render file in if none selected.
*
- * @return String language code.
+ * @return string Language code.
*/
public function getDefaultRenderLanguage( File $file ) {
return 'en';
}
/**
- * @return Array with the known metadata
+ * @return array Array with the known metadata
*/
public function getMetadata() {
return $this->metadata;
/** Get the result array. Do some post-processing before returning
* the array, and transform any metadata that is special-cased.
*
- * @return Array array of results as an array of arrays suitable for
+ * @return array Array of results as an array of arrays suitable for
* FormatMetadata::getFormattedData().
*/
public function getResults() {
* This is generally where most properties start.
*
* @param string $ns Namespace
- * @param string $tag tag name (without namespace prefix)
- * @param array $attribs array of attributes
+ * @param string $tag Tag name (without namespace prefix)
+ * @param array $attribs Array of attributes
* @throws MWException
*/
private function startElementModeInitial( $ns, $tag, $attribs ) {
* Generally just calls a helper based on what MODE we're in.
* Also does some initial set up for the wrapper element
*
- * @param $parser XMLParser
+ * @param XMLParser $parser
* @param string $elm Namespace "<space>" element
* @param array $attribs Attribute name => value
* @throws MWException
* choices. (closed choice)
*
* @param array $info Information about current property
- * @param &$val Mixed current value to validate
+ * @param mixed &$val Current value to validate
* @param bool $standalone If this is a simple property or array
*/
public static function validateClosed( $info, &$val, $standalone ) {
* function to validate and modify flash structure
*
* @param array $info Information about current property
- * @param &$val Mixed current value to validate
+ * @param mixed &$val Current value to validate
* @param bool $standalone If this is a simple property or array
*/
public static function validateFlash( $info, &$val, $standalone ) {
* @see http://www.adobe.com/devnet/xmp/pdfs/XMPSpecificationPart1.pdf page 30 (section 8.2.2.5)
*
* @param array $info Information about current property
- * @param &$val Mixed current value to validate
+ * @param mixed &$val Current value to validate
* @param bool $standalone If this is a simple property or array
*/
public static function validateLangCode( $info, &$val, $standalone ) {