r111103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111102‎ | r111103 | r111104 >
Date:21:36, 9 February 2012
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
More return documentation
Modified paths:
  • /trunk/phase3/includes/QueryPage.php (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)
  • /trunk/phase3/includes/RevisionList.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinLegacy.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)
  • /trunk/phase3/includes/Status.php (modified) (history)
  • /trunk/phase3/includes/StubObject.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/UserRightsProxy.php (modified) (history)
  • /trunk/phase3/includes/WikiFilePage.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/Xml.php (modified) (history)
  • /trunk/phase3/includes/ZipDirectoryReader.php (modified) (history)
  • /trunk/phase3/includes/revisiondelete/RevisionDelete.php (modified) (history)
  • /trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php (modified) (history)
  • /trunk/phase3/includes/search/SearchEngine.php (modified) (history)
  • /trunk/phase3/includes/search/SearchIBM_DB2.php (modified) (history)
  • /trunk/phase3/includes/search/SearchMssql.php (modified) (history)
  • /trunk/phase3/includes/search/SearchMySQL.php (modified) (history)
  • /trunk/phase3/includes/search/SearchOracle.php (modified) (history)
  • /trunk/phase3/includes/search/SearchPostgres.php (modified) (history)
  • /trunk/phase3/includes/search/SearchSqlite.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBlock.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBooksources.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialExport.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialJavaScriptTest.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialLinkSearch.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPrefixindex.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedtitles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnblock.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnusedcategories.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUploadStash.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialWantedfiles.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromChunks.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromFile.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadFromUrl.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadStash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadFromUrl.php
@@ -180,6 +180,7 @@
181181 /**
182182 * Wrapper around the parent function in order to defer verifying the
183183 * upload until the file really has been fetched.
 184+ * @return array|mixed
184185 */
185186 public function verifyUpload() {
186187 if ( $this->mAsync ) {
@@ -191,6 +192,7 @@
192193 /**
193194 * Wrapper around the parent function in order to defer checking warnings
194195 * until the file really has been fetched.
 196+ * @return Array
195197 */
196198 public function checkWarnings() {
197199 if ( $this->mAsync ) {
@@ -203,6 +205,7 @@
204206 /**
205207 * Wrapper around the parent function in order to defer checking protection
206208 * until we are sure that the file can actually be uploaded
 209+ * @return bool|mixed
207210 */
208211 public function verifyTitlePermissions( $user ) {
209212 if ( $this->mAsync ) {
@@ -214,6 +217,7 @@
215218 /**
216219 * Wrapper around the parent function in order to defer uploading to the
217220 * job queue for asynchronous uploads
 221+ * @return Status
218222 */
219223 public function performUpload( $comment, $pageText, $watch, $user ) {
220224 if ( $this->mAsync ) {
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -64,6 +64,7 @@
6565 /**
6666 * Returns true if uploads are enabled.
6767 * Can be override by subclasses.
 68+ * @return bool
6869 */
6970 public static function isEnabled() {
7071 global $wgEnableUploads;
@@ -82,6 +83,7 @@
8384 * Can be overriden by subclasses.
8485 *
8586 * @param $user User
 87+ * @return bool
8688 */
8789 public static function isAllowed( $user ) {
8890 foreach ( array( 'upload', 'edit' ) as $permission ) {
@@ -100,6 +102,7 @@
101103 *
102104 * @param $request WebRequest
103105 * @param $type
 106+ * @return null
104107 */
105108 public static function createFromRequest( &$request, $type = null ) {
106109 $type = $type ? $type : $request->getVal( 'wpSourceType', 'File' );
@@ -140,6 +143,7 @@
141144
142145 /**
143146 * Check whether a request if valid for this handler
 147+ * @return bool
144148 */
145149 public static function isValidRequest( $request ) {
146150 return false;
@@ -180,6 +184,7 @@
181185
182186 /**
183187 * Fetch the file. Usually a no-op
 188+ * @return Status
184189 */
185190 public function fetchFile() {
186191 return Status::newGood();
@@ -984,6 +989,7 @@
985990
986991 /**
987992 * @todo Replace this with a whitelist filter!
 993+ * @return bool
988994 */
989995 public function checkSvgScriptCallback( $element, $attribs ) {
990996 $stripped = $this->stripXmlNamespace( $element );
@@ -1249,6 +1255,7 @@
12501256
12511257 /**
12521258 * Helper function that checks whether the filename looks like a thumbnail
 1259+ * @return bool
12531260 */
12541261 public static function isThumbName( $filename ) {
12551262 $n = strrpos( $filename, '.' );
Index: trunk/phase3/includes/upload/UploadFromChunks.php
@@ -129,6 +129,7 @@
130130 /**
131131 * Returns the virtual chunk location:
132132 * @param $index
 133+ * @return string
133134 */
134135 function getVirtualChunkLocation( $index ){
135136 return $this->repo->getVirtualUrl( 'temp' ) .
@@ -241,6 +242,7 @@
242243 * Output the chunk to disk
243244 *
244245 * @param $chunkPath string
 246+ * @return \FileRepoStatus
245247 */
246248 private function outputChunk( $chunkPath ){
247249 // Key is fileKey + chunk index
Index: trunk/phase3/includes/upload/UploadStash.php
@@ -391,6 +391,7 @@
392392 * with an extension.
393393 * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming
394394 * uploads versus the desired filename. Maybe we can get that passed to us...
 395+ * @return string
395396 */
396397 public static function getExtensionForPath( $path ) {
397398 // Does this have an extension?
Index: trunk/phase3/includes/upload/UploadFromFile.php
@@ -14,6 +14,7 @@
1515
1616 /**
1717 * @param $request WebRequest
 18+ * @return null
1819 */
1920 function initializeFromRequest( &$request ) {
2021 $upload = $request->getUpload( 'wpUploadFile' );
@@ -28,6 +29,7 @@
2930 * Initialize from a filename and a WebRequestUpload
3031 * @param $name
3132 * @param $webRequestUpload
 33+ * @return null
3234 */
3335 function initialize( $name, $webRequestUpload ) {
3436 $this->mUpload = $webRequestUpload;
Index: trunk/phase3/includes/Xml.php
@@ -40,6 +40,7 @@
4141 * The values are passed to Sanitizer::encodeAttribute.
4242 * Return null if no attributes given.
4343 * @param $attribs Array of attributes for an XML element
 44+ * @return null|string
4445 */
4546 public static function expandAttributes( $attribs ) {
4647 $out = '';
Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -276,6 +276,7 @@
277277 * Get the group that the special page belongs in on Special:SpecialPage
278278 *
279279 * @param $page SpecialPage
 280+ * @return String
280281 */
281282 public static function getGroup( &$page ) {
282283 $name = $page->getName();
Index: trunk/phase3/includes/search/SearchEngine.php
@@ -65,6 +65,7 @@
6666 /**
6767 * If this search backend can list/unlist redirects
6868 * @deprecated since 1.18 Call supports( 'list-redirects' );
 69+ * @return bool
6970 */
7071 function acceptListRedirects() {
7172 wfDeprecated( __METHOD__, '1.18' );
@@ -147,6 +148,7 @@
148149
149150 /**
150151 * Really find the title match.
 152+ * @return null|\Title
151153 */
152154 private static function getNearMatchInternal( $searchterm ) {
153155 global $wgContLang, $wgEnableSearchContributorsByIP;
@@ -287,6 +289,7 @@
288290 * or namespace names
289291 *
290292 * @param $query String
 293+ * @return string
291294 */
292295 function replacePrefixes( $query ) {
293296 global $wgContLang;
@@ -391,6 +394,7 @@
392395 * and preferences
393396 *
394397 * @param $namespaces Array
 398+ * @return array
395399 */
396400 public static function namespacesAsText( $namespaces ) {
397401 global $wgContLang;
@@ -1185,6 +1189,7 @@
11861190 * Do manual case conversion for non-ascii chars
11871191 *
11881192 * @param $matches Array
 1193+ * @return string
11891194 */
11901195 function caseCallback( $matches ) {
11911196 global $wgContLang;
@@ -1305,6 +1310,7 @@
13061311 /**
13071312 * Basic wikitext removal
13081313 * @protected
 1314+ * @return mixed
13091315 */
13101316 function removeWiki( $text ) {
13111317 $fname = __METHOD__;
Index: trunk/phase3/includes/search/SearchMySQL.php
@@ -308,6 +308,7 @@
309309
310310 /**
311311 * @since 1.18 (changed)
 312+ * @return array
312313 */
313314 function getCountQuery( $filteredTerm, $fulltext ) {
314315 $match = $this->parseQuery( $filteredTerm, $fulltext );
@@ -365,6 +366,7 @@
366367 /**
367368 * Converts some characters for MySQL's indexing to grok it correctly,
368369 * and pads short words to overcome limitations.
 370+ * @return mixed|string
369371 */
370372 function normalizeText( $string ) {
371373 global $wgContLang;
@@ -412,6 +414,7 @@
413415 * Armor a case-folded UTF-8 string to get through MySQL's
414416 * fulltext search without being mucked up by funny charset
415417 * settings or anything else of the sort.
 418+ * @return string
416419 */
417420 protected function stripForSearchCallback( $matches ) {
418421 return 'u8' . bin2hex( $matches[1] );
Index: trunk/phase3/includes/search/SearchOracle.php
@@ -147,6 +147,7 @@
148148 * The guts shoulds be constructed in queryMain()
149149 * @param $filteredTerm String
150150 * @param $fulltext Boolean
 151+ * @return String
151152 */
152153 function getQuery( $filteredTerm, $fulltext ) {
153154 return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
@@ -184,6 +185,7 @@
185186 /**
186187 * Parse a user input search string, and return an SQL fragment to be used
187188 * as part of a WHERE clause
 189+ * @return string
188190 */
189191 function parseQuery($filteredText, $fulltext) {
190192 global $wgContLang;
Index: trunk/phase3/includes/search/SearchPostgres.php
@@ -146,6 +146,7 @@
147147 * @param $term String
148148 * @param $fulltext String
149149 * @param $colname
 150+ * @return string
150151 */
151152 function searchQuery( $term, $fulltext, $colname ) {
152153 # Get the SQL fragment for the given term
Index: trunk/phase3/includes/search/SearchIBM_DB2.php
@@ -111,6 +111,7 @@
112112 * The guts shoulds be constructed in queryMain()
113113 * @param $filteredTerm String
114114 * @param $fulltext Boolean
 115+ * @return String
115116 */
116117 function getQuery( $filteredTerm, $fulltext ) {
117118 return $this->queryLimit($this->queryMain($filteredTerm, $fulltext) . ' ' .
@@ -145,7 +146,9 @@
146147 'WHERE page_id=si_page AND ' . $match;
147148 }
148149
149 - /** @todo document */
 150+ /** @todo document
 151+ * @return string
 152+ */
150153 function parseQuery($filteredText, $fulltext) {
151154 global $wgContLang;
152155 $lc = SearchEngine::legalSearchChars();
Index: trunk/phase3/includes/search/SearchMssql.php
@@ -115,6 +115,7 @@
116116 *
117117 * @param $filteredTerm String
118118 * @param $fulltext Boolean
 119+ * @return String
119120 */
120121 function getQuery( $filteredTerm, $fulltext ) {
121122 return $this->queryLimit( $this->queryMain( $filteredTerm, $fulltext ) . ' ' .
@@ -151,7 +152,9 @@
152153 'WHERE page_id=ftindex.[KEY] ';
153154 }
154155
155 - /** @todo document */
 156+ /** @todo document
 157+ * @return string
 158+ */
156159 function parseQuery( $filteredText, $fulltext ) {
157160 global $wgContLang;
158161 $lc = SearchEngine::legalSearchChars();
@@ -189,6 +192,7 @@
190193 * @param $id Integer
191194 * @param $title String
192195 * @param $text String
 196+ * @return bool|\ResultWrapper
193197 */
194198 function update( $id, $title, $text ) {
195199 // We store the column data as UTF-8 byte order marked binary stream
@@ -211,6 +215,7 @@
212216 *
213217 * @param $id Integer
214218 * @param $title String
 219+ * @return bool|\ResultWrapper
215220 */
216221 function updateTitle( $id, $title ) {
217222 $table = $this->db->tableName( 'searchindex' );
Index: trunk/phase3/includes/search/SearchSqlite.php
@@ -238,6 +238,7 @@
239239 * The guts shoulds be constructed in queryMain()
240240 * @param $filteredTerm String
241241 * @param $fulltext Boolean
 242+ * @return String
242243 */
243244 function getQuery( $filteredTerm, $fulltext ) {
244245 return $this->limitResult(
Index: trunk/phase3/includes/Status.php
@@ -28,6 +28,7 @@
2929 * Factory function for fatal errors
3030 *
3131 * @param $message String: message name
 32+ * @return Status
3233 */
3334 static function newFatal( $message /*, parameters...*/ ) {
3435 $params = func_get_args();
@@ -41,6 +42,7 @@
4243 * Factory function for good results
4344 *
4445 * @param $value Mixed
 46+ * @return Status
4547 */
4648 static function newGood( $value = null ) {
4749 $result = new self;
Index: trunk/phase3/includes/WikiFilePage.php
@@ -148,6 +148,7 @@
149149
150150 /**
151151 * Override handling of action=purge
 152+ * @return bool
152153 */
153154 public function doPurge() {
154155 $this->loadFile();
Index: trunk/phase3/includes/StubObject.php
@@ -52,6 +52,7 @@
5353 *
5454 * @param $name String: name of the function called
5555 * @param $args Array: arguments
 56+ * @return mixed
5657 */
5758 function _call( $name, $args ) {
5859 $this->_unstub( $name, 5 );
@@ -72,6 +73,7 @@
7374 *
7475 * @param $name String: name of the function called
7576 * @param $args Array: arguments
 77+ * @return mixed
7678 */
7779 function __call( $name, $args ) {
7880 return $this->_call( $name, $args );
Index: trunk/phase3/includes/UserMailer.php
@@ -300,6 +300,7 @@
301301 /**
302302 * Converts a string into quoted-printable format
303303 * @since 1.17
 304+ * @return string
304305 */
305306 public static function quotedPrintable( $string, $charset = '' ) {
306307 # Probably incomplete; see RFC 2045
@@ -705,6 +706,7 @@
706707 /**
707708 * Same as sendPersonalised but does impersonal mail suitable for bulk
708709 * mailing. Takes an array of MailAddress objects.
 710+ * @return Status
709711 */
710712 function sendImpersonal( $addresses ) {
711713 global $wgContLang;
Index: trunk/phase3/includes/revisiondelete/RevisionDelete.php
@@ -191,6 +191,7 @@
192192 /**
193193 * Get the HTML link to the revision text.
194194 * Overridden by RevDel_ArchiveItem.
 195+ * @return string
195196 */
196197 protected function getRevisionLink() {
197198 $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true );
@@ -211,6 +212,7 @@
212213 /**
213214 * Get the HTML link to the diff.
214215 * Overridden by RevDel_ArchiveItem
 216+ * @return string
215217 */
216218 protected function getDiffLink() {
217219 if ( $this->isDeleted() && !$this->canViewContent() ) {
@@ -569,6 +571,7 @@
570572 /**
571573 * Get the link to the file.
572574 * Overridden by RevDel_ArchivedFileItem.
 575+ * @return string
573576 */
574577 protected function getLink() {
575578 $date = $this->list->getLanguage()->timeanddate( $this->file->getTimestamp(), true );
Index: trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php
@@ -16,6 +16,7 @@
1717 * Get the DB field name associated with the ID list.
1818 * This used to populate the log_search table for finding log entries.
1919 * Override this function.
 20+ * @return null
2021 */
2122 public static function getRelationType() {
2223 return null;
@@ -189,6 +190,7 @@
190191
191192 /**
192193 * Get the log action for this list type
 194+ * @return string
193195 */
194196 public function getLogAction() {
195197 return 'revision';
@@ -247,6 +249,7 @@
248250 * Returns true if the item is "current", and the operation to set the given
249251 * bits can't be executed for that reason
250252 * STUB
 253+ * @return bool
251254 */
252255 public function isHideCurrentOp( $newBits ) {
253256 return false;
Index: trunk/phase3/includes/Revision.php
@@ -321,6 +321,7 @@
322322 /**
323323 * Return the list of revision fields that should be selected to create
324324 * a new revision.
 325+ * @return array
325326 */
326327 public static function selectFields() {
327328 return array(
@@ -342,6 +343,7 @@
343344 /**
344345 * Return the list of text fields that should be selected to read the
345346 * revision text
 347+ * @return array
346348 */
347349 public static function selectTextFields() {
348350 return array(
@@ -352,6 +354,7 @@
353355
354356 /**
355357 * Return the list of page fields that should be selected from page table
 358+ * @return array
356359 */
357360 public static function selectPageFields() {
358361 return array(
@@ -364,6 +367,7 @@
365368
366369 /**
367370 * Return the list of user fields that should be selected from user table
 371+ * @return array
368372 */
369373 public static function selectUserFields() {
370374 return array( 'user_name' );
Index: trunk/phase3/includes/Title.php
@@ -863,6 +863,7 @@
864864 * This is MUCH simpler than individually testing for equivilance
865865 * against both NS_USER and NS_USER_TALK, and is also forward compatible.
866866 * @since 1.19
 867+ * @return bool
867868 */
868869 public function hasSubjectNamespace( $ns ) {
869870 return MWNamespace::subjectEquals( $this->getNamespace(), $ns );
@@ -1226,6 +1227,7 @@
12271228 * andthe wfArrayToCGI moved to getLocalURL();
12281229 *
12291230 * @since 1.19 (r105919)
 1231+ * @return String
12301232 */
12311233 private static function fixUrlQueryArgs( $query, $query2 = false ) {
12321234 if( $query2 !== false ) {
@@ -1478,6 +1480,7 @@
14791481 *
14801482 * @see self::getLocalURL
14811483 * @since 1.18
 1484+ * @return string
14821485 */
14831486 public function escapeCanonicalURL( $query = '', $query2 = false ) {
14841487 wfDeprecated( __METHOD__, '1.19' );
Index: trunk/phase3/includes/SkinLegacy.php
@@ -84,6 +84,7 @@
8585 /**
8686 * This will be called immediately after the <body> tag. Split into
8787 * two functions to make it easier to subclass.
 88+ * @return string
8889 */
8990 function beforeContent() {
9091 return $this->doBeforeContent();
@@ -152,7 +153,9 @@
153154 return $this->doAfterContent();
154155 }
155156
156 - /** overloaded by derived classes */
 157+ /** overloaded by derived classes
 158+ * @return string
 159+ */
157160 function doAfterContent() {
158161 return '</div></div>';
159162 }
@@ -388,6 +391,7 @@
389392
390393 /**
391394 * Show a drop-down box of special pages
 395+ * @return string
392396 */
393397 function specialPagesList() {
394398 global $wgScript;
@@ -530,6 +534,7 @@
531535
532536 /**
533537 * @deprecated in 1.19
 538+ * @return string
534539 */
535540 function getQuickbarCompensator( $rows = 1 ) {
536541 wfDeprecated( __METHOD__, '1.19' );
Index: trunk/phase3/includes/SkinTemplate.php
@@ -513,6 +513,7 @@
514514 * This is setup as a method so that like with $wgLogo and getLogo() a skin
515515 * can override this setting and always output one or the other if it has
516516 * a reason it can't output one of the two modes.
 517+ * @return bool
517518 */
518519 function useCombinedLoginLink() {
519520 global $wgUseCombinedLoginLink;
@@ -1310,6 +1311,7 @@
13111312
13121313 /**
13131314 * @private
 1315+ * @return bool
13141316 */
13151317 function haveData( $str ) {
13161318 return isset( $this->data[$str] );
@@ -1369,6 +1371,7 @@
13701372 * stored by SkinTemplate.
13711373 * The resulting array is built acording to a format intended to be passed
13721374 * through makeListItem to generate the html.
 1375+ * @return array
13731376 */
13741377 function getToolbox() {
13751378 wfProfileIn( __METHOD__ );
@@ -1429,6 +1432,7 @@
14301433 * This is in reality the same list as already stored in personal_urls
14311434 * however it is reformatted so that you can just pass the individual items
14321435 * to makeListItem instead of hardcoding the element creation boilerplate.
 1436+ * @return array
14331437 */
14341438 function getPersonalTools() {
14351439 $personal_tools = array();
@@ -1602,6 +1606,7 @@
16031607 * A link-fallback can be used to specify a tag to use instead of <a> if there is
16041608 * no link. eg: If you specify 'link-fallback' => 'span' than any non-link will
16051609 * output a <span> instead of just text.
 1610+ * @return string
16061611 */
16071612 function makeLink( $key, $item, $options = array() ) {
16081613 if ( isset( $item['text'] ) ) {
@@ -1680,6 +1685,7 @@
16811686 * If you need an id or class on a single link you should include a "links"
16821687 * array with just one link item inside of it.
16831688 * $options is also passed on to makeLink calls
 1689+ * @return string
16841690 */
16851691 function makeListItem( $key, $item, $options = array() ) {
16861692 if ( isset( $item['links'] ) ) {
@@ -1774,6 +1780,7 @@
17751781 * If you pass "flat" as an option then the returned array will be a flat array
17761782 * of footer icons instead of a key/value array of footerlinks arrays broken
17771783 * up into categories.
 1784+ * @return array|mixed
17781785 */
17791786 function getFooterLinks( $option = null ) {
17801787 $footerlinks = $this->data['footerlinks'];
@@ -1812,6 +1819,7 @@
18131820 * in the list of footer icons. This is mostly useful for skins which only
18141821 * display the text from footericons instead of the images and don't want a
18151822 * duplicate copyright statement because footerlinks already rendered one.
 1823+ * @return
18161824 */
18171825 function getFooterIcons( $option = null ) {
18181826 // Generate additional footer icons
Index: trunk/phase3/includes/WikiPage.php
@@ -888,6 +888,7 @@
889889
890890 /**
891891 * Perform the actions of a page purging
 892+ * @return bool
892893 */
893894 public function doPurge() {
894895 global $wgUseSquid;
@@ -1498,6 +1499,7 @@
14991500 /**
15001501 * Prepare text which is about to be saved.
15011502 * Returns a stdclass with source, pst and output members
 1503+ * @return bool|object
15021504 */
15031505 public function prepareTextForEdit( $text, $revid = null, User $user = null ) {
15041506 global $wgParser, $wgContLang, $wgUser;
@@ -2169,6 +2171,7 @@
21702172 *
21712173 * @param $resultDetails Array: contains result-specific array of additional values
21722174 * @param $guser User The user performing the rollback
 2175+ * @return array
21732176 */
21742177 public function commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser ) {
21752178 global $wgUseRCPatrol, $wgContLang;
@@ -2793,6 +2796,7 @@
27942797
27952798 /**
27962799 * @deprecated since 1.18
 2800+ * @return bool
27972801 */
27982802 public function useParserCache( $oldid ) {
27992803 wfDeprecated( __METHOD__, '1.18' );
@@ -2973,6 +2977,7 @@
29742978
29752979 /**
29762980 * @param $status Status
 2981+ * @return bool
29772982 */
29782983 function error( $status ) {
29792984 $this->error = $status;
Index: trunk/phase3/includes/ZipDirectoryReader.php
@@ -426,6 +426,7 @@
427427
428428 /**
429429 * Interpret ZIP64 "extra field" data and return an associative array.
 430+ * @return array|bool
430431 */
431432 function unpackZip64Extra( $extraField ) {
432433 $extraHeaderInfo = array(
@@ -520,6 +521,7 @@
521522 * If there are not enough bytes in the file to satsify the request, the
522523 * return value will be truncated. If a request is made for a segment beyond
523524 * the end of the file, an empty string will be returned.
 525+ * @return string
524526 */
525527 function getSegment( $segIndex ) {
526528 if ( !isset( $this->buffer[$segIndex] ) ) {
@@ -542,6 +544,7 @@
543545
544546 /**
545547 * Get the size of a structure in bytes. See unpack() for the format of $struct.
 548+ * @return int
546549 */
547550 function getStructSize( $struct ) {
548551 $size = 0;
Index: trunk/phase3/includes/specials/SpecialAllpages.php
@@ -95,6 +95,7 @@
9696 * @param $namespace Integer: a namespace constant (default NS_MAIN).
9797 * @param $from String: dbKey we are starting listing at.
9898 * @param $to String: dbKey we are ending listing at.
 99+ * @return string
99100 */
100101 function namespaceForm( $namespace = NS_MAIN, $from = '', $to = '' ) {
101102 global $wgScript;
@@ -270,6 +271,7 @@
271272 * @param $inpoint String: lower limit of pagenames
272273 * @param $outpoint String: upper limit of pagenames
273274 * @param $namespace Integer (Default NS_MAIN)
 275+ * @return string
274276 */
275277 function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
276278 global $wgContLang;
Index: trunk/phase3/includes/specials/SpecialUnblock.php
@@ -136,6 +136,7 @@
137137
138138 /**
139139 * Submit callback for an HTMLForm object
 140+ * @return \Array( Array(message key, parameters)
140141 */
141142 public static function processUIUnblock( array $data, HTMLForm $form ) {
142143 return self::processUnblock( $data, $form->getContext() );
Index: trunk/phase3/includes/specials/SpecialFewestrevisions.php
@@ -68,6 +68,7 @@
6969 /**
7070 * @param $skin Skin object
7171 * @param $result Object: database row
 72+ * @return String
7273 */
7374 function formatResult( $skin, $result ) {
7475 global $wgContLang;
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -290,6 +290,7 @@
291291 /**
292292 * This function normally does a database query to get the results; we need
293293 * to make a pretend result using a FakeResultWrapper.
 294+ * @return \FakeResultWrapper
294295 */
295296 function reallyDoQuery( $offset, $limit, $descending ) {
296297 $result = new FakeResultWrapper( array() );
Index: trunk/phase3/includes/specials/SpecialExport.php
@@ -510,6 +510,7 @@
511511
512512 /**
513513 * Expand a list of pages to include items used in those pages.
 514+ * @return array
514515 */
515516 private function getLinks( $inputPages, $pageSet, $table, $fields, $join ) {
516517 $dbr = wfGetDB( DB_SLAVE );
Index: trunk/phase3/includes/specials/SpecialWantedfiles.php
@@ -66,6 +66,7 @@
6767 * that exist e.g. in a shared repo. Setting this at least
6868 * keeps them from showing up as redlinks in the output, even
6969 * if it doesn't fix the real problem (bug 6220).
 70+ * @return bool
7071 */
7172 function forceExistenceCheck() {
7273 return true;
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -209,6 +209,7 @@
210210
211211 /**
212212 * @private
 213+ * @return bool|void
213214 */
214215 function addNewAccount() {
215216 global $wgUser, $wgEmailAuthentication, $wgLoginLanguageSelector;
@@ -270,6 +271,7 @@
271272
272273 /**
273274 * @private
 275+ * @return bool|\User
274276 */
275277 function addNewAccountInternal() {
276278 global $wgAuth, $wgMemc, $wgAccountCreationThrottle,
@@ -470,6 +472,7 @@
471473 * This may create a local account as a side effect if the
472474 * authentication plugin allows transparent local account
473475 * creation.
 476+ * @return int
474477 */
475478 public function authenticateUserData() {
476479 global $wgUser, $wgAuth;
@@ -1117,6 +1120,7 @@
11181121 * previous pass through the system.
11191122 *
11201123 * @private
 1124+ * @return bool
11211125 */
11221126 function hasSessionCookie() {
11231127 global $wgDisableCookieCheck;
@@ -1125,6 +1129,7 @@
11261130
11271131 /**
11281132 * Get the login token from the current session
 1133+ * @return Mixed
11291134 */
11301135 public static function getLoginToken() {
11311136 global $wgRequest;
@@ -1151,6 +1156,7 @@
11521157
11531158 /**
11541159 * Get the createaccount token from the current session
 1160+ * @return Mixed
11551161 */
11561162 public static function getCreateaccountToken() {
11571163 global $wgRequest;
@@ -1175,6 +1181,7 @@
11761182
11771183 /**
11781184 * @private
 1185+ * @return void
11791186 */
11801187 function cookieRedirectCheck( $type ) {
11811188 $titleObj = SpecialPage::getTitleFor( 'Userlogin' );
@@ -1243,6 +1250,7 @@
12441251 *
12451252 * @param $text Link text
12461253 * @param $lang Language code
 1254+ * @return string
12471255 */
12481256 function makeLanguageSelectorLink( $text, $lang ) {
12491257 $attr = array( 'uselang' => $lang );
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -534,6 +534,7 @@
535535 /**
536536 * Get the query string to append to feed link URLs.
537537 * This is overridden by RCL to add the target parameter
 538+ * @return bool
538539 */
539540 public function getFeedQuery() {
540541 return false;
@@ -760,6 +761,7 @@
761762 * @param $override Array: options to override
762763 * @param $options Array: current options
763764 * @param $active Boolean: whether to show the link in bold
 765+ * @return string
764766 */
765767 function makeOptionsLink( $title, $override, $options, $active = false ) {
766768 $params = $override + $options;
@@ -775,6 +777,7 @@
776778 *
777779 * @param $defaults Array
778780 * @param $nondefaults Array
 781+ * @return string
779782 */
780783 function optionsPanel( $defaults, $nondefaults ) {
781784 global $wgRCLinkLimits, $wgRCLinkDays;
Index: trunk/phase3/includes/specials/SpecialProtectedtitles.php
@@ -112,6 +112,7 @@
113113 * @param $namespace Integer:
114114 * @param $type string
115115 * @param $level string
 116+ * @return string
116117 * @private
117118 */
118119 function showOptions( $namespace, $type='edit', $level ) {
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -251,6 +251,7 @@
252252
253253 /**
254254 * Get the condition used for fetching log snippets
 255+ * @return array
255256 */
256257 protected function getLogQueryCond() {
257258 $conds = array();
@@ -497,6 +498,7 @@
498499
499500 /**
500501 * UI entry point for form submission.
 502+ * @return bool
501503 */
502504 protected function submit() {
503505 # Check edit token on submission
@@ -592,6 +594,7 @@
593595
594596 /**
595597 * Do the write operations. Simple wrapper for RevDel_*List::setVisibility().
 598+ * @return
596599 */
597600 protected function save( $bitfield, $reason, $title ) {
598601 return $this->getList()->setVisibility(
Index: trunk/phase3/includes/specials/SpecialPrefixindex.php
@@ -83,7 +83,8 @@
8484 * HTML for the top form
8585 * @param $namespace Integer: a namespace constant (default NS_MAIN).
8686 * @param $from String: dbKey we are starting listing at.
87 - */
 87+ * @return string
 88+ */
8889 function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) {
8990 global $wgScript;
9091
Index: trunk/phase3/includes/specials/SpecialUploadStash.php
@@ -58,6 +58,7 @@
5959 * n.b. Most sanity checking done in UploadStashLocalFile, so this is straightforward.
6060 *
6161 * @param $key String: the key of a particular requested file
 62+ * @return bool
6263 */
6364 public function showUpload( $key ) {
6465 // prevent callers from doing standard HTML output -- we'll take it from here
@@ -241,6 +242,7 @@
242243 * Side effect: writes HTTP response to STDOUT.
243244 *
244245 * @param $file File object with a local path (e.g. UnregisteredLocalFile, LocalFile. Oddly these don't share an ancestor!)
 246+ * @return bool
245247 */
246248 private function outputLocalFile( File $file ) {
247249 if ( $file->getSize() > self::MAX_SERVE_BYTES ) {
@@ -257,6 +259,7 @@
258260 * Side effect: writes HTTP response to STDOUT.
259261 * @param String $content: content
260262 * @param String $mimeType: mime type
 263+ * @return bool
261264 */
262265 private function outputContents( $content, $contentType ) {
263266 $size = strlen( $content );
@@ -304,6 +307,7 @@
305308 * Default action when we don't have a subpage -- just show links to the uploads we have,
306309 * Also show a button to clear stashed files
307310 * @param Status : $status - the result of processRequest
 311+ * @return bool
308312 */
309313 private function showUploads( $status = null ) {
310314 if ( $status === null ) {
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -698,6 +698,7 @@
699699
700700 /**
701701 * Do a batched query to get the parent revision lengths
 702+ * @return array
702703 */
703704 private function getParentLengths( array $revIds ) {
704705 $revLens = array();
@@ -739,6 +740,7 @@
740741 * was not written by the target user.
741742 *
742743 * @todo This would probably look a lot nicer in a table.
 744+ * @return string
743745 */
744746 function formatRow( $row ) {
745747 wfProfileIn( __METHOD__ );
@@ -871,6 +873,7 @@
872874
873875 /**
874876 * Overwrite Pager function and return a helpful comment
 877+ * @return string
875878 */
876879 function getSqlComment() {
877880 if ( $this->namespace || $this->deletedOnly ) {
Index: trunk/phase3/includes/specials/SpecialJavaScriptTest.php
@@ -97,6 +97,7 @@
9898 * be thrown.
9999 * @param $html String: The raw HTML.
100100 * @param $state String: State, one of 'noframework', 'unknownframework' or 'frameworkfound'
 101+ * @return string
101102 */
102103 private function wrapSummaryHtml( $html, $state ) {
103104 $validStates = array( 'noframework', 'unknownframework', 'frameworkfound' );
Index: trunk/phase3/includes/specials/SpecialUnusedcategories.php
@@ -52,6 +52,7 @@
5353
5454 /**
5555 * A should come before Z (bug 30907)
 56+ * @return bool
5657 */
5758 function sortDescending() {
5859 return false;
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -356,6 +356,7 @@
357357
358358 /**
359359 * Callback to sort extensions by type.
 360+ * @return int
360361 */
361362 function compare( $a, $b ) {
362363 if( $a['name'] === $b['name'] ) {
@@ -589,6 +590,7 @@
590591 * url The subversion URL of the directory
591592 * repo-url The base URL of the repository
592593 * viewvc-url A ViewVC URL pointing to the checked-out revision
 594+ * @return array|bool
593595 */
594596 public static function getSvnInfo( $dir ) {
595597 // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -130,6 +130,7 @@
131131 * written by the target user.
132132 *
133133 * @todo This would probably look a lot nicer in a table.
 134+ * @return string
134135 */
135136 function formatRow( $row ) {
136137 wfProfileIn( __METHOD__ );
@@ -449,6 +450,7 @@
450451 /**
451452 * Generates the namespace selector form with hidden attributes.
452453 * @param $options Array: the options to be included.
 454+ * @return string
453455 */
454456 function getForm( $options ) {
455457 global $wgScript;
Index: trunk/phase3/includes/specials/SpecialBlock.php
@@ -297,6 +297,7 @@
298298
299299 /**
300300 * Add header elements like block log entries, etc.
 301+ * @return String
301302 */
302303 protected function preText(){
303304 $text = $this->msg( 'blockiptext' )->parse();
Index: trunk/phase3/includes/specials/SpecialBooksources.php
@@ -64,6 +64,7 @@
6565 /**
6666 * Returns whether a given ISBN (10 or 13) is valid. True indicates validity.
6767 * @param isbn string ISBN passed for check
 68+ * @return bool
6869 */
6970 public static function isValidISBN( $isbn ) {
7071 $isbn = self::cleanIsbn( $isbn );
Index: trunk/phase3/includes/specials/SpecialLinkSearch.php
@@ -112,6 +112,7 @@
113113
114114 /**
115115 * Disable RSS/Atom feeds
 116+ * @return bool
116117 */
117118 function isSyndicated() {
118119 return false;
@@ -203,6 +204,7 @@
204205 * We do a truncated index search, so the optimizer won't trust
205206 * it as good enough for optimizing sort. The implicit ordering
206207 * from the scan will usually do well enough for our needs.
 208+ * @return array
207209 */
208210 function getOrderFields() {
209211 return array();
Index: trunk/phase3/includes/RevisionList.php
@@ -31,6 +31,7 @@
3232 /**
3333 * Get the internal type name of this list. Equal to the table name.
3434 * Override this function.
 35+ * @return null
3536 */
3637 public function getType() {
3738 return null;
@@ -80,6 +81,7 @@
8182
8283 /**
8384 * Get the number of items in the list.
 85+ * @return int
8486 */
8587 public function length() {
8688 if( !$this->res ) {
@@ -124,6 +126,7 @@
125127 /**
126128 * Get the DB field name associated with the ID list.
127129 * Override this function.
 130+ * @return null
128131 */
129132 public function getIdField() {
130133 return null;
@@ -132,6 +135,7 @@
133136 /**
134137 * Get the DB field name storing timestamps.
135138 * Override this function.
 139+ * @return bool
136140 */
137141 public function getTimestampField() {
138142 return false;
@@ -140,6 +144,7 @@
141145 /**
142146 * Get the DB field name storing user ids.
143147 * Override this function.
 148+ * @return bool
144149 */
145150 public function getAuthorIdField() {
146151 return false;
@@ -148,6 +153,7 @@
149154 /**
150155 * Get the DB field name storing user names.
151156 * Override this function.
 157+ * @return bool
152158 */
153159 public function getAuthorNameField() {
154160 return false;
@@ -155,6 +161,7 @@
156162
157163 /**
158164 * Get the ID, as it would appear in the ids URL parameter
 165+ * @return
159166 */
160167 public function getId() {
161168 $field = $this->getIdField();
@@ -163,6 +170,7 @@
164171
165172 /**
166173 * Get the date, formatted in user's languae
 174+ * @return String
167175 */
168176 public function formatDate() {
169177 return $this->list->getLanguage()->userDate( $this->getTimestamp(),
@@ -171,6 +179,7 @@
172180
173181 /**
174182 * Get the time, formatted in user's languae
 183+ * @return String
175184 */
176185 public function formatTime() {
177186 return $this->list->getLanguage()->userTime( $this->getTimestamp(),
@@ -179,6 +188,7 @@
180189
181190 /**
182191 * Get the timestamp in MW 14-char form
 192+ * @return Mixed
183193 */
184194 public function getTimestamp() {
185195 $field = $this->getTimestampField();
@@ -187,6 +197,7 @@
188198
189199 /**
190200 * Get the author user ID
 201+ * @return int
191202 */
192203 public function getAuthorId() {
193204 $field = $this->getAuthorIdField();
@@ -195,6 +206,7 @@
196207
197208 /**
198209 * Get the author user name
 210+ * @return string
199211 */
200212 public function getAuthorName() {
201213 $field = $this->getAuthorNameField();
@@ -292,6 +304,7 @@
293305 /**
294306 * Get the HTML link to the revision text.
295307 * Overridden by RevDel_ArchiveItem.
 308+ * @return string
296309 */
297310 protected function getRevisionLink() {
298311 $date = $this->list->getLanguage()->timeanddate( $this->revision->getTimestamp(), true );
@@ -312,6 +325,7 @@
313326 /**
314327 * Get the HTML link to the diff.
315328 * Overridden by RevDel_ArchiveItem
 329+ * @return string
316330 */
317331 protected function getDiffLink() {
318332 if ( $this->isDeleted() && !$this->canViewContent() ) {
Index: trunk/phase3/includes/UserRightsProxy.php
@@ -163,6 +163,7 @@
164164
165165 /**
166166 * Replaces User::getUserGroups()
 167+ * @return array
167168 */
168169 function getGroups() {
169170 $res = $this->db->select( 'user_groups',
Index: trunk/phase3/includes/QueryPage.php
@@ -259,6 +259,7 @@
260260 * Setting this to return true will ensure formatResult() is called
261261 * one more time to make sure that the very last result is formatted
262262 * as well.
 263+ * @return bool
263264 */
264265 function tryLastResult() {
265266 return false;
@@ -269,6 +270,7 @@
270271 *
271272 * @param $limit Integer: limit for SQL statement
272273 * @param $ignoreErrors Boolean: whether to ignore database errors
 274+ * @return bool|int
273275 */
274276 function recache( $limit, $ignoreErrors = true ) {
275277 if ( !$this->isCacheable() ) {
@@ -382,6 +384,7 @@
383385
384386 /**
385387 * Somewhat deprecated, you probably want to be using execute()
 388+ * @return \ResultWrapper
386389 */
387390 function doQuery( $offset = false, $limit = false ) {
388391 if ( $this->isCached() && $this->isCacheable() ) {
@@ -435,6 +438,7 @@
436439 /**
437440 * This is the actual workhorse. It does everything needed to make a
438441 * real, honest-to-gosh query page.
 442+ * @return int
439443 */
440444 function execute( $par ) {
441445 global $wgQueryCacheLimit, $wgDisableQueryPageUpdate;
@@ -621,6 +625,7 @@
622626
623627 /**
624628 * Similar to above, but packaging in a syndicated feed instead of a web page
 629+ * @return bool
625630 */
626631 function doFeed( $class = '', $limit = 50 ) {
627632 global $wgFeed, $wgFeedClasses;
@@ -660,6 +665,7 @@
661666 /**
662667 * Override for custom handling. If the titles/links are ok, just do
663668 * feedItemDesc()
 669+ * @return FeedItem|null
664670 */
665671 function feedResult( $row ) {
666672 if ( !isset( $row->title ) ) {
@@ -745,6 +751,7 @@
746752 * kluge for Special:WantedFiles, which may contain false
747753 * positives for files that exist e.g. in a shared repo (bug
748754 * 6220).
 755+ * @return bool
749756 */
750757 function forceExistenceCheck() {
751758 return false;
Index: trunk/phase3/includes/Skin.php
@@ -1540,6 +1540,7 @@
15411541 *
15421542 * @param $fname String Name of called method
15431543 * @param $args Array Arguments to the method
 1544+ * @return mixed
15441545 */
15451546 function __call( $fname, $args ) {
15461547 $realFunction = array( 'Linker', $fname );

Follow-up revisions

RevisionCommit summaryAuthorDate
r111386Remove backslash from @return types...hashar16:35, 13 February 2012

Comments

#Comment by SVG (talk | contribs)   11:30, 10 February 2012

Sometimes you wrote "String" and "Mixed" instead of "string" and "mixed"

#Comment by Hashar (talk | contribs)   19:17, 12 February 2012

That is being done on purpose to make the bot taste like an human being :-D

#Comment by SVG (talk | contribs)   19:27, 12 February 2012

Haha. Kinda funny.

#Comment by Aaron Schulz (talk | contribs)   18:41, 10 February 2012

What's with "@return \...."?

#Comment by Aaron Schulz (talk | contribs)   00:36, 11 February 2012

e.g. + * @return \FileRepoStatus

Status & tagging log