From d5737f8f17414320ed2332a6c2af59cca3d31d04 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 10 Jul 2012 16:58:52 +0200 Subject: [PATCH] update @param @return doc in several files Change-Id: I0e23227330f90dc4121fd2a313d2e9a33c3c97a7 --- includes/ChangesList.php | 12 +++++++----- includes/EditPage.php | 4 ++-- includes/Export.php | 2 ++ includes/Linker.php | 9 +++++++-- includes/LinksUpdate.php | 4 +--- includes/OutputPage.php | 4 ++-- includes/RecentChange.php | 2 +- includes/StringUtils.php | 2 +- includes/logging/LogEventsList.php | 2 +- includes/logging/PatrolLog.php | 2 +- includes/media/Generic.php | 1 + includes/objectcache/MemcachedBagOStuff.php | 1 + includes/parser/LinkHolderArray.php | 4 ++++ includes/parser/Parser.php | 4 ++-- includes/parser/ParserCache.php | 11 ++++++----- includes/specials/SpecialProtectedpages.php | 2 +- includes/specials/SpecialRevisiondelete.php | 3 +++ includes/specials/SpecialUploadStash.php | 6 +++--- includes/specials/SpecialUserlogin.php | 2 +- includes/upload/UploadBase.php | 3 +++ includes/upload/UploadStash.php | 10 ++++++---- 21 files changed, 56 insertions(+), 34 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index b37612f6b4..96a11e1b22 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -564,7 +564,9 @@ class OldChangesList extends ChangesList { /** * Format a line using the old system (aka without any javascript). * - * @param $rc RecentChange + * @param $rc RecentChange, passed by reference + * @param $watched Bool (default false) + * @param $linenumber Int (default null) * @return string */ public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) { @@ -1104,7 +1106,7 @@ class EnhancedChangesList extends ChangesList { * @param $dir String: one of '', 'd', 'l', 'r' * @param $alt String: text * @param $title String: text - * @return String: HTML tag + * @return String: HTML "" tag */ protected function arrow( $dir, $alt='', $title='' ) { global $wgStylePath; @@ -1117,7 +1119,7 @@ class EnhancedChangesList extends ChangesList { /** * Generate HTML for a right- or left-facing arrow, * depending on language direction. - * @return String: HTML tag + * @return String: HTML "" tag */ protected function sideArrow() { $dir = $this->getLanguage()->isRTL() ? 'l' : 'r'; @@ -1127,7 +1129,7 @@ class EnhancedChangesList extends ChangesList { /** * Generate HTML for a down-facing arrow * depending on language direction. - * @return String: HTML tag + * @return String: HTML "" tag */ protected function downArrow() { return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' )->text() ); @@ -1135,7 +1137,7 @@ class EnhancedChangesList extends ChangesList { /** * Generate HTML for a spacer image - * @return String: HTML tag + * @return String: HTML "" tag */ protected function spacerArrow() { return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space diff --git a/includes/EditPage.php b/includes/EditPage.php index 1376d579e4..5ce703ef34 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1515,7 +1515,7 @@ class EditPage { * @private * @todo document * - * @parma $editText string + * @param $editText string * * @return bool */ @@ -1582,7 +1582,7 @@ class EditPage { /** * Check given input text against $wgSpamRegex, and return the text of the first match. * - * @parma $text string + * @param $text string * * @return string|bool matching string or false */ diff --git a/includes/Export.php b/includes/Export.php index 92cfa1e4ee..2bef114ed1 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -726,6 +726,7 @@ class XmlDumpWriter { /** * @param $timestamp string + * @param $indent string Default to six spaces * @return string */ function writeTimestamp( $timestamp, $indent = " " ) { @@ -736,6 +737,7 @@ class XmlDumpWriter { /** * @param $id * @param $text string + * @param $indent string Default to six spaces * @return string */ function writeContributor( $id, $text, $indent = " " ) { diff --git a/includes/Linker.php b/includes/Linker.php index 526ad0c9ce..87cdd3faee 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -407,6 +407,11 @@ class Linker { * despite $query not being used. * * @param $nt Title + * @param $html String [optional] + * @param $query String [optional] + * @param $trail String [optional] + * @param $prefix String [optional] + * * * @return string */ @@ -1923,10 +1928,10 @@ class Linker { * Creates a (show/hide) link for deleting revisions/log entries * * @param $query Array: query parameters to be passed to link() - * @param $restricted Boolean: set to true to use a instead of a + * @param $restricted Boolean: set to true to use a "" instead of a "" * @param $delete Boolean: set to true to use (show/hide) rather than (show) * - * @return String: HTML link to Special:Revisiondelete, wrapped in a + * @return String: HTML "" link to Special:Revisiondelete, wrapped in a * span to allow for customization of appearance with CSS */ public static function revDeleteLink( $query = array(), $restricted = false, $delete = true ) { diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 0712ac807b..1d0bcf78d2 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -822,9 +822,7 @@ class LinksDeletionUpdate extends SqlDataUpdate { /** * Constructor * - * @param $title Title of the page we're updating - * @param $parserOutput ParserOutput: output from a full parse of this page - * @param $recursive Boolean: queue jobs for recursive updates? + * @param $page WikiPage Page we are updating */ function __construct( WikiPage $page ) { parent::__construct( ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a2023f50a9..d550cb6b13 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -804,7 +804,7 @@ class OutputPage extends ContextSource { /** * Set $mRedirectedFrom, the Title of the page which redirected us to the current page. * - * param @t Title + * @param $t Title */ public function setRedirectedFrom( $t ) { $this->mRedirectedFrom = $t; @@ -2880,7 +2880,7 @@ $templates /** * Add one or more variables to be set in mw.config in JavaScript. * - * @param $key {String|Array} Key or array of key/value pars. + * @param $keys {String|Array} Key or array of key/value pairs. * @param $value {Mixed} [optional] Value of the configuration variable. */ public function addJsConfigVars( $keys, $value = null ) { diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 3327826739..fb8e0224e2 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -158,7 +158,7 @@ class RecentChange { } /** - * @return bool|\Title + * @return bool|Title */ public function getMovedToTitle() { if( $this->mMovedToTitle === false ) { diff --git a/includes/StringUtils.php b/includes/StringUtils.php index 3b500ae911..43275a660f 100644 --- a/includes/StringUtils.php +++ b/includes/StringUtils.php @@ -213,7 +213,7 @@ class StringUtils { * Returns an Iterator * @param $separator * @param $subject - * @return ArrayIterator|\ExplodeIterator + * @return ArrayIterator|ExplodeIterator */ static function explode( $separator, $subject ) { if ( substr_count( $subject, $separator ) > 1000 ) { diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index ff5fc8a061..4d01caab80 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -364,7 +364,7 @@ class LogEventsList extends ContextSource { * @param $row * @param Title $title * @param Array $paramArray - * @param $comment + * @param String $comment Passed by reference * @return String */ private function logActionLinks( $row, $title, $paramArray, &$comment ) { diff --git a/includes/logging/PatrolLog.php b/includes/logging/PatrolLog.php index 4fc7637857..911fffc0e6 100644 --- a/includes/logging/PatrolLog.php +++ b/includes/logging/PatrolLog.php @@ -33,7 +33,7 @@ class PatrolLog { * * @param $rc Mixed: change identifier or RecentChange object * @param $auto Boolean: was this patrol event automatic? - * @param $performer User: user performing the action or null to use $wgUser + * @param $user User: user performing the action or null to use $wgUser * * @return bool */ diff --git a/includes/media/Generic.php b/includes/media/Generic.php index b41ac327f5..d0e7650c22 100644 --- a/includes/media/Generic.php +++ b/includes/media/Generic.php @@ -282,6 +282,7 @@ abstract class MediaHandler { * Returns false if unknown or if the document is not multi-page. * * @param $image File + * @param $page Unused, left for backcompatibility? * @return array */ function getPageDimensions( $image, $page ) { diff --git a/includes/objectcache/MemcachedBagOStuff.php b/includes/objectcache/MemcachedBagOStuff.php index 324b3a68b6..464e507bb1 100644 --- a/includes/objectcache/MemcachedBagOStuff.php +++ b/includes/objectcache/MemcachedBagOStuff.php @@ -86,6 +86,7 @@ class MemcachedBagOStuff extends BagOStuff { /** * @param $key string * @param $value int + * @param $exptime int (default 0) * @return Mixed */ public function add( $key, $value, $exptime = 0 ) { diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index def1aee4b0..02950f040b 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -209,6 +209,10 @@ class LinkHolderArray { * article length checks (for stub links) to be bundled into a single query. * * @param $nt Title + * @param $text String + * @param $query Array [optional] + * @param $trail String [optional] + * @param $prefix String [optional] * @return string */ function makeHolder( $nt, $text = '', $query = array(), $trail = '', $prefix = '' ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 23352fab4b..6f6ffe01ee 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3521,7 +3521,7 @@ class Parser { * Static function to get a template * Can be overridden via ParserOptions::setTemplateCallback(). * - * @parma $title Title + * @param $title Title * @param $parser Parser * * @return array @@ -3695,7 +3695,7 @@ class Parser { * Triple brace replacement -- used for template arguments * @private * - * @param $peice array + * @param $piece array * @param $frame PPFrame * * @return array diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index bb990397d3..6a4ef0c552 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -119,8 +119,9 @@ class ParserCache { * * @todo Document parameter $useOutdated * - * @param $article Article - * @param $popts ParserOptions + * @param $article Article + * @param $popts ParserOptions + * @param $useOutdated Boolean (default true) * @return bool|mixed|string */ public function getKey( $article, $popts, $useOutdated = true ) { @@ -157,9 +158,9 @@ class ParserCache { * Retrieve the ParserOutput from ParserCache. * false if not found or outdated. * - * @param $article Article - * @param $popts ParserOptions - * @param $useOutdated + * @param $article Article + * @param $popts ParserOptions + * @param $useOutdated Boolean (default false) * * @return ParserOutput|bool False on failure */ diff --git a/includes/specials/SpecialProtectedpages.php b/includes/specials/SpecialProtectedpages.php index d8fdbe7b90..5aa2b49c71 100644 --- a/includes/specials/SpecialProtectedpages.php +++ b/includes/specials/SpecialProtectedpages.php @@ -70,7 +70,7 @@ class SpecialProtectedpages extends SpecialPage { /** * Callback function to output a restriction - * @param $row object Protected title + * @param Title $row Protected title * @return string Formatted
  • element */ public function formatRow( $row ) { diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 83c723596d..fee870b3ea 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -597,6 +597,9 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { /** * Do the write operations. Simple wrapper for RevDel_*List::setVisibility(). + * @param $bitfield + * @param $reason + * @param $title * @return */ protected function save( $bitfield, $reason, $title ) { diff --git a/includes/specials/SpecialUploadStash.php b/includes/specials/SpecialUploadStash.php index 6052d094a6..1a00d7313b 100644 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@ -273,8 +273,8 @@ class SpecialUploadStash extends UnlistedSpecialPage { /** * Output HTTP response of raw content * Side effect: writes HTTP response to STDOUT. - * @param String $content: content - * @param String $mimeType: mime type + * @param $content String content + * @param $contentType String mime type * @return bool */ private function outputContents( $content, $contentType ) { @@ -322,7 +322,7 @@ class SpecialUploadStash extends UnlistedSpecialPage { /** * Default action when we don't have a subpage -- just show links to the uploads we have, * Also show a button to clear stashed files - * @param Status : $status - the result of processRequest + * @param $status [optional] Status: the result of processRequest * @return bool */ private function showUploads( $status = null ) { diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 7d91096f2c..613e3b9705 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -274,7 +274,7 @@ class LoginForm extends SpecialPage { /** * @private - * @return bool|\User + * @return bool|User */ function addNewAccountInternal() { global $wgAuth, $wgMemc, $wgAccountCreationThrottle, diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 8eb2781b95..243ca925ff 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -614,6 +614,9 @@ abstract class UploadBase { * Really perform the upload. Stores the file in the local repo, watches * if necessary and runs the UploadComplete hook. * + * @param $comment + * @param $pageText + * @param $watch * @param $user User * * @return Status indicating the whether the upload succeeded. diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 12531c290d..329ee22879 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -68,9 +68,11 @@ class UploadStash { /** * Represents a temporary filestore, with metadata in the database. - * Designed to be compatible with the session stashing code in UploadBase (should replace it eventually) + * Designed to be compatible with the session stashing code in UploadBase + * (should replace it eventually). * * @param $repo FileRepo + * @param $user User (default null) */ public function __construct( FileRepo $repo, $user = null ) { // this might change based on wiki's configuration. @@ -442,6 +444,7 @@ class UploadStash { * Helper function: do the actual database query to fetch file metadata. * * @param $key String: key + * @param $readFromDB: constant (default: DB_SLAVE) * @return boolean */ protected function fetchFileMetadata( $key, $readFromDB = DB_SLAVE ) { @@ -474,7 +477,6 @@ class UploadStash { /** * Helper function: Initialize the UploadStashFile for a given file. * - * @param $path String: path to file * @param $key String: key under which to store the object * @throws UploadStashZeroLengthFileException * @return bool @@ -574,8 +576,8 @@ class UploadStashFile extends UnregisteredLocalFile { /** * Helper function -- given a 'subpage', return the local URL e.g. /wiki/Special:UploadStash/subpage - * @param {String} $subPage - * @return {String} local URL for this subpage in the Special:UploadStash space. + * @param $subPage String + * @return String: local URL for this subpage in the Special:UploadStash space. */ private function getSpecialUrl( $subPage ) { return SpecialPage::getTitleFor( 'UploadStash', $subPage )->getLocalURL(); -- 2.20.1