r99715 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99714‎ | r99715 | r99716 >
Date:18:44, 13 October 2011
Author:reedy
Status:ok
Tags:fundraising 
Comment:
Documentation

Swap a lot of "@returns" to "@return"
Modified paths:
  • /trunk/extensions/Blahtex/Blahtex.php (modified) (history)
  • /trunk/extensions/Configure/handler/HandlerDb.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter2.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter3.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter4.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter6.php (modified) (history)
  • /trunk/extensions/InterwikiIntegration/InterwikiIntegrationChangesList.php (modified) (history)
  • /trunk/extensions/MetavidWiki/includes/articlepages/MV_DataPage.php (modified) (history)
  • /trunk/extensions/MobileFrontend/DeviceDetection.php (modified) (history)
  • /trunk/extensions/NewUserMessage/NewUserMessage.class.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.class.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/ReaderFeedbackXML.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php (modified) (history)
  • /trunk/extensions/ResumableUpload/ResumableUploadHandler.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_GanttChart.php (modified) (history)
  • /trunk/extensions/SemanticProjectManagement/includes/SPM_WBS.php (modified) (history)
  • /trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php (modified) (history)
  • /trunk/extensions/SimpleSurvey/SimpleSurvey.php (modified) (history)
  • /trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php (modified) (history)
  • /trunk/extensions/TitleBlacklist/TitleBlacklist.list.php (modified) (history)
  • /trunk/extensions/Wikilog/Wikilog.php (modified) (history)
  • /trunk/extensions/Wikilog/WikilogCommentsPage.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)
  • /trunk/phase3/includes/media/SVG.php (modified) (history)
  • /trunk/phase3/includes/revisiondelete/RevisionDeleter.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -169,7 +169,7 @@
170170 * Fetch initial editing page content.
171171 *
172172 * @param $def_text string
173 - * @returns mixed string on success, $def_text for invalid sections
 173+ * @return mixed string on success, $def_text for invalid sections
174174 * @private
175175 */
176176 function getContent( $def_text = '' ) {
Index: trunk/phase3/includes/revisiondelete/RevisionDeleter.php
@@ -65,10 +65,11 @@
6666 return $ret;
6767 }
6868
69 - // Get DB field name for URL param...
70 - // Future code for other things may also track
71 - // other types of revision-specific changes.
72 - // @returns string One of log_id/rev_id/fa_id/ar_timestamp/oi_archive_name
 69+ /** Get DB field name for URL param...
 70+ * Future code for other things may also track
 71+ * other types of revision-specific changes.
 72+ * @return string One of log_id/rev_id/fa_id/ar_timestamp/oi_archive_name
 73+ */
7374 public static function getRelationType( $typeName ) {
7475 if ( isset( SpecialRevisionDelete::$deprecatedTypeMap[$typeName] ) ) {
7576 $typeName = SpecialRevisionDelete::$deprecatedTypeMap[$typeName];
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -122,7 +122,7 @@
123123 /**
124124 * Get the end tag of a fieldset.
125125 *
126 - * @returns string
 126+ * @return string
127127 */
128128 protected function getFieldsetEnd() {
129129 return "</fieldset>\n";
Index: trunk/phase3/includes/media/SVG.php
@@ -119,7 +119,7 @@
120120 * @param string $dstPath
121121 * @param string $width
122122 * @param string $height
123 - * @returns TRUE/MediaTransformError
 123+ * @return true|MediaTransformError
124124 */
125125 public function rasterize( $srcPath, $dstPath, $width, $height ) {
126126 global $wgSVGConverters, $wgSVGConverter, $wgSVGConverterPath;
Index: trunk/phase3/includes/HttpFunctions.php
@@ -127,7 +127,7 @@
128128 * @fixme this is wildly inaccurate and fails to actually check most stuff
129129 *
130130 * @param $uri Mixed: URI to check for validity
131 - * @returns Boolean
 131+ * @return Boolean
132132 */
133133 public static function isValidURI( $uri ) {
134134 return preg_match(
@@ -525,7 +525,7 @@
526526 /**
527527 * Returns the cookie jar in use.
528528 *
529 - * @returns CookieJar
 529+ * @return CookieJar
530530 */
531531 public function getCookieJar() {
532532 if ( !$this->respHeaders ) {
@@ -571,7 +571,7 @@
572572 * Relative values of the "Location" header are incorrect as stated in RFC, however they do happen and modern browsers support them.
573573 * This function loops backwards through all locations in order to build the proper absolute URI - Marooned at wikia-inc.com
574574 *
575 - * @returns string
 575+ * @return string
576576 */
577577 public function getFinalUrl() {
578578 $headers = $this->getResponseHeaders();
Index: trunk/extensions/Configure/handler/HandlerDb.php
@@ -82,7 +82,7 @@
8383
8484 /**
8585 * Cache the data to the filesystem.
86 - * @returns int bytes
 86+ * @return int bytes
8787 */
8888 protected function cacheToFS( $data ) {
8989 global $wgConfigureFileSystemCache;
Index: trunk/extensions/Blahtex/Blahtex.php
@@ -244,7 +244,7 @@
245245 * blahtexOutputParser::parse() .
246246 * @param $node Node in the tree that the message is stored
247247 * under (string)
248 - * @returns HTML fragment with the error message (string)
 248+ * @return HTML fragment with the error message (string)
249249 */
250250 function blahtexError( $results, $node ) {
251251 $id = 'math_' . $results[$node . ":id"];
Index: trunk/extensions/SemanticProjectManagement/includes/SPM_WBS.php
@@ -71,7 +71,7 @@
7272 *
7373 * @param res SMWQueryResult, result set of the ask query provided by SMW
7474 * @param outputmode ?
75 - * @returns String, rendered HTML output of this printer for the ask-query
 75+ * @return String, rendered HTML output of this printer for the ask-query
7676 *
7777 */
7878 protected function getResultText($res, $outputmode) {
Index: trunk/extensions/SemanticProjectManagement/includes/SPM_GanttChart.php
@@ -82,7 +82,7 @@
8383 *
8484 * @param res SMWQueryResult, result set of the ask query provided by SMW
8585 * @param outputmode ?
86 - * @returns String, rendered HTML output of this printer for the ask-query
 86+ * @return String, rendered HTML output of this printer for the ask-query
8787 *
8888 */
8989 protected function getResultText($res, $outputmode) {
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter2.php
@@ -197,7 +197,7 @@
198198
199199 /**
200200 * Generates the donation footer ("There are other ways to give...")
201 - * @returns string of HTML
 201+ * @return string of HTML
202202 */
203203 public function generateDonationFooter() {
204204 global $wgScriptPath;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter3.php
@@ -197,7 +197,7 @@
198198
199199 /**
200200 * Generates the donation footer ("There are other ways to give...")
201 - * @returns string of HTML
 201+ * @return string of HTML
202202 */
203203 public function generateDonationFooter() {
204204 global $wgScriptPath;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter4.php
@@ -197,7 +197,7 @@
198198
199199 /**
200200 * Generates the donation footer ("There are other ways to give...")
201 - * @returns string of HTML
 201+ * @return string of HTML
202202 */
203203 public function generateDonationFooter() {
204204 global $wgScriptPath;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php
@@ -234,7 +234,7 @@
235235
236236 /**
237237 * Generates the donation footer ("There are other ways to give...")
238 - * @returns string of HTML
 238+ * @return string of HTML
239239 */
240240 public function generateDonationFooter() {
241241 global $wgScriptPath;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter6.php
@@ -250,7 +250,7 @@
251251
252252 /**
253253 * Generates the donation footer ("There are other ways to give...")
254 - * @returns string of HTML
 254+ * @return string of HTML
255255 */
256256 public function generateDonationFooter() {
257257 global $wgScriptPath;
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -115,7 +115,7 @@
116116
117117 /**
118118 * Generates the donation footer ("There are other ways to give...")
119 - * @returns string of HTML
 119+ * @return string of HTML
120120 */
121121 public function generateDonationFooter() {
122122 global $wgScriptPath;
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php
@@ -432,7 +432,7 @@
433433 }
434434
435435 /**
436 - * @returns This entry's raw line
 436+ * @return This entry's raw line
437437 */
438438 public function getRaw() {
439439 return $this->mRaw;
Index: trunk/extensions/TimedMediaHandler/WebVideoTranscode/WebVideoTranscode.php
@@ -153,7 +153,7 @@
154154 * @param $file File
155155 * @param $transcodeKey String
156156 *
157 - * @returns the local target encode path
 157+ * @return the local target encode path
158158 */
159159 static public function getTargetEncodePath( &$file, $transcodeKey ){
160160 // TODO probably should use some other temporary non-web accessible location for
@@ -271,7 +271,7 @@
272272 * @param {Object} File object
273273 * @param {Object} Options, a set of options:
274274 * 'nodata' Strips the data- attribute, useful when your output is not html
275 - * @returns an associative array of sources suitable for <source> tag output
 275+ * @return an associative array of sources suitable for <source> tag output
276276 */
277277 static public function getLocalSources( &$file , $options=array() ){
278278 global $wgEnabledTranscodeSet, $wgEnableTranscode, $wgLang;
Index: trunk/extensions/ResumableUpload/ResumableUploadHandler.php
@@ -29,7 +29,7 @@
3030 * @param $pageText string
3131 * @param $watchlist bodolean
3232 *
33 - * @returns string the session key for this chunked upload
 33+ * @return string the session key for this chunked upload
3434 */
3535 public function setupChunkSession( $comment, $pageText, $watchlist ) {
3636 if ( !isset( $this->sessionKey ) ) {
@@ -101,7 +101,7 @@
102102 * @param $request WebRequest
103103 * @param $fileSize int Size of this chunk
104104 *
105 - * @returns void
 105+ * @return void
106106 */
107107 protected function initFromSessionKey( $sessionKey, $sessionData, $fileSize ) {
108108 // testing against null because we don't want to cause obscure
Index: trunk/extensions/NewUserMessage/NewUserMessage.class.php
@@ -17,7 +17,7 @@
1818
1919 /**
2020 * Produce the editor for new user messages.
21 - * @returns User
 21+ * @return User
2222 */
2323 static function fetchEditor() {
2424 // Create a user object for the editing user and add it to the
@@ -37,7 +37,7 @@
3838
3939 /**
4040 * Produce a (possibly random) signature.
41 - * @returns String
 41+ * @return String
4242 */
4343 static function fetchSignature() {
4444 $signatures = wfMsgForContent( 'newusermessage-signatures' );
@@ -58,7 +58,7 @@
5959
6060 /**
6161 * Return the template name if it exists, or '' otherwise.
62 - * @returns string
 62+ * @return string
6363 */
6464 static function fetchTemplateIfExists( $template ) {
6565 $text = Title::newFromText( $template );
@@ -78,7 +78,7 @@
7979
8080 /**
8181 * Produce a subject for the message.
82 - * @returns String
 82+ * @return String
8383 */
8484 static function fetchSubject() {
8585 return self::fetchTemplateIfExists( wfMsg( 'newusermessage-template-subject' ) );
@@ -86,7 +86,7 @@
8787
8888 /**
8989 * Produce the template that contains the text of the message.
90 - * @returns String
 90+ * @return String
9191 */
9292 static function fetchText() {
9393 $template = wfMsg( 'newusermessage-template-body' );
@@ -102,7 +102,7 @@
103103
104104 /**
105105 * Produce the flags to set on Article::doEdit
106 - * @returns Int
 106+ * @return Int
107107 */
108108 static function fetchFlags() {
109109 global $wgNewUserMinorEdit, $wgNewUserSuppressRC;
@@ -121,7 +121,7 @@
122122 * @param $editor User
123123 * @param $talk Article
124124 * @param $preparse if provided, then preparse the string using a Parser
125 - * @returns String
 125+ * @return String
126126 */
127127 static private function substString( $str, $user, $editor, $talk, $preparse = null ) {
128128 $realName = $user->getRealName();
Index: trunk/extensions/SimpleSurvey/SimpleSurvey.php
@@ -92,5 +92,3 @@
9393 }
9494 unset( $survey );
9595
96 -
97 -
Index: trunk/extensions/SemanticResultFormats/GraphViz/SRF_Process.php
@@ -158,7 +158,7 @@
159159 *
160160 * @param res SMWQueryResult, result set of the ask query provided by SMW
161161 * @param outputmode ?
162 - * @returns String, rendered HTML output of this printer for the ask-query
 162+ * @return String, rendered HTML output of this printer for the ask-query
163163 *
164164 */
165165 protected function getResultText( SMWQueryResult $res, $outputmode ) {
Index: trunk/extensions/InterwikiIntegration/InterwikiIntegrationChangesList.php
@@ -183,7 +183,7 @@
184184 * Show formatted char difference
185185 * @param $old Integer: bytes
186186 * @param $new Integer: bytes
187 - * @returns String
 187+ * @return String
188188 */
189189 public static function showCharacterDifference( $old, $new ) {
190190 global $wgRCChangedSizeThreshold, $wgLang, $wgMiserMode;
Index: trunk/extensions/MobileFrontend/DeviceDetection.php
@@ -14,6 +14,9 @@
1515 // may be extended to provide access to particular devices functionality
1616 class DeviceDetection {
1717
 18+ /**
 19+ * @return array
 20+ */
1821 public function availableFormats() {
1922 $formats = array (
2023 'html' => array (
Index: trunk/extensions/Wikilog/Wikilog.php
@@ -406,7 +406,7 @@
407407 * namespace, and returns an appropriate WikilogInfo instance if so.
408408 *
409409 * @param $title Article title object.
410 - * @returns WikilogInfo instance, or NULL.
 410+ * @return WikilogInfo instance, or NULL.
411411 */
412412 static function getWikilogInfo( $title ) {
413413 global $wgWikilogNamespaces;
Index: trunk/extensions/Wikilog/WikilogCommentsPage.php
@@ -496,7 +496,7 @@
497497 /**
498498 * Checks if the given comment is valid for posting.
499499 * @param $comment Comment to validate.
500 - * @returns False if comment is valid, error message identifier otherwise.
 500+ * @return False if comment is valid, error message identifier otherwise.
501501 */
502502 protected static function validateComment( WikilogComment &$comment ) {
503503 global $wgWikilogMaxCommentSize;
Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_DataPage.php
@@ -84,7 +84,7 @@
8585 }
8686 /*
8787 * function article top
88 - * @returns MV dataPage top html
 88+ * @return MV dataPage top html
8989 */
9090 function mvArticleTop() {
9191 global $mvgIP, $wgUser;
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php
@@ -62,7 +62,7 @@
6363 /**
6464 * Is this a view page action?
6565 * @param $action string
66 - * @returns bool
 66+ * @return bool
6767 */
6868 protected static function isViewAction( $action ) {
6969 return ( $action == 'view' || $action == 'purge' || $action == 'render' );
Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php
@@ -205,7 +205,7 @@
206206 * Generate an HTML table for this tag
207207 * @param string $tag
208208 * @param string $filePath
209 - * @returns string, html table
 209+ * @return string, html table
210210 */
211211 public function makeHTMLTable( $tag, $filePath ) {
212212 $dir = dirname($filePath);
@@ -255,7 +255,7 @@
256256 * Generate a graph for this tag
257257 * @param string $tag
258258 * @param string $filePath
259 - * @returns bool, success
 259+ * @return bool, success
260260 */
261261 public function makePngGraph( $tag, $filePath ) {
262262 if( !function_exists( 'ImageCreate' ) ) {
@@ -355,7 +355,7 @@
356356 * Generate a graph for this tag
357357 * @param string $tag
358358 * @param string $filePath
359 - * @returns bool, success
 359+ * @return bool, success
360360 */
361361 public function makeSvgGraph( $tag, $filePath ) {
362362 global $wgSvgGraphDir, $wgContLang, $wgMemc;
@@ -548,7 +548,7 @@
549549 * Get the path to where the corresponding graph file should be
550550 * @param string $tag
551551 * @param string $ext
552 - * @returns string
 552+ * @return string
553553 */
554554 public function getFilePath( $tag, $ext='' ) {
555555 global $wgUploadDirectory;
@@ -560,7 +560,7 @@
561561 * Get the url to where the corresponding graph file should be
562562 * @param string $tag
563563 * @param string $ext
564 - * @returns string
 564+ * @return string
565565 */
566566 public function getUrlPath( $tag, $ext='' ) {
567567 global $wgUploadPath;
@@ -689,7 +689,7 @@
690690 * Check if a graph file is expired. Set $this->dScale.
691691 * @param string $tag
692692 * @param string $path, filepath to existing file
693 - * @returns string
 693+ * @return string
694694 */
695695 protected function fileExpired( $tag, $path ) {
696696 global $wgMemc;
@@ -721,7 +721,7 @@
722722 /**
723723 * Get highest touch timestamp of the tags. This uses a tiny filesort.
724724 * @param $page Title
725 - * @returns string
 725+ * @return string
726726 */
727727 public static function getTouched( $page ) {
728728 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php
@@ -26,7 +26,7 @@
2727
2828 /**
2929 * Get the array of tag feedback tags
30 - * @returns array
 30+ * @return array
3131 */
3232 public static function getFeedbackTags() {
3333 self::load();
@@ -36,7 +36,7 @@
3737 /**
3838 * Get the weight of a feedback tag
3939 * @param string $tag
40 - * @returns array
 40+ * @return array
4141 */
4242 public static function getFeedbackWeight( $tag ) {
4343 self::load();
@@ -45,7 +45,7 @@
4646
4747 /**
4848 * Get the number of reviews that is considered a good sample
49 - * @returns int
 49+ * @return int
5050 */
5151 public static function getFeedbackSize() {
5252 global $wgFeedbackSizeThreshhold;
@@ -79,7 +79,7 @@
8080
8181 /**
8282 * Purge outdated page average data
83 - * @returns bool
 83+ * @return bool
8484 */
8585 public static function purgeExpiredAverages() {
8686 global $wgFeedbackAge;
@@ -108,7 +108,7 @@
109109 /**
110110 * Expand feedback ratings into an array
111111 * @param string $ratings
112 - * @returns Array
 112+ * @return Array
113113 */
114114 public static function expandRatings( $rating ) {
115115 $dims = array();
@@ -128,7 +128,7 @@
129129 * @param int $period, number of days back
130130 * @param array $add, optional vote to add on (used to visually avoid lag)
131131 * @param string $cache, optional param to not use cache
132 - * @returns string HTML table
 132+ * @return string HTML table
133133 */
134134 public static function getVoteAggregates(
135135 $page, $period, $add = array(), $cache = 'useCache'
Index: trunk/extensions/ReaderFeedback/ReaderFeedbackXML.php
@@ -5,7 +5,7 @@
66 * Get a selector of rateable namespaces
77 * @param int $selected, namespace selected
88 * @param $all Mixed: Value of an item denoting all namespaces, or null to omit
9 - * @returns string
 9+ * @return string
1010 */
1111 public static function getNamespaceMenu( $selected=null, $all=null ) {
1212 global $wgContLang, $wgFeedbackNamespaces;
@@ -42,7 +42,7 @@
4343 /**
4444 * Get tag dropdown select
4545 * @param int $selected, selected level
46 - * @returns string
 46+ * @return string
4747 */
4848 public static function getTagMenu( $selected = '' ) {
4949 $s = "<label for='wpRatingTag'>" . wfMsgHtml('readerfeedback-tagfilter') . "</label>&#160;";
@@ -57,7 +57,7 @@
5858 /**
5959 * Get rating tier dropdown select
6060 * @param int $selected, selected tier
61 - * @returns string
 61+ * @return string
6262 */
6363 public static function getRatingTierMenu( $selected = '' ) {
6464 $s = "<label for='wpRatingTier'>" . wfMsgHtml('readerfeedback-tierfilter') . "</label>&#160;";

Status & tagging log