From 8ad1c9244125747f0ef0a8e1e053d04bbfebe19d Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 20 Apr 2014 21:16:57 +0200 Subject: [PATCH] Fixed some @params documentation (includes/*) Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5 --- includes/AuthPlugin.php | 4 +-- includes/AutoLoader.php | 4 +-- includes/Autopromote.php | 12 +++---- includes/Category.php | 16 ++++----- includes/Categoryfinder.php | 6 ++-- includes/ChangeTags.php | 26 +++++++-------- includes/ChangesFeed.php | 32 +++++++++--------- includes/Cookie.php | 27 ++++++++------- includes/FeedUtils.php | 34 +++++++++---------- includes/FileDeleteForm.php | 11 ++++--- includes/Init.php | 20 +++++------ includes/Licenses.php | 24 +++++++------- includes/LinkFilter.php | 18 +++++----- includes/MWTimestamp.php | 2 +- includes/MessageBlobStore.php | 44 ++++++++++++------------- includes/MimeMagic.php | 40 +++++++++++----------- includes/Namespace.php | 40 +++++++++++----------- includes/OutputHandler.php | 10 +++--- includes/PageQueryPage.php | 2 +- includes/ProtectionForm.php | 20 +++++------ includes/QueryPage.php | 3 +- includes/RevisionList.php | 28 ++++++++-------- includes/Sanitizer.php | 4 +-- includes/SquidPurgeClient.php | 17 +++++----- includes/StatCounter.php | 4 +-- includes/StubObject.php | 27 ++++++++------- includes/WatchedItem.php | 29 ++++++++-------- includes/Wiki.php | 14 ++++---- includes/media/BMP.php | 2 +- includes/media/Bitmap_ClientOnly.php | 4 +-- includes/media/DjVu.php | 2 +- includes/media/DjVuImage.php | 4 +-- includes/media/ExifBitmap.php | 4 +-- includes/media/FormatMetadata.php | 10 +++--- includes/media/MediaHandler.php | 10 +++--- includes/media/MediaTransformOutput.php | 2 +- includes/media/SVG.php | 4 +-- includes/media/SVGMetadataExtractor.php | 2 +- includes/media/XMP.php | 8 ++--- includes/media/XMPValidate.php | 6 ++-- 40 files changed, 293 insertions(+), 283 deletions(-) diff --git a/includes/AuthPlugin.php b/includes/AuthPlugin.php index 217744e47e..0ce3cf96d0 100644 --- a/includes/AuthPlugin.php +++ b/includes/AuthPlugin.php @@ -204,8 +204,8 @@ class AuthPlugin { * 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; diff --git a/includes/AutoLoader.php b/includes/AutoLoader.php index baa95013ae..de19e85ff3 100644 --- a/includes/AutoLoader.php +++ b/includes/AutoLoader.php @@ -1255,8 +1255,8 @@ class AutoLoader { * 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 ); diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 197ad9c957..81f3b7aa00 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -29,7 +29,7 @@ class Autopromote { /** * 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 ) { @@ -53,8 +53,8 @@ class Autopromote { * * 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. * @@ -99,8 +99,8 @@ class Autopromote { * 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 ) { @@ -156,7 +156,7 @@ class Autopromote { * 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 */ diff --git a/includes/Category.php b/includes/Category.php index e326ce23cd..e235e4e94e 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -129,8 +129,8 @@ class Category { /** * 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(); @@ -144,7 +144,7 @@ class Category { /** * Factory function. * - * @param $id Integer: a category id + * @param int $id A category id * @return Category */ public static function newFromID( $id ) { @@ -156,11 +156,11 @@ class Category { /** * 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 @@ -253,9 +253,9 @@ class 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__ ); diff --git a/includes/Categoryfinder.php b/includes/Categoryfinder.php index 6ef224b607..720f6f8f30 100644 --- a/includes/Categoryfinder.php +++ b/includes/Categoryfinder.php @@ -64,8 +64,8 @@ class Categoryfinder { /** * 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 */ @@ -113,7 +113,7 @@ class Categoryfinder { * 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() ) { diff --git a/includes/ChangeTags.php b/includes/ChangeTags.php index f73ec1f27f..3818c96649 100644 --- a/includes/ChangeTags.php +++ b/includes/ChangeTags.php @@ -65,8 +65,8 @@ class ChangeTags { * * @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" ); @@ -77,13 +77,13 @@ class ChangeTags { * 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 */ @@ -192,9 +192,9 @@ class ChangeTags { * * @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 @@ -238,12 +238,12 @@ class ChangeTags { * 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 */ @@ -297,7 +297,7 @@ class ChangeTags { * * Tries memcached first. * - * @return Array of strings: tags + * @return array Array of strings: tags */ public static function listDefinedTags() { // Caching... diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index a5e5364800..fb491e50b3 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -31,8 +31,8 @@ class ChangesFeed { /** * 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; @@ -42,10 +42,10 @@ class ChangesFeed { /** * 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; @@ -112,9 +112,9 @@ class ChangesFeed { /** * 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; @@ -126,10 +126,10 @@ class ChangesFeed { /** * 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; @@ -163,8 +163,8 @@ class ChangesFeed { /** * 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__ ); @@ -179,7 +179,7 @@ class ChangesFeed { /** * 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__ ); diff --git a/includes/Cookie.php b/includes/Cookie.php index e0a11a2073..b8d34e23cf 100644 --- a/includes/Cookie.php +++ b/includes/Cookie.php @@ -43,8 +43,8 @@ class Cookie { * 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 @@ -85,9 +85,9 @@ class Cookie { * @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 @@ -149,9 +149,9 @@ class Cookie { /** * 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 = ''; @@ -166,7 +166,7 @@ class Cookie { } /** - * @param $domain + * @param string $domain * @return bool */ protected function canServeDomain( $domain ) { @@ -189,7 +189,7 @@ class Cookie { } /** - * @param $path + * @param string $path * @return bool */ protected function canServePath( $path ) { @@ -210,6 +210,9 @@ class CookieJar { /** * 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. @@ -226,6 +229,8 @@ class CookieJar { /** * @see Cookie::serializeToHttpRequest + * @param string $path + * @param string $domain * @return string */ public function serializeToHttpRequest( $path, $domain ) { @@ -245,8 +250,8 @@ class CookieJar { /** * 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 ) { diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 22cb52beba..d407a0e1ad 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -33,8 +33,8 @@ class FeedUtils { * 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; @@ -49,7 +49,7 @@ class FeedUtils { * 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; @@ -70,8 +70,8 @@ class FeedUtils { /** * 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 ); @@ -94,13 +94,13 @@ class FeedUtils { /** * 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; @@ -214,9 +214,9 @@ class FeedUtils { * 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 ) { @@ -237,8 +237,8 @@ class FeedUtils { * 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( diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 444d26f34a..44aaeb4a6e 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -303,8 +303,8 @@ class FileDeleteForm { * 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; @@ -336,6 +336,7 @@ class FileDeleteForm { /** * Is the provided `oldimage` value valid? * + * @param string $oldimage * @return bool */ public static function isValidOldSpec( $oldimage ) { @@ -349,9 +350,9 @@ class FileDeleteForm { * 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 ) { diff --git a/includes/Init.php b/includes/Init.php index dd5e2d7a85..5b1dc83fab 100644 --- a/includes/Init.php +++ b/includes/Init.php @@ -55,7 +55,7 @@ class MWInit { * Get a fully-qualified path for a source file relative to $IP. * @deprecated since 1.22 * - * @param $file string + * @param string $file * * @return string */ @@ -66,7 +66,7 @@ class MWInit { /** * @deprecated since 1.22 - * @param $file string + * @param string $file * @return string */ static function compiledPath( $file ) { @@ -76,7 +76,7 @@ class MWInit { /** * @deprecated since 1.22 - * @param $file string + * @param string $file * @return string */ static function extCompiledPath( $file ) { @@ -87,7 +87,7 @@ class MWInit { * Deprecated wrapper for class_exists() * @deprecated since 1.22 * - * @param $class string + * @param string $class * * @return bool */ @@ -99,8 +99,8 @@ class MWInit { * Deprecated wrapper for method_exists() * @deprecated since 1.22 * - * @param $class string - * @param $method string + * @param string $class + * @param string $method * * @return bool */ @@ -112,7 +112,7 @@ class MWInit { * Deprecated wrapper for function_exists() * @deprecated since 1.22 * - * @param $function string + * @param string $function * * @return bool */ @@ -124,9 +124,9 @@ class MWInit { * 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 */ diff --git a/includes/Licenses.php b/includes/Licenses.php index 6c582aafee..e3db5b416c 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -47,7 +47,7 @@ class Licenses extends HTMLFormField { /** * Constructor * - * @param $params array + * @param array $params */ public function __construct( $params ) { parent::__construct( $params ); @@ -89,7 +89,7 @@ class Licenses extends HTMLFormField { } /** - * @param $str + * @param string $str * @return array */ protected function trimStars( $str ) { @@ -98,9 +98,9 @@ class Licenses extends HTMLFormField { } /** - * @param $list - * @param $path - * @param $item + * @param array $list + * @param array $path + * @param mixed $item */ protected function stackItem( &$list, $path, $item ) { $position =& $list; @@ -113,8 +113,8 @@ class Licenses extends HTMLFormField { } /** - * @param $tagset - * @param $depth int + * @param array $tagset + * @param int $depth */ protected function makeHtml( $tagset, $depth = 0 ) { foreach ( $tagset as $key => $val ) { @@ -139,10 +139,10 @@ class Licenses extends HTMLFormField { } /** - * @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 ) { @@ -171,7 +171,7 @@ class Licenses extends HTMLFormField { /** * Accessor for $this->html * - * @param $value bool + * @param bool $value * * @return string */ diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php index 48d5cd8549..340ae8f398 100644 --- a/includes/LinkFilter.php +++ b/includes/LinkFilter.php @@ -35,9 +35,9 @@ class LinkFilter { /** * 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 ) ) { @@ -58,7 +58,7 @@ class LinkFilter { * * @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://'; @@ -87,9 +87,9 @@ class LinkFilter { * 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 ); @@ -171,8 +171,8 @@ class LinkFilter { * 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 ) ) { diff --git a/includes/MWTimestamp.php b/includes/MWTimestamp.php index 9de2c0ab6c..c7451643a2 100644 --- a/includes/MWTimestamp.php +++ b/includes/MWTimestamp.php @@ -332,7 +332,7 @@ class MWTimestamp { * 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 ) { diff --git a/includes/MessageBlobStore.php b/includes/MessageBlobStore.php index 7e1c7452e5..f5b346c453 100644 --- a/includes/MessageBlobStore.php +++ b/includes/MessageBlobStore.php @@ -36,7 +36,7 @@ class MessageBlobStore { /** * 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 @@ -68,9 +68,9 @@ class MessageBlobStore { * 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 ) { @@ -125,10 +125,10 @@ class MessageBlobStore { /** * 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 ); @@ -195,7 +195,7 @@ class MessageBlobStore { /** * 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 { @@ -256,9 +256,9 @@ class MessageBlobStore { /** * 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 ); @@ -307,10 +307,10 @@ class MessageBlobStore { /** * 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 ); @@ -323,9 +323,9 @@ class MessageBlobStore { * 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 */ @@ -361,9 +361,9 @@ class MessageBlobStore { /** * 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(); diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index b5c0c7df62..3448c6aa5c 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -348,7 +348,7 @@ class MimeMagic { * 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 ) { @@ -374,7 +374,7 @@ class MimeMagic { * 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 ) { @@ -388,7 +388,7 @@ class MimeMagic { * 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 ) { @@ -409,8 +409,8 @@ class MimeMagic { * 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 ) { @@ -430,7 +430,7 @@ class MimeMagic { * 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 */ @@ -458,6 +458,7 @@ class MimeMagic { * * @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 ) { @@ -493,10 +494,10 @@ class MimeMagic { * 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' ) { @@ -535,12 +536,12 @@ class MimeMagic { * 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. @@ -855,7 +856,7 @@ class MimeMagic { * 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; @@ -950,11 +951,11 @@ class MimeMagic { * @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 ) { @@ -1040,6 +1041,7 @@ class MimeMagic { * * This function relies on the mapping defined by $this->mMediaTypes * @access private + * @param string $extMime * @return int|string */ function findMediaType( $extMime ) { @@ -1075,10 +1077,10 @@ class MimeMagic { * 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(); diff --git a/includes/Namespace.php b/includes/Namespace.php index ce585cec2f..78c4643684 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -45,8 +45,8 @@ class MWNamespace { * 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 @@ -61,7 +61,7 @@ class MWNamespace { /** * 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 ) { @@ -80,7 +80,7 @@ class MWNamespace { /** * 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 */ @@ -101,7 +101,7 @@ class MWNamespace { /** * Is the given namespace a talk namespace? * - * @param int $index namespace index + * @param int $index Namespace index * @return bool */ public static function isTalk( $index ) { @@ -112,7 +112,7 @@ class MWNamespace { /** * 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 ) { @@ -145,8 +145,8 @@ class MWNamespace { * 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__ ); @@ -163,7 +163,7 @@ class MWNamespace { /** * Returns whether the specified namespace exists * - * @param $index + * @param int $index * * @return bool * @since 1.19 @@ -210,7 +210,7 @@ class MWNamespace { * 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 @@ -231,8 +231,8 @@ class MWNamespace { /** * 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(); @@ -247,7 +247,7 @@ class MWNamespace { * 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 ) { @@ -287,7 +287,7 @@ class MWNamespace { /** * 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 ) { @@ -298,7 +298,7 @@ class MWNamespace { * 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 ) { @@ -309,7 +309,7 @@ class MWNamespace { /** * Can pages in a namespace be watched? * - * @param $index Int + * @param int $index * @return bool */ public static function isWatchable( $index ) { @@ -329,7 +329,7 @@ class MWNamespace { /** * 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; @@ -347,7 +347,7 @@ class MWNamespace { * 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( @@ -360,7 +360,7 @@ class MWNamespace { * 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( @@ -425,7 +425,7 @@ class MWNamespace { * * @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; diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index 3860b8e2b3..c783fd3344 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -23,7 +23,7 @@ /** * Standard output handler for use with ob_start * - * @param $s string + * @param string $s * * @return string */ @@ -94,7 +94,7 @@ function wfRequestExtension() { * 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 */ @@ -145,7 +145,7 @@ function wfGzipHandler( $s ) { /** * Mangle flash policy tags which open up the site to XSS attacks. * - * @param $s string + * @param string $s * * @return string */ @@ -161,7 +161,7 @@ function wfMangleFlashPolicy( $s ) { /** * 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' ) { @@ -172,7 +172,7 @@ function wfDoContentLength( $length ) { /** * Replace the output with an error if the HTML is not valid * - * @param $s string + * @param string $s * * @return string */ diff --git a/includes/PageQueryPage.php b/includes/PageQueryPage.php index 02a883ab93..afc02271c5 100644 --- a/includes/PageQueryPage.php +++ b/includes/PageQueryPage.php @@ -32,7 +32,7 @@ abstract class PageQueryPage extends QueryPage { * 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 ) { diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index bcb88e9fa7..ea359aa71f 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -141,7 +141,7 @@ class ProtectionForm { /** * 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 */ @@ -192,7 +192,7 @@ class ProtectionForm { /** * 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; @@ -247,7 +247,7 @@ class ProtectionForm { /** * Save submitted protection form * - * @return Boolean: success + * @return bool Success */ function save() { global $wgRequest, $wgUser, $wgOut; @@ -322,7 +322,7 @@ class ProtectionForm { /** * Build the input form * - * @return String: HTML form + * @return string HTML form */ function buildForm() { global $wgUser, $wgLang, $wgOut; @@ -537,9 +537,9 @@ class ProtectionForm { /** * 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; @@ -569,8 +569,8 @@ class ProtectionForm { /** * 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 == '' ) { @@ -604,7 +604,7 @@ class ProtectionForm { /** * Show protection long extracts for this page * - * @param $out OutputPage + * @param OutputPage $out * @access private */ function showLogExtract( &$out ) { diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 29bbd52b78..793ac55681 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -359,6 +359,7 @@ abstract class QueryPage extends SpecialPage { /** * 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' ) ); @@ -648,7 +649,7 @@ abstract class QueryPage extends SpecialPage { } /** - * @param $offset + * @param int $offset * @return string */ function openList( $offset ) { diff --git a/includes/RevisionList.php b/includes/RevisionList.php index 1b865bb05c..506ac4ca83 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -33,8 +33,8 @@ abstract class RevisionListBase extends ContextSource { /** * 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 ); @@ -43,7 +43,7 @@ abstract class RevisionListBase extends ContextSource { /** * 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; @@ -72,7 +72,7 @@ abstract class RevisionListBase extends ContextSource { /** * 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 ) { @@ -86,6 +86,7 @@ abstract class RevisionListBase extends ContextSource { /** * Get the current list item, or false if we are at the end + * @return Revision */ public function current() { return $this->current; @@ -93,6 +94,7 @@ abstract class RevisionListBase extends ContextSource { /** * Move the iteration pointer to the next list item, and return it. + * @return Revision */ public function next() { $this->res->next(); @@ -114,13 +116,13 @@ abstract class RevisionListBase extends ContextSource { /** * 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 ); } @@ -136,8 +138,8 @@ abstract class RevisionItemBase { 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; @@ -182,7 +184,7 @@ abstract class RevisionItemBase { /** * Get the ID, as it would appear in the ids URL parameter - * @return + * @return int */ public function getId() { $field = $this->getIdField(); @@ -191,7 +193,7 @@ abstract class RevisionItemBase { /** * Get the date, formatted in user's language - * @return String + * @return string */ public function formatDate() { return $this->list->getLanguage()->userDate( $this->getTimestamp(), @@ -200,7 +202,7 @@ abstract class RevisionItemBase { /** * Get the time, formatted in user's language - * @return String + * @return string */ public function formatTime() { return $this->list->getLanguage()->userTime( $this->getTimestamp(), @@ -209,7 +211,7 @@ abstract class RevisionItemBase { /** * Get the timestamp in MW 14-char form - * @return Mixed + * @return mixed */ public function getTimestamp() { $field = $this->getTimestampField(); @@ -257,7 +259,7 @@ class RevisionList extends RevisionListBase { } /** - * @param $db DatabaseBase + * @param DatabaseBase $db * @return mixed */ public function doQuery( $db ) { diff --git a/includes/Sanitizer.php b/includes/Sanitizer.php index 245714ded1..59ac046f55 100644 --- a/includes/Sanitizer.php +++ b/includes/Sanitizer.php @@ -1069,7 +1069,7 @@ class Sanitizer { * 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 @@ -1136,7 +1136,7 @@ class Sanitizer { * 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 ); diff --git a/includes/SquidPurgeClient.php b/includes/SquidPurgeClient.php index eadf2563e3..0997a7a7a3 100644 --- a/includes/SquidPurgeClient.php +++ b/includes/SquidPurgeClient.php @@ -50,8 +50,8 @@ class SquidPurgeClient { var $bodyRemaining; /** - * @param $server string - * @param $options array + * @param string $server + * @param array $options */ public function __construct( $server, $options = array() ) { $parts = explode( ':', $server, 2 ); @@ -126,6 +126,7 @@ class SquidPurgeClient { /** * 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 ) { @@ -173,7 +174,7 @@ class SquidPurgeClient { /** * Queue a purge operation * - * @param $url string + * @param string $url */ public function queuePurge( $url ) { global $wgSquidPurgeUseHostHeader; @@ -323,7 +324,7 @@ class SquidPurgeClient { } /** - * @param $line + * @param string $line * @return */ protected function processStatusLine( $line ) { @@ -343,7 +344,7 @@ class SquidPurgeClient { } /** - * @param $line string + * @param string $line */ protected function processHeaderLine( $line ) { if ( preg_match( '/^Content-Length: (\d+)$/i', $line, $m ) ) { @@ -370,7 +371,7 @@ class SquidPurgeClient { } /** - * @param $msg string + * @param string $msg */ protected function log( $msg ) { wfDebugLog( 'squid', __CLASS__ . " ($this->host): $msg" ); @@ -386,7 +387,7 @@ class SquidPurgeClientPool { var $timeout = 5; /** - * @param $options array + * @param array $options */ function __construct( $options = array() ) { if ( isset( $options['timeout'] ) ) { @@ -395,7 +396,7 @@ class SquidPurgeClientPool { } /** - * @param $client SquidPurgeClient + * @param SquidPurgeClient $client * @return void */ public function addClient( $client ) { diff --git a/includes/StatCounter.php b/includes/StatCounter.php index 1373f3d5b0..a429c3675e 100644 --- a/includes/StatCounter.php +++ b/includes/StatCounter.php @@ -36,7 +36,7 @@ * @ingroup StatCounter */ class StatCounter { - /** @var Array */ + /** @var array */ protected $deltas = array(); // (key => count) protected function __construct() {} @@ -56,7 +56,7 @@ class StatCounter { * Increment a key by delta $count * * @param string $key - * @param integer $count + * @param int $count * @return void */ public function incr( $key, $count = 1 ) { diff --git a/includes/StubObject.php b/includes/StubObject.php index a3970f34cb..bb173e7c71 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -47,10 +47,9 @@ class StubObject { /** * 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; @@ -62,8 +61,8 @@ class StubObject { * 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; @@ -74,7 +73,7 @@ class 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 ) { @@ -90,8 +89,8 @@ class StubObject { * 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 ) { @@ -111,8 +110,8 @@ class StubObject { * 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 ) { @@ -125,9 +124,9 @@ class StubObject { * 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 ) { diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index a6e75162e3..749a354f0a 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -47,11 +47,11 @@ class WatchedItem { /** * 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; @@ -146,7 +146,7 @@ class 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 ); @@ -168,8 +168,8 @@ class WatchedItem { /** * 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' ) ) { @@ -187,8 +187,8 @@ class WatchedItem { /** * 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 ) { @@ -253,8 +253,7 @@ class WatchedItem { } /** - * 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() { @@ -345,8 +344,8 @@ class WatchedItem { * 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() ); @@ -356,8 +355,8 @@ class WatchedItem { /** * Handle duplicate entries. Backend for duplicateEntries(). * - * @param $ot Title - * @param $nt Title + * @param Title $ot + * @param Title $nt * * @return bool */ diff --git a/includes/Wiki.php b/includes/Wiki.php index 297041b572..2ef1382afd 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -34,7 +34,7 @@ class MediaWiki { private $context; /** - * @param $x null|WebRequest + * @param null|WebRequest $x * @return WebRequest */ public function request( WebRequest $x = null ) { @@ -44,7 +44,7 @@ class MediaWiki { } /** - * @param $x null|OutputPage + * @param null|OutputPage $x * @return OutputPage */ public function output( OutputPage $x = null ) { @@ -67,7 +67,7 @@ class MediaWiki { /** * 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; @@ -142,7 +142,7 @@ class MediaWiki { /** * Returns the name of the action that will be executed. * - * @return string: action + * @return string Action */ public function getAction() { static $action = null; @@ -311,7 +311,7 @@ class MediaWiki { * 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; @@ -393,8 +393,8 @@ class MediaWiki { /** * 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; diff --git a/includes/media/BMP.php b/includes/media/BMP.php index 967b01780f..d8b0ba641d 100644 --- a/includes/media/BMP.php +++ b/includes/media/BMP.php @@ -51,7 +51,7 @@ class BmpHandler extends BitmapHandler { /** * Get width and height from the bmp header. * - * @param $image + * @param File $image * @param string $filename * @return array */ diff --git a/includes/media/Bitmap_ClientOnly.php b/includes/media/Bitmap_ClientOnly.php index d29626900d..c105c4281e 100644 --- a/includes/media/Bitmap_ClientOnly.php +++ b/includes/media/Bitmap_ClientOnly.php @@ -31,8 +31,8 @@ */ class BitmapHandler_ClientOnly extends BitmapHandler { /** - * @param $image File - * @param $params + * @param File $image + * @param array $params * @return bool */ function normaliseParams( $image, &$params ) { diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 2aeb35dfe3..aeba6470e5 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -260,7 +260,7 @@ class DjVuHandler extends ImageHandler { * 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(); diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index e1e7992c1c..099375bfce 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -60,7 +60,7 @@ class DjVuImage { /** * 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(); @@ -330,7 +330,7 @@ EOR; /** * Hack to temporarily work around djvutoxml bug - * @param $dump + * @param string $dump * @return string */ function convertDumpToXML( $dump ) { diff --git a/includes/media/ExifBitmap.php b/includes/media/ExifBitmap.php index 4bbafc1af6..ae1ff9d7fe 100644 --- a/includes/media/ExifBitmap.php +++ b/includes/media/ExifBitmap.php @@ -80,7 +80,7 @@ class ExifBitmapHandler extends BitmapHandler { } /** - * @param $image + * @param File $image * @param array $metadata * @return bool|int */ @@ -198,7 +198,7 @@ class ExifBitmapHandler extends BitmapHandler { * 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 ) { diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index adaba76896..fca1c6d430 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -985,7 +985,7 @@ class FormatMetadata extends ContextSource { * @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', @@ -1036,9 +1036,9 @@ class FormatMetadata extends ContextSource { * 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 ) { @@ -1156,8 +1156,8 @@ class FormatMetadata extends ContextSource { /** 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 diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index e4caf351a8..0c18821e7f 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -495,7 +495,7 @@ abstract class MediaHandler { * 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( @@ -523,7 +523,7 @@ abstract class MediaHandler { * 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(); @@ -644,7 +644,7 @@ abstract class MediaHandler { * Shown in file history box on image description page. * * @param File $file - * @return String Dimensions + * @return string Dimensions */ function getDimensionsString( $file ) { return ''; @@ -776,7 +776,7 @@ abstract class MediaHandler { * 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 ) { @@ -792,7 +792,7 @@ abstract class MediaHandler { * 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 ) { diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 05feb3043c..f6f10d3da6 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -218,7 +218,7 @@ abstract class MediaTransformOutput { } /** - * @param $title string + * @param string $title * @param string|array $params Query parameters to add * @return array */ diff --git a/includes/media/SVG.php b/includes/media/SVG.php index ce7fcbb489..5a1074138a 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -86,7 +86,7 @@ class SvgHandler extends ImageHandler { * 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(); @@ -107,7 +107,7 @@ class SvgHandler extends ImageHandler { /** * What language to render file in if none selected. * - * @return String language code. + * @return string Language code. */ public function getDefaultRenderLanguage( File $file ) { return 'en'; diff --git a/includes/media/SVGMetadataExtractor.php b/includes/media/SVGMetadataExtractor.php index 361eb9450c..2a1091d81d 100644 --- a/includes/media/SVGMetadataExtractor.php +++ b/includes/media/SVGMetadataExtractor.php @@ -123,7 +123,7 @@ class SVGReader { } /** - * @return Array with the known metadata + * @return array Array with the known metadata */ public function getMetadata() { return $this->metadata; diff --git a/includes/media/XMP.php b/includes/media/XMP.php index 08d416a620..55d531962d 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -159,7 +159,7 @@ class XMPReader { /** 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() { @@ -851,8 +851,8 @@ class XMPReader { * 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 ) { @@ -1041,7 +1041,7 @@ class XMPReader { * 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 "" element * @param array $attribs Attribute name => value * @throws MWException diff --git a/includes/media/XMPValidate.php b/includes/media/XMPValidate.php index 43622179df..0fa601173f 100644 --- a/includes/media/XMPValidate.php +++ b/includes/media/XMPValidate.php @@ -142,7 +142,7 @@ class XMPValidate { * 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 ) { @@ -172,7 +172,7 @@ class XMPValidate { * 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 ) { @@ -206,7 +206,7 @@ class XMPValidate { * @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 ) { -- 2.20.1