From a3983418d5748fbccdda15e0e48af90c50ef1f67 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Tue, 22 Apr 2014 13:07:02 +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: I0056b4a8df243cfc0c5f25378de48f7a35170aca --- includes/AjaxResponse.php | 24 ++--- includes/CacheHelper.php | 26 ++--- includes/CategoryViewer.php | 54 +++++----- includes/EditPage.php | 88 +++++++-------- includes/Fallback.php | 30 +++--- includes/Feed.php | 41 ++++--- includes/HistoryBlob.php | 47 ++++---- includes/Html.php | 30 +++--- includes/HttpFunctions.php | 66 ++++++------ includes/ImagePage.php | 56 +++++----- includes/Linker.php | 142 ++++++++++++++----------- includes/MagicWord.php | 60 +++++------ includes/Message.php | 8 +- includes/Pager.php | 100 ++++++++--------- includes/PathRouter.php | 26 ++--- includes/PrefixSearch.php | 46 ++++---- includes/SiteConfiguration.php | 32 +++--- includes/SiteStats.php | 30 +++--- includes/SkinTemplate.php | 60 ++++++----- includes/Status.php | 46 ++++---- includes/UserMailer.php | 74 ++++++------- includes/UserRightsProxy.php | 60 ++++++----- includes/WikiMap.php | 56 +++++----- includes/profiler/Profiler.php | 4 +- includes/profiler/ProfilerStandard.php | 22 ++-- 25 files changed, 629 insertions(+), 599 deletions(-) diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 4b5ca75eb0..a3808a5496 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -48,7 +48,7 @@ class AjaxResponse { /** * Date for the HTTP header Last-modified - * @var string|false $mLastModified + * @var string|bool $mLastModified */ private $mLastModified; @@ -71,7 +71,7 @@ class AjaxResponse { private $mText; /** - * @param $text string|null + * @param string|null $text */ function __construct( $text = null ) { $this->mCacheDuration = null; @@ -90,7 +90,7 @@ class AjaxResponse { /** * Set the number of seconds to get the response cached by a proxy - * @param $duration int + * @param int $duration */ function setCacheDuration( $duration ) { $this->mCacheDuration = $duration; @@ -98,7 +98,7 @@ class AjaxResponse { /** * Set the HTTP Vary header - * @param $vary string + * @param string $vary */ function setVary( $vary ) { $this->mVary = $vary; @@ -106,7 +106,7 @@ class AjaxResponse { /** * Set the HTTP response code - * @param $code string + * @param string $code */ function setResponseCode( $code ) { $this->mResponseCode = $code; @@ -114,7 +114,7 @@ class AjaxResponse { /** * Set the HTTP header Content-Type - * @param $type string + * @param string $type */ function setContentType( $type ) { $this->mContentType = $type; @@ -129,7 +129,7 @@ class AjaxResponse { /** * Add content to the response - * @param $text string + * @param string $text */ function addText( $text ) { if ( ! $this->mDisabled && $text ) { @@ -206,7 +206,7 @@ class AjaxResponse { * possible. If successful, the AjaxResponse is disabled so that * any future call to AjaxResponse::printText() have no effect. * - * @param $timestamp string + * @param string $timestamp * @return bool Returns true if the response code was set to 304 Not Modified. */ function checkLastModified( $timestamp ) { @@ -262,8 +262,8 @@ class AjaxResponse { } /** - * @param $mckey string - * @param $touched int + * @param string $mckey + * @param int $touched * @return bool */ function loadFromMemcached( $mckey, $touched ) { @@ -290,8 +290,8 @@ class AjaxResponse { } /** - * @param $mckey string - * @param $expiry int + * @param string $mckey + * @param int $expiry * @return bool */ function storeInMemcached( $mckey, $expiry = 86400 ) { diff --git a/includes/CacheHelper.php b/includes/CacheHelper.php index cfa4160e4c..695eac3a05 100644 --- a/includes/CacheHelper.php +++ b/includes/CacheHelper.php @@ -32,7 +32,7 @@ interface ICacheHelper { * Sets if the cache should be enabled or not. * * @since 1.20 - * @param boolean $cacheEnabled + * @param bool $cacheEnabled */ function setCacheEnabled( $cacheEnabled ); @@ -42,8 +42,8 @@ interface ICacheHelper { * * @since 1.20 * - * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. - * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. + * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. + * @param bool|null $cacheEnabled Sets if the cache should be enabled or not. */ function startCache( $cacheExpiry = null, $cacheEnabled = null ); @@ -77,7 +77,7 @@ interface ICacheHelper { * * @since 1.20 * - * @param integer $cacheExpiry + * @param int $cacheExpiry */ function setExpiry( $cacheExpiry ); } @@ -105,7 +105,7 @@ class CacheHelper implements ICacheHelper { * The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. * * @since 1.20 - * @var integer + * @var int */ protected $cacheExpiry = 3600; @@ -124,7 +124,7 @@ class CacheHelper implements ICacheHelper { * Null if this information is not available yet. * * @since 1.20 - * @var boolean|null + * @var bool|null */ protected $hasCached = null; @@ -132,7 +132,7 @@ class CacheHelper implements ICacheHelper { * If the cache is enabled or not. * * @since 1.20 - * @var boolean + * @var bool */ protected $cacheEnabled = true; @@ -156,7 +156,7 @@ class CacheHelper implements ICacheHelper { * Sets if the cache should be enabled or not. * * @since 1.20 - * @param boolean $cacheEnabled + * @param bool $cacheEnabled */ public function setCacheEnabled( $cacheEnabled ) { $this->cacheEnabled = $cacheEnabled; @@ -168,8 +168,8 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param integer|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. - * @param boolean|null $cacheEnabled Sets if the cache should be enabled or not. + * @param int|null $cacheExpiry Sets the cache expiry, either ttl in seconds or unix timestamp. + * @param bool|null $cacheEnabled Sets if the cache should be enabled or not. */ public function startCache( $cacheExpiry = null, $cacheEnabled = null ) { if ( is_null( $this->hasCached ) ) { @@ -192,7 +192,7 @@ class CacheHelper implements ICacheHelper { * @since 1.20 * * @param IContextSource $context - * @param boolean $includePurgeLink + * @param bool $includePurgeLink * * @return string */ @@ -328,7 +328,7 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param integer $cacheExpiry + * @param int $cacheExpiry */ public function setExpiry( $cacheExpiry ) { $this->cacheExpiry = $cacheExpiry; @@ -378,7 +378,7 @@ class CacheHelper implements ICacheHelper { * * @since 1.20 * - * @param $handlerFunction + * @param callable $handlerFunction */ public function setOnInitializedHandler( $handlerFunction ) { $this->onInitHandler = $handlerFunction; diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 7f213c352c..cee3f5b37f 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -29,12 +29,12 @@ class CategoryViewer extends ContextSource { $imgsNoGallery; /** - * @var Array + * @var array */ var $nextPage; /** - * @var Array + * @var array */ var $flip; @@ -69,12 +69,12 @@ class CategoryViewer extends ContextSource { * Constructor * * @since 1.19 $context is a second, required parameter - * @param $title Title - * @param $context IContextSource + * @param Title $title + * @param IContextSource $context * @param array $from An array with keys page, subcat, * and file for offset of results of each section (since 1.17) * @param array $until An array with 3 keys for until of each section (since 1.17) - * @param $query Array + * @param array $query */ function __construct( $title, IContextSource $context, $from = array(), $until = array(), $query = array() @@ -162,9 +162,9 @@ class CategoryViewer extends ContextSource { /** * Add a subcategory to the internal lists, using a Category object - * @param $cat Category - * @param $sortkey - * @param $pageLength + * @param Category $cat + * @param string $sortkey + * @param int $pageLength */ function addSubcategoryObject( Category $cat, $sortkey, $pageLength ) { // Subcategory; strip the 'Category' namespace from the link text. @@ -210,10 +210,10 @@ class CategoryViewer extends ContextSource { /** * Add a page in the image namespace - * @param $title Title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addImage( Title $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -240,10 +240,10 @@ class CategoryViewer extends ContextSource { /** * Add a miscellaneous page - * @param $title - * @param $sortkey - * @param $pageLength - * @param $isRedirect bool + * @param Title $title + * @param string $sortkey + * @param int $pageLength + * @param bool $isRedirect */ function addPage( $title, $sortkey, $pageLength, $isRedirect = false ) { global $wgContLang; @@ -474,10 +474,10 @@ class CategoryViewer extends ContextSource { * Format a list of articles chunked by letter, either as a * bullet list or a columnar format, depending on the length. * - * @param $articles Array - * @param $articles_start_char Array - * @param $cutoff Int - * @return String + * @param array $articles + * @param array $articles_start_char + * @param int $cutoff + * @return string * @private */ function formatList( $articles, $articles_start_char, $cutoff = 6 ) { @@ -507,9 +507,9 @@ class CategoryViewer extends ContextSource { * More distant TODO: Scrap this and use CSS columns, whenever IE finally * supports those. * - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param array $articles_start_char + * @return string * @private */ static function columnList( $articles, $articles_start_char ) { @@ -563,9 +563,9 @@ class CategoryViewer extends ContextSource { /** * Format a list of articles chunked by letter in a bullet list. - * @param $articles Array - * @param $articles_start_char Array - * @return String + * @param array $articles + * @param array $articles_start_char + * @return string * @private */ static function shortList( $articles, $articles_start_char ) { @@ -590,7 +590,7 @@ class CategoryViewer extends ContextSource { * @param string $last The 'from' parameter for the generated URL * @param string $type A prefix for parameters, 'page' or 'subcat' or * 'file' - * @return String HTML + * @return string HTML */ private function pagingLinks( $first, $last, $type = '' ) { $prevLink = $this->msg( 'prevn' )->numParams( $this->limit )->escaped(); diff --git a/includes/EditPage.php b/includes/EditPage.php index c266996082..c2803b69cf 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -225,7 +225,7 @@ class EditPage { /** * Has a summary been preset using GET parameter &summary= ? - * @var Bool + * @var bool */ var $hasPresetSummary = false; @@ -266,7 +266,7 @@ class EditPage { public $allowNonTextContent = false; /** - * @param $article Article + * @param Article $article */ public function __construct( Article $article ) { $this->mArticle = $article; @@ -296,7 +296,7 @@ class EditPage { /** * Set the context Title object * - * @param $title Title object or null + * @param Title|null $title Title object or null */ public function setContextTitle( $title ) { $this->mContextTitle = $title; @@ -307,7 +307,7 @@ class EditPage { * If not set, $wgTitle will be returned. This behavior might change in * the future to return $this->mTitle instead. * - * @return Title object + * @return Title */ public function getContextTitle() { if ( is_null( $this->mContextTitle ) ) { @@ -487,8 +487,8 @@ class EditPage { * "View source for ..." page displaying the source code after the error message. * * @since 1.19 - * @param array $permErrors of permissions errors, as returned by - * Title::getUserPermissionsErrors(). + * @param array $permErrors Array of permissions errors, as returned by + * Title::getUserPermissionsErrors(). * @throws PermissionsError */ protected function displayPermissionsError( array $permErrors ) { @@ -625,7 +625,7 @@ class EditPage { /** * This function collects the form data and uses it to populate various member variables. - * @param $request WebRequest + * @param WebRequest $request * @throws ErrorPageError */ function importFormData( &$request ) { @@ -819,7 +819,7 @@ class EditPage { * this method should be overridden and return the page text that will be used * for saving, preview parsing and so on... * - * @param $request WebRequest + * @param WebRequest $request */ protected function importContentFormData( &$request ) { return; // Don't do anything, EditPage already extracted wpTextbox1 @@ -828,7 +828,7 @@ class EditPage { /** * Initialise form fields in the object * Called on the first invocation, e.g. when a user clicks an edit link - * @return bool -- if the requested section is valid + * @return bool If the requested section is valid */ function initialiseForm() { global $wgUser; @@ -864,8 +864,8 @@ class EditPage { /** * Fetch initial editing page content. * - * @param $def_text string|bool - * @return mixed string on success, $def_text for invalid sections + * @param string|bool $def_text + * @return string|bool string on success, $def_text for invalid sections * @private * @deprecated since 1.21, get WikiPage::getContent() instead. */ @@ -887,7 +887,7 @@ class EditPage { /** * @param Content|null $def_content The default value to return * - * @return mixed Content on success, $def_content for invalid sections + * @return Content|null Content on success, $def_content for invalid sections * * @since 1.21 */ @@ -1074,7 +1074,7 @@ class EditPage { /** * Use this method before edit() to preload some text into the edit box * - * @param $text string + * @param string $text * @deprecated since 1.21, use setPreloadedContent() instead. */ public function setPreloadedText( $text ) { @@ -1088,7 +1088,7 @@ class EditPage { /** * Use this method before edit() to preload some content into the edit box * - * @param $content Content + * @param Content $content * * @since 1.21 */ @@ -1102,7 +1102,7 @@ class EditPage { * * @param string $preload representing the title to preload from. * - * @return String + * @return string * * @deprecated since 1.21, use getPreloadedContent() instead */ @@ -1119,8 +1119,8 @@ class EditPage { * Get the contents to be preloaded into the box, either set by * an earlier setPreloadText() or by loading the given page. * - * @param string $preload representing the title to preload from. - * @param Array $params Parameters to use (interface-message style) in the preloaded text + * @param string $preload Representing the title to preload from. + * @param array $params Parameters to use (interface-message style) in the preloaded text * * @return Content * @@ -1186,7 +1186,7 @@ class EditPage { /** * Make sure the form isn't faking a user's credentials. * - * @param $request WebRequest + * @param WebRequest $request * @return bool * @private */ @@ -1345,7 +1345,7 @@ class EditPage { /** * Run hooks that can filter edits just before they get saved. * - * @param Content $content the Content to filter. + * @param Content $content The Content to filter. * @param Status $status For reporting the outcome to the caller * @param User $user The user performing the edit * @@ -1393,14 +1393,14 @@ class EditPage { /** * Attempt submission (no UI) * - * @param array $result array to add statuses to, currently with the possible keys: + * @param array $result Array to add statuses to, currently with the possible keys: * spam - string - Spam string from content if any spam is detected by matchSpamRegex * sectionanchor - string - Section anchor for a section save * nullEdit - boolean - Set if doEditContent is OK. True if null edit, false otherwise. * redirect - boolean - Set if doEditContent is OK. True if resulting revision is a redirect * @param bool $bot True if edit is being made under the bot right. * - * @return Status object, possibly with a message, but always with one of the AS_* constants in $status->value, + * @return Status Status object, possibly with a message, but always with one of the AS_* constants in $status->value, * * FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are * also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g. @@ -1866,7 +1866,7 @@ class EditPage { /** * Attempts to merge text content with base and current revisions * - * @param $editText string + * @param string $editText * * @return bool * @deprecated since 1.21, use mergeChangesIntoContent() instead @@ -1892,7 +1892,7 @@ class EditPage { * * @since 1.21 * - * @param $editContent + * @param Content $editContent * * @return bool */ @@ -1948,9 +1948,9 @@ class EditPage { /** * Check given input text against $wgSpamRegex, and return the text of the first match. * - * @param $text string + * @param string $text * - * @return string|bool matching string or false + * @return string|bool Matching string or false */ public static function matchSpamRegex( $text ) { global $wgSpamRegex; @@ -1962,9 +1962,9 @@ class EditPage { /** * Check given input text against $wgSummarySpamRegex, and return the text of the first match. * - * @param $text string + * @param string $text * - * @return string|bool matching string or false + * @return string|bool Matching string or false */ public static function matchSummarySpamRegex( $text ) { global $wgSummarySpamRegex; @@ -1973,8 +1973,8 @@ class EditPage { } /** - * @param $text string - * @param $regexes array + * @param string $text + * @param array $regexes * @return bool|string */ protected static function matchSpamRegexInternal( $text, $regexes ) { @@ -2153,7 +2153,7 @@ class EditPage { * content. * * @param Content|null|bool|string $content - * @return String the editable text form of the content. + * @return string The editable text form of the content. * * @throws MWException if $content is not an instance of TextContent and $this->allowNonTextContent is not true. */ @@ -2206,7 +2206,7 @@ class EditPage { /** * Send the edit form and related headers to $wgOut - * @param $formCallback Callback|null that takes an OutputPage parameter; will be called + * @param callable|null $formCallback That takes an OutputPage parameter; will be called * during form output near the top, for captchas and the like. */ function showEditForm( $formCallback = null ) { @@ -2401,7 +2401,7 @@ class EditPage { * Extract the section title from current section text, if any. * * @param string $text - * @return Mixed|string or false + * @return string|bool string or false */ public static function extractSectionTitle( $text ) { preg_match( "/^(=+)(.+)\\1\\s*(\n|$)/i", $text, $matches ); @@ -2576,8 +2576,8 @@ class EditPage { * * @param string $summary The value of the summary input * @param string $labelText The html to place inside the label - * @param array $inputAttrs of attrs to use on the input - * @param array $spanLabelAttrs of attrs to use on the span inside the label + * @param array $inputAttrs Array of attrs to use on the input + * @param array $spanLabelAttrs Array of attrs to use on the span inside the label * * @return array An array in the format array( $label, $input ) */ @@ -2637,7 +2637,7 @@ class EditPage { * @param bool $isSubjectPreview true if this is the section subject/title * up top, or false if this is the comment summary * down below the textarea - * @param string $summary the text of the summary to display + * @param string $summary The text of the summary to display * @return string */ protected function getSummaryPreview( $isSubjectPreview, $summary = "" ) { @@ -2710,8 +2710,8 @@ HTML * The $textoverride method can be used by subclasses overriding showContentForm * to pass back to this method. * - * @param array $customAttribs of html attributes to use in the textarea - * @param string $textoverride optional text to override $this->textarea1 with + * @param array $customAttribs Array of html attributes to use in the textarea + * @param string $textoverride Optional text to override $this->textarea1 with */ protected function showTextbox1( $customAttribs = null, $textoverride = null ) { if ( $this->wasDeletedSinceLastEdit() && $this->formtype == 'save' ) { @@ -2817,7 +2817,7 @@ HTML * Append preview output to $wgOut. * Includes category rendering if this is a category page. * - * @param string $text the HTML to be output for the preview. + * @param string $text The HTML to be output for the preview. */ protected function showPreview( $text ) { global $wgOut; @@ -2946,8 +2946,7 @@ HTML * Get the copyright warning, by default returns wikitext * * @param Title $title - * @param string $format output format, valid values are any function of - * a Message object + * @param string $format Output format, valid values are any function of a Message object * @return string */ public static function getCopyrightWarning( $title, $format = 'plain' ) { @@ -3106,7 +3105,7 @@ HTML * variable in the constructor is not enough. This can be used when the * EditPage lives inside of a Special page rather than a custom page action. * - * @param $title Title object for which is being edited (where we go to for &action= links) + * @param Title $title Title object for which is being edited (where we go to for &action= links) * @return string */ protected function getActionURL( Title $title ) { @@ -3118,6 +3117,7 @@ HTML * Note that we rely on the logging table, which hasn't been always there, * but that doesn't matter, because this only applies to brand new * deletes. + * @return bool */ protected function wasDeletedSinceLastEdit() { if ( $this->deletedSinceEdit !== null ) { @@ -3313,7 +3313,7 @@ HTML } /** - * @return Array + * @return array */ function getTemplates() { if ( $this->preview || $this->section != '' ) { @@ -3494,7 +3494,7 @@ HTML * minor and watch * * @param int $tabindex Current tabindex - * @param array $checked of checkbox => bool, where bool indicates the checked + * @param array $checked Array of checkbox => bool, where bool indicates the checked * status of the checkbox * * @return array @@ -3673,7 +3673,7 @@ HTML /** * Show "your edit contains spam" page with your diff and text * - * @param $match string|Array|bool Text (or array of texts) which triggered one or more filters + * @param string|array|bool $match Text (or array of texts) which triggered one or more filters */ public function spamPageWithContent( $match = false ) { global $wgOut, $wgLang; diff --git a/includes/Fallback.php b/includes/Fallback.php index cdf6c88ec3..e38bdf1a70 100644 --- a/includes/Fallback.php +++ b/includes/Fallback.php @@ -26,9 +26,9 @@ class Fallback { /** - * @param $from - * @param $to - * @param $string + * @param string $from + * @param string $to + * @param string $string * @return string */ public static function iconv( $from, $to, $string ) { @@ -57,9 +57,9 @@ class Fallback { * can be up to 100x slower than native if the text is heavily * multibyte and we have to slog through a few hundred kb. * - * @param $str - * @param $start - * @param $count string + * @param string $str + * @param int $start + * @param string $count * * @return string */ @@ -78,8 +78,8 @@ class Fallback { } /** - * @param $str - * @param $splitPos + * @param string $str + * @param int $splitPos * @return int */ public static function mb_substr_split_unicode( $str, $splitPos ) { @@ -130,7 +130,7 @@ class Fallback { /** * Fallback implementation of mb_strlen, hardcoded to UTF-8. * @param string $str - * @param string $enc optional encoding; ignored + * @param string $enc Optional encoding; ignored * @return int */ public static function mb_strlen( $str, $enc = '' ) { @@ -151,10 +151,10 @@ class Fallback { /** * Fallback implementation of mb_strpos, hardcoded to UTF-8. - * @param $haystack String - * @param $needle String - * @param string $offset optional start position - * @param string $encoding optional encoding; ignored + * @param string $haystack + * @param string $needle + * @param string $offset Optional start position + * @param string $encoding Optional encoding; ignored * @return int */ public static function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) { @@ -172,8 +172,8 @@ class Fallback { /** * Fallback implementation of mb_strrpos, hardcoded to UTF-8. - * @param $haystack String - * @param $needle String + * @param string $haystack + * @param string $needle * @param string $offset optional start position * @param string $encoding optional encoding; ignored * @return int diff --git a/includes/Feed.php b/includes/Feed.php index d5a95535f3..1b995195cb 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -53,11 +53,11 @@ class FeedItem { * Constructor * * @param string|Title $title Item's title - * @param $description String + * @param string $description * @param string $url URL uniquely designating the item. * @param string $date Item's date * @param string $author Author's user name - * @param $comments String + * @param string $comments */ function __construct( $title, $description, $url, $date = '', $author = '', $comments = '' ) { $this->title = $title; @@ -72,8 +72,8 @@ class FeedItem { /** * Encode $string so that it can be safely embedded in a XML document * - * @param string $string string to encode - * @return String + * @param string $string String to encode + * @return string */ public function xmlEncode( $string ) { $string = str_replace( "\r\n", "\n", $string ); @@ -84,7 +84,7 @@ class FeedItem { /** * Get the unique id of this item * - * @return String + * @return string */ public function getUniqueId() { if ( $this->uniqueId ) { @@ -95,8 +95,8 @@ class FeedItem { /** * set the unique id of an item * - * @param string $uniqueId unique id for the item - * @param $rssIsPermalink Boolean: set to true if the guid (unique id) is a permalink (RSS feeds only) + * @param string $uniqueId Unique id for the item + * @param bool $rssIsPermalink Set to true if the guid (unique id) is a permalink (RSS feeds only) */ public function setUniqueId( $uniqueId, $rssIsPermalink = false ) { $this->uniqueId = $uniqueId; @@ -106,7 +106,7 @@ class FeedItem { /** * Get the title of this item; already xml-encoded * - * @return String + * @return string */ public function getTitle() { return $this->xmlEncode( $this->title ); @@ -115,7 +115,7 @@ class FeedItem { /** * Get the URL of this item; already xml-encoded * - * @return String + * @return string */ public function getUrl() { return $this->xmlEncode( $this->url ); @@ -124,7 +124,7 @@ class FeedItem { /** * Get the description of this item; already xml-encoded * - * @return String + * @return string */ public function getDescription() { return $this->xmlEncode( $this->description ); @@ -133,7 +133,7 @@ class FeedItem { /** * Get the language of this item * - * @return String + * @return string */ public function getLanguage() { global $wgLanguageCode; @@ -143,7 +143,7 @@ class FeedItem { /** * Get the title of this item * - * @return String + * @return string */ public function getDate() { return $this->date; @@ -152,7 +152,7 @@ class FeedItem { /** * Get the author of this item; already xml-encoded * - * @return String + * @return string */ public function getAuthor() { return $this->xmlEncode( $this->author ); @@ -161,7 +161,7 @@ class FeedItem { /** * Get the comment of this item; already xml-encoded * - * @return String + * @return string */ public function getComments() { return $this->xmlEncode( $this->comments ); @@ -171,7 +171,7 @@ class FeedItem { * Quickie hack... strip out wikilinks to more legible form from the comment. * * @param string $text wikitext - * @return String + * @return string */ public static function stripComment( $text ) { return preg_replace( '/\[\[([^]]*\|)?([^]]+)\]\]/', '\2', $text ); @@ -190,7 +190,6 @@ abstract class ChannelFeed extends FeedItem { * @code * print ""; * @endcode - * @param $item */ abstract public function outHeader(); @@ -200,7 +199,7 @@ abstract class ChannelFeed extends FeedItem { * @code * print "..."; * @endcode - * @param $item + * @param FeedItem $item */ abstract public function outItem( $item ); @@ -274,8 +273,8 @@ class RSSFeed extends ChannelFeed { /** * Format a date given a timestamp * - * @param $ts Integer: timestamp - * @return String: date string + * @param int $ts Timestamp + * @return string Date string */ function formatTime( $ts ) { return gmdate( 'D, d M Y H:i:s \G\M\T', wfTimestamp( TS_UNIX, $ts ) ); @@ -301,7 +300,7 @@ class RSSFeed extends ChannelFeed { /** * Output an RSS 2.0 item - * @param $item FeedItem: item to be output + * @param FeedItem $item Item to be output */ function outItem( $item ) { ?> @@ -386,7 +385,7 @@ class AtomFeed extends ChannelFeed { /** * Output a given item. - * @param $item + * @param FeedItem $item */ function outItem( $item ) { global $wgMimeType; diff --git a/includes/HistoryBlob.php b/includes/HistoryBlob.php index a3ed7009e5..da54673df5 100644 --- a/includes/HistoryBlob.php +++ b/includes/HistoryBlob.php @@ -32,18 +32,18 @@ interface HistoryBlob * You must call setLocation() on the stub object before storing it to the * database * - * @param $text string + * @param string $text * - * @return String: the key for getItem() + * @return string The key for getItem() */ function addItem( $text ); /** * Get item by key, or false if the key is not present * - * @param $key string + * @param string $key * - * @return String or false + * @return string|bool */ function getItem( $key ); @@ -55,14 +55,14 @@ interface HistoryBlob * * Default text is not required for two-part external storage URLs. * - * @param $text string + * @param string $text */ function setText( $text ); /** * Get default text. This is called from Revision::getRevisionText() * - * @return String + * @return string */ function getText(); } @@ -88,7 +88,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $text string + * @param string $text * @return string */ public function addItem( $text ) { @@ -102,7 +102,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $hash string + * @param string $hash * @return array|bool */ public function getItem( $hash ) { @@ -115,7 +115,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob } /** - * @param $text string + * @param string $text * @return void */ public function setText( $text ) { @@ -134,7 +134,7 @@ class ConcatenatedGzipHistoryBlob implements HistoryBlob /** * Remove an item * - * @param $hash string + * @param string $hash */ public function removeItem( $hash ) { $this->mSize -= strlen( $this->mItems[$hash] ); @@ -200,8 +200,8 @@ class HistoryBlobStub { var $mOldId, $mHash, $mRef; /** - * @param string $hash the content hash of the text - * @param $oldid Integer the old_id for the CGZ object + * @param string $hash The content hash of the text + * @param int $oldid The old_id for the CGZ object */ function __construct( $hash = '', $oldid = 0 ) { $this->mHash = $hash; @@ -210,6 +210,7 @@ class HistoryBlobStub { /** * Sets the location (old_id) of the main object to which this object * points + * @param int $id */ function setLocation( $id ) { $this->mOldId = $id; @@ -217,6 +218,7 @@ class HistoryBlobStub { /** * Sets the location (old_id) of the referring object + * @param string $id */ function setReferrer( $id ) { $this->mRef = $id; @@ -224,6 +226,7 @@ class HistoryBlobStub { /** * Gets the location of the referring object + * @return string */ function getReferrer() { return $this->mRef; @@ -298,7 +301,7 @@ class HistoryBlobCurStub { var $mCurId; /** - * @param $curid Integer: the cur_id pointed to + * @param int $curid The cur_id pointed to */ function __construct( $curid = 0 ) { $this->mCurId = $curid; @@ -308,7 +311,7 @@ class HistoryBlobCurStub { * Sets the location (cur_id) of the main object to which this object * points * - * @param $id int + * @param int $id */ function setLocation( $id ) { $this->mCurId = $id; @@ -390,7 +393,7 @@ class DiffHistoryBlob implements HistoryBlob { /** * @throws MWException - * @param $text string + * @param string $text * @return int */ function addItem( $text ) { @@ -405,7 +408,7 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $key string + * @param string $key * @return string */ function getItem( $key ) { @@ -413,7 +416,7 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $text string + * @param string $text */ function setText( $text ) { $this->mDefaultKey = $this->addItem( $text ); @@ -502,8 +505,8 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $t1 - * @param $t2 + * @param string $t1 + * @param string $t2 * @return string */ function diff( $t1, $t2 ) { @@ -516,8 +519,8 @@ class DiffHistoryBlob implements HistoryBlob { } /** - * @param $base - * @param $diff + * @param string $base + * @param string $diff * @return bool|string */ function patch( $base, $diff ) { @@ -580,7 +583,7 @@ class DiffHistoryBlob implements HistoryBlob { * the bytes backwards and initialised with 0 instead of 1. See bug 34428. * * @param string $s - * @return string|bool: false if the hash extension is not available + * @return string|bool false if the hash extension is not available */ function xdiffAdler32( $s ) { if ( !function_exists( 'hash' ) ) { diff --git a/includes/Html.php b/includes/Html.php index b1d4f001af..2a8c9b1736 100644 --- a/includes/Html.php +++ b/includes/Html.php @@ -139,9 +139,9 @@ class Html { * Identical to rawElement(), but HTML-escapes $contents (like * Xml::element()). * - * @param $element string - * @param $attribs array - * @param $contents string + * @param string $element + * @param array $attribs + * @param string $contents * * @return string */ @@ -158,8 +158,8 @@ class Html { * Identical to rawElement(), but has no third parameter and omits the end * tag (and the self-closing '/' in XML mode for empty elements). * - * @param $element string - * @param $attribs array + * @param string $element + * @param array $attribs * * @return string */ @@ -267,7 +267,7 @@ class Html { * to the input array (currently per the HTML 5 draft as of 2009-09-06). * * @param string $element Name of the element, e.g., 'a' - * @param array $attribs Associative array of attributes, e.g., array( + * @param array $attribs Associative array of attributes, e.g., array( * 'href' => 'http://www.mediawiki.org/' ). See expandAttributes() for * further documentation. * @return array An array of attributes functionally identical to $attribs @@ -583,7 +583,7 @@ class Html { * Output a "". * - * @param $url string + * @param string $url * @return string Raw HTML */ public static function linkedScript( $url ) { @@ -598,7 +598,7 @@ class Html { * contains literal "" (admittedly unlikely). * * @param string $contents CSS - * @param $media mixed A media type string, like 'screen' + * @param string $media A media type string, like 'screen' * @return string Raw HTML */ public static function inlineStyle( $contents, $media = 'all' ) { @@ -618,8 +618,8 @@ class Html { * Output a "" linking to the given URL for the given * media type (if any). * - * @param $url string - * @param $media mixed A media type string, like 'screen' + * @param string $url + * @param string $media A media type string, like 'screen' * @return string Raw HTML */ public static function linkedStyle( $url, $media = 'all' ) { @@ -854,11 +854,11 @@ class Html { /** * Get HTML for an info box with an icon. * - * @param string $text wikitext, get this with wfMessage()->plain() - * @param string $icon icon name, file in skins/common/images - * @param string $alt alternate text for the icon - * @param string $class additional class name to add to the wrapper div - * @param $useStylePath + * @param string $text Wikitext, get this with wfMessage()->plain() + * @param string $icon Icon name, file in skins/common/images + * @param string $alt Alternate text for the icon + * @param string $class Additional class name to add to the wrapper div + * @param bool $useStylePath * * @return string */ diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index 1fd437ed1d..c9dd0c067f 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -55,7 +55,7 @@ class Http { * to avoid attacks on intranet services accessible by HTTP. * - userAgent A user agent, if you want to override the default * MediaWiki/$wgVersion - * @return Mixed: (bool)false on failure or a string on success + * @return string|bool (bool)false on failure or a string on success */ public static function request( $method, $url, $options = array() ) { wfDebug( "HTTP: $method: $url\n" ); @@ -85,9 +85,9 @@ class Http { * Simple wrapper for Http::request( 'GET' ) * @see Http::request() * - * @param $url - * @param $timeout string - * @param $options array + * @param string $url + * @param string $timeout + * @param array $options * @return string */ public static function get( $url, $timeout = 'default', $options = array() ) { @@ -99,8 +99,8 @@ class Http { * Simple wrapper for Http::request( 'POST' ) * @see Http::request() * - * @param $url - * @param $options array + * @param string $url + * @param array $options * @return string */ public static function post( $url, $options = array() ) { @@ -110,8 +110,8 @@ class Http { /** * Check if the URL can be served by localhost * - * @param string $url full url to check - * @return Boolean + * @param string $url Full url to check + * @return bool */ public static function isLocalURL( $url ) { global $wgCommandLineMode, $wgConf; @@ -150,7 +150,7 @@ class Http { /** * A standard user-agent we can use for external requests. - * @return String + * @return string */ public static function userAgent() { global $wgVersion; @@ -166,8 +166,8 @@ class Http { * * @todo FIXME this is wildly inaccurate and fails to actually check most stuff * - * @param $uri Mixed: URI to check for validity - * @return Boolean + * @param string $uri URI to check for validity + * @return bool */ public static function isValidURI( $uri ) { return preg_match( @@ -217,7 +217,7 @@ class MWHttpRequest { public $status; /** - * @param string $url url to use. If protocol-relative, will be expanded to an http:// URL + * @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL * @param array $options (optional) extra params to pass (see Http::request()) */ protected function __construct( $url, $options = array() ) { @@ -276,7 +276,7 @@ class MWHttpRequest { /** * Generate a new request object - * @param string $url url to use + * @param string $url Url to use * @param array $options (optional) extra params to pass (see Http::request()) * @throws MWException * @return CurlHttpRequest|PhpHttpRequest @@ -310,7 +310,7 @@ class MWHttpRequest { /** * Get the body, or content, of the response to the request * - * @return String + * @return string */ public function getContent() { return $this->content; @@ -319,7 +319,7 @@ class MWHttpRequest { /** * Set the parameters of the request * - * @param $args Array + * @param array $args * @todo overload the args param */ public function setData( $args ) { @@ -352,7 +352,7 @@ class MWHttpRequest { /** * Set the user agent - * @param $UA string + * @param string $UA */ public function setUserAgent( $UA ) { $this->setHeader( 'User-Agent', $UA ); @@ -360,8 +360,8 @@ class MWHttpRequest { /** * Set an arbitrary header - * @param $name - * @param $value + * @param string $name + * @param string $value */ public function setHeader( $name, $value ) { // I feel like I should normalize the case here... @@ -405,7 +405,7 @@ class MWHttpRequest { * bytes are reported handled than were passed to you, the HTTP fetch * will be aborted. * - * @param $callback Callback + * @param callable $callback * @throws MWException */ public function setCallback( $callback ) { @@ -419,8 +419,8 @@ class MWHttpRequest { * A generic callback to read the body of the response from a remote * server. * - * @param $fh handle - * @param $content String + * @param resource $fh + * @param string $content * @return int */ public function read( $fh, $content ) { @@ -507,7 +507,7 @@ class MWHttpRequest { * (see RFC2616, section 10, http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html * for a list of status codes.) * - * @return Integer + * @return int */ public function getStatus() { if ( !$this->respHeaders ) { @@ -520,7 +520,7 @@ class MWHttpRequest { /** * Returns true if the last status code was a redirect. * - * @return Boolean + * @return bool */ public function isRedirect() { if ( !$this->respHeaders ) { @@ -542,7 +542,7 @@ class MWHttpRequest { * (e.g. Set-Cookie) can appear more than once the, each value of * the associative array is an array of the values given. * - * @return Array + * @return array */ public function getResponseHeaders() { if ( !$this->respHeaders ) { @@ -555,8 +555,8 @@ class MWHttpRequest { /** * Returns the value of the given response header. * - * @param $header String - * @return String + * @param string $header + * @return string */ public function getResponseHeader( $header ) { if ( !$this->respHeaders ) { @@ -574,7 +574,7 @@ class MWHttpRequest { /** * Tells the MWHttpRequest object to use this pre-loaded CookieJar. * - * @param $jar CookieJar + * @param CookieJar $jar */ public function setCookieJar( $jar ) { $this->cookieJar = $jar; @@ -598,9 +598,9 @@ class MWHttpRequest { * cookies. Used internally after a request to parse the * Set-Cookie headers. * @see Cookie::set - * @param $name - * @param $value null - * @param $attr null + * @param string $name + * @param mixed $value + * @param array $attr */ public function setCookie( $name, $value = null, $attr = null ) { if ( !$this->cookieJar ) { @@ -705,8 +705,8 @@ class CurlHttpRequest extends MWHttpRequest { protected $headerText = ""; /** - * @param $fh - * @param $content + * @param resource $fh + * @param string $content * @return int */ protected function readHeader( $fh, $content ) { @@ -821,7 +821,7 @@ class CurlHttpRequest extends MWHttpRequest { class PhpHttpRequest extends MWHttpRequest { /** - * @param $url string + * @param string $url * @return string */ protected function urlToTcp( $url ) { diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a83217d5a2..8444223a50 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -40,7 +40,7 @@ class ImagePage extends Article { var $mExtraDescription = false; /** - * @param $title Title + * @param Title $title * @return WikiFilePage */ protected function newPage( Title $title ) { @@ -50,7 +50,7 @@ class ImagePage extends Article { /** * Constructor from a page id - * @param int $id article ID to load + * @param int $id Article ID to load * @return ImagePage|null */ public static function newFromID( $id ) { @@ -61,7 +61,7 @@ class ImagePage extends Article { } /** - * @param $file File: + * @param File $file * @return void */ public function setFile( $file ) { @@ -227,8 +227,8 @@ class ImagePage extends Article { /** * Create the TOC * - * @param $metadata Boolean: whether or not to show the metadata link - * @return String + * @param bool $metadata Whether or not to show the metadata link + * @return string */ protected function showTOC( $metadata ) { $r = array( @@ -250,8 +250,8 @@ class ImagePage extends Article { * * @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata(). * - * @param array $metadata the array containing the Exif data - * @return String The metadata table. This is treated as Wikitext (!) + * @param array $metadata The array containing the Exif data + * @return string The metadata table. This is treated as Wikitext (!) */ protected function makeMetadataTable( $metadata ) { $r = "