r111101 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111100‎ | r111101 | r111102 >
Date:21:33, 9 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
More return documentation
Modified paths:
  • /trunk/phase3/includes/Action.php (modified) (history)
  • /trunk/phase3/includes/AjaxResponse.php (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/AuthPlugin.php (modified) (history)
  • /trunk/phase3/includes/BacklinkCache.php (modified) (history)
  • /trunk/phase3/includes/Category.php (modified) (history)
  • /trunk/phase3/includes/CategoryPage.php (modified) (history)
  • /trunk/phase3/includes/CategoryViewer.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/ConfEditor.php (modified) (history)
  • /trunk/phase3/includes/Cookie.php (modified) (history)
  • /trunk/phase3/includes/Export.php (modified) (history)
  • /trunk/phase3/includes/ExternalStoreDB.php (modified) (history)
  • /trunk/phase3/includes/Feed.php (modified) (history)
  • /trunk/phase3/includes/FeedUtils.php (modified) (history)
  • /trunk/phase3/includes/FileDeleteForm.php (modified) (history)
  • /trunk/phase3/includes/ForkController.php (modified) (history)
  • /trunk/phase3/includes/FormOptions.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)
  • /trunk/phase3/includes/ImageGallery.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/Import.php (modified) (history)
  • /trunk/phase3/includes/actions/HistoryAction.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUpload.php (modified) (history)
  • /trunk/phase3/includes/cache/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)
  • /trunk/phase3/includes/debug/Debug.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignAPIRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignDBRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/ForeignDBViaLBRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/RepoGroup.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FSFileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/ForeignAPIFile.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/LocalFile.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/OldLocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -507,6 +507,7 @@
508508 * Closes a <page> section on the output stream.
509509 *
510510 * @access private
 511+ * @return string
511512 */
512513 function closePage() {
513514 return " </page>\n";
@@ -633,6 +634,7 @@
634635
635636 /**
636637 * Warning! This data is potentially inconsistent. :(
 638+ * @return string
637639 */
638640 function writeUploads( $row, $dumpContents = false ) {
639641 if ( $row->page_namespace == NS_IMAGE ) {
@@ -773,6 +775,7 @@
774776 /**
775777 * Returns the name of the file or files which are
776778 * being written to, if there are any.
 779+ * @return null
777780 */
778781 function getFilenames() {
779782 return NULL;
Index: trunk/phase3/includes/FeedUtils.php
@@ -165,6 +165,7 @@
166166 * @param $title Title object: used to generate the diff URL
167167 * @param $newid Integer newid for this diff
168168 * @param $oldid Integer|null oldid for the diff. Null means it is a new article
 169+ * @return string
169170 */
170171 protected static function getDiffLink( Title $title, $newid, $oldid = null ) {
171172 $queryParameters = ($oldid == null)
Index: trunk/phase3/includes/CategoryViewer.php
@@ -172,7 +172,8 @@
173173 *
174174 * @param Title $title
175175 * @param string $sortkey The human-readable sortkey (before transforming to icu or whatever).
176 - */
 176+ * @return string
 177+ */
177178 function getSubcategorySortChar( $title, $sortkey ) {
178179 global $wgContLang;
179180
Index: trunk/phase3/includes/ImageGallery.php
@@ -168,6 +168,7 @@
169169
170170 /**
171171 * isEmpty() returns true if the gallery contains no images
 172+ * @return bool
172173 */
173174 function isEmpty() {
174175 return empty( $this->mImages );
@@ -215,6 +216,7 @@
216217 * - the additional text provided when adding the image
217218 * - the size of the image
218219 *
 220+ * @return string
219221 */
220222 function toHTML() {
221223 global $wgLang;
Index: trunk/phase3/includes/AjaxResponse.php
@@ -141,6 +141,7 @@
142142 * possible. If sucessful, the AjaxResponse is disabled so that
143143 * any future call to AjaxResponse::printText() have no effect. The method
144144 * returns true iff the response code was set to 304 Not Modified.
 145+ * @return bool
145146 */
146147 function checkLastModified ( $timestamp ) {
147148 global $wgCachePages, $wgCacheEpoch, $wgUser;
Index: trunk/phase3/includes/ExternalStoreDB.php
@@ -73,6 +73,7 @@
7474 /**
7575 * Fetch data from given URL
7676 * @param $url String: an url of the form DB://cluster/id or DB://cluster/id/itemid for concatened storage.
 77+ * @return mixed
7778 */
7879 function fetchFromURL( $url ) {
7980 $path = explode( '/', $url );
Index: trunk/phase3/includes/Category.php
@@ -231,7 +231,10 @@
232232 );
233233 }
234234
235 - /** Generic accessor */
 235+ /**
 236+ * Generic accessor
 237+ * @return bool
 238+ */
236239 private function getX( $key ) {
237240 if ( !$this->initialize() ) {
238241 return false;
Index: trunk/phase3/includes/ImagePage.php
@@ -30,6 +30,7 @@
3131 /**
3232 * Constructor from a page id
3333 * @param $id Int article ID to load
 34+ * @returnImagePage|null
3435 */
3536 public static function newFromID( $id ) {
3637 $t = Title::newFromID( $id );
Index: trunk/phase3/includes/CategoryPage.php
@@ -29,6 +29,7 @@
3030 /**
3131 * Constructor from a page id
3232 * @param $id Int article ID to load
 33+ * @return CategoryPage|null
3334 */
3435 public static function newFromID( $id ) {
3536 $t = Title::newFromID( $id );
Index: trunk/phase3/includes/AuthPlugin.php
@@ -103,6 +103,7 @@
104104 * forget the & on your function declaration.
105105 *
106106 * @param $user User object
 107+ * @return bool
107108 */
108109 public function updateUser( &$user ) {
109110 # Override this and do something
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -672,6 +672,7 @@
673673 *
674674 * @param $otext String: old text, must be already segmented
675675 * @param $ntext String: new text, must be already segmented
 676+ * @return bool|string
676677 */
677678 function generateDiffBody( $otext, $ntext ) {
678679 global $wgExternalDiffEngine, $wgContLang;
@@ -747,6 +748,7 @@
748749 /**
749750 * Generate a debug comment indicating diff generating time,
750751 * server node, and generator backend.
 752+ * @return string
751753 */
752754 protected function debug( $generator = "internal" ) {
753755 global $wgShowHostnames;
@@ -768,6 +770,7 @@
769771
770772 /**
771773 * Replace line numbers with the text in the user's language
 774+ * @return mixed
772775 */
773776 function localiseLineNumbers( $text ) {
774777 return preg_replace_callback( '/<!--LINE (\d+)-->/',
Index: trunk/phase3/includes/FileDeleteForm.php
@@ -122,6 +122,7 @@
123123 * @param $reason String: reason of the deletion
124124 * @param $suppress Boolean: whether to mark all deleted versions as restricted
125125 * @param $user User object performing the request
 126+ * @return bool|Status
126127 */
127128 public static function doDelete( &$title, &$file, &$oldimage, $reason, $suppress, User $user = null ) {
128129 if ( $user === null ) {
Index: trunk/phase3/includes/ConfEditor.php
@@ -139,6 +139,7 @@
140140 * insert
141141 * Insert a new element at the start of the array.
142142 *
 143+ * @return string
143144 */
144145 public function edit( $ops ) {
145146 $this->parse();
@@ -371,6 +372,7 @@
372373 * Finds the source byte region which you would want to delete, if $pathName
373374 * was to be deleted. Includes the leading spaces and tabs, the trailing line
374375 * break, and any comments in between.
 376+ * @return array
375377 */
376378 function findDeletionRegion( $pathName ) {
377379 if ( !isset( $this->pathInfo[$pathName] ) ) {
@@ -428,6 +430,7 @@
429431 * or semicolon.
430432 *
431433 * The end position is the past-the-end (end + 1) value as per convention.
 434+ * @return array
432435 */
433436 function findValueRegion( $pathName ) {
434437 if ( !isset( $this->pathInfo[$pathName] ) ) {
@@ -444,6 +447,7 @@
445448 * Find the path name of the last element in the array.
446449 * If the array is empty, this will return the \@extra interstitial element.
447450 * If the specified path is not found or is not an array, it will return false.
 451+ * @return bool|int|string
448452 */
449453 function findLastArrayElement( $path ) {
450454 // Try for a real element
@@ -480,6 +484,7 @@
481485 * Find the path name of first element in the array.
482486 * If the array is empty, this will return the \@extra interstitial element.
483487 * If the specified path is not found or is not an array, it will return false.
 488+ * @return bool|int|string
484489 */
485490 function findFirstArrayElement( $path ) {
486491 // Try for an ordinary element
@@ -504,6 +509,7 @@
505510 /**
506511 * Get the indent string which sits after a given start position.
507512 * Returns false if the position is not at the start of the line.
 513+ * @return array
508514 */
509515 function getIndent( $pos, $key = false, $arrowPos = false ) {
510516 $arrowIndent = ' ';
@@ -725,6 +731,7 @@
726732
727733 /**
728734 * Create a ConfEditorToken from an element of token_get_all()
 735+ * @return \ConfEditorToken
729736 */
730737 function newTokenObj( $internalToken ) {
731738 if ( is_array( $internalToken ) ) {
@@ -776,6 +783,7 @@
777784 /**
778785 * Get the token $offset steps ahead of the current position.
779786 * $offset may be negative, to get tokens behind the current position.
 787+ * @return \ConfEditorToken
780788 */
781789 function getTokenAhead( $offset ) {
782790 $pos = $this->pos + $offset;
@@ -821,6 +829,7 @@
822830
823831 /**
824832 * Pop a state from the state stack.
 833+ * @return mixed
825834 */
826835 function popState() {
827836 return array_pop( $this->stateStack );
@@ -829,6 +838,7 @@
830839 /**
831840 * Returns true if the user input path is valid.
832841 * This exists to allow "/" and "@" to be reserved for string path keys
 842+ * @return bool
833843 */
834844 function validatePath( $path ) {
835845 return strpos( $path, '/' ) === false && substr( $path, 0, 1 ) != '@';
@@ -949,6 +959,7 @@
950960
951961 /**
952962 * Get a readable name for the given token type.
 963+ * @return string
953964 */
954965 function getTypeName( $type ) {
955966 if ( is_int( $type ) ) {
@@ -962,6 +973,7 @@
963974 * Looks ahead to see if the given type is the next token type, starting
964975 * from the current position plus the given offset. Skips any intervening
965976 * whitespace.
 977+ * @return bool
966978 */
967979 function isAhead( $type, $offset = 0 ) {
968980 $ahead = $offset;
Index: trunk/phase3/includes/ForkController.php
@@ -49,6 +49,7 @@
5050 * This will return 'child' in the child processes. In the parent process,
5151 * it will run until all the child processes exit or a TERM signal is
5252 * received. It will then return 'done'.
 53+ * @return string
5354 */
5455 public function start() {
5556 // Trap SIGTERM
Index: trunk/phase3/includes/BacklinkCache.php
@@ -179,6 +179,7 @@
180180 /**
181181 * Get the field name prefix for a given table
182182 * @param $table String
 183+ * @return null|string
183184 */
184185 protected function getPrefix( $table ) {
185186 static $prefixes = array(
@@ -206,6 +207,7 @@
207208 * Get the SQL condition array for selecting backlinks, with a join
208209 * on the page table.
209210 * @param $table String
 211+ * @return array|null
210212 */
211213 protected function getConditions( $table ) {
212214 $prefix = $this->getPrefix( $table );
Index: trunk/phase3/includes/Feed.php
@@ -334,6 +334,7 @@
335335 class AtomFeed extends ChannelFeed {
336336 /**
337337 * @todo document
 338+ * @return string
338339 */
339340 function formatTime( $ts ) {
340341 // need to use RFC 822 time format at least for rss2.0
Index: trunk/phase3/includes/Import.php
@@ -396,6 +396,7 @@
397397
398398 /**
399399 * Primary entry point
 400+ * @return bool
400401 */
401402 public function doImport() {
402403 $this->reader->read();
Index: trunk/phase3/includes/cache/MessageCache.php
@@ -260,6 +260,7 @@
261261 * is disabled.
262262 *
263263 * @param $code String: language to which load messages
 264+ * @return bool
264265 */
265266 function load( $code = false ) {
266267 global $wgUseLocalMessageCache;
Index: trunk/phase3/includes/Action.php
@@ -501,6 +501,7 @@
502502
503503 /**
504504 * We don't want an HTMLForm
 505+ * @return bool
505506 */
506507 protected function getFormFields() {
507508 return false;
Index: trunk/phase3/includes/FormOptions.php
@@ -291,11 +291,17 @@
292292 * @see http://php.net/manual/en/class.arrayaccess.php
293293 */
294294 /* @{ */
295 - /** Whether option exist*/
 295+ /**
 296+ * Whether option exist
 297+ * @return bool
 298+ */
296299 public function offsetExists( $name ) {
297300 return isset( $this->options[$name] );
298301 }
299 - /** Retrieve an option value */
 302+ /**
 303+ * Retrieve an option value
 304+ * @return Mixed
 305+ */
300306 public function offsetGet( $name ) {
301307 return $this->getValue( $name );
302308 }
Index: trunk/phase3/includes/filerepo/RepoGroup.php
@@ -189,6 +189,7 @@
190190
191191 /**
192192 * Interface for FileRepo::checkRedirect()
 193+ * @return bool
193194 */
194195 function checkRedirect( Title $title ) {
195196 if ( !$this->reposInitialised ) {
@@ -251,6 +252,7 @@
252253
253254 /**
254255 * Get the repo instance with a given key.
 256+ * @return bool|LocalRepo
255257 */
256258 function getRepo( $index ) {
257259 if ( !$this->reposInitialised ) {
@@ -266,6 +268,7 @@
267269 }
268270 /**
269271 * Get the repo instance by its name
 272+ * @return bool
270273 */
271274 function getRepoByName( $name ) {
272275 if ( !$this->reposInitialised ) {
@@ -294,6 +297,7 @@
295298 *
296299 * @param $callback Callback: the function to call
297300 * @param $params Array: optional additional parameters to pass to the function
 301+ * @return bool
298302 */
299303 function forEachForeignRepo( $callback, $params = array() ) {
300304 foreach( $this->foreignRepos as $repo ) {
Index: trunk/phase3/includes/filerepo/ForeignDBViaLBRepo.php
@@ -39,6 +39,7 @@
4040 * Get a key on the primary cache for this repository.
4141 * Returns false if the repository's cache is not accessible at this site.
4242 * The parameters are the parts of the key, as for wfMemcKey().
 43+ * @return bool|string
4344 */
4445 function getSharedCacheKey( /*...*/ ) {
4546 if ( $this->hasSharedCache() ) {
Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -411,6 +411,7 @@
412412 * SHA-1 content hash.
413413 *
414414 * STUB
 415+ * @return array
415416 */
416417 public function findBySha1( $hash ) {
417418 return array();
@@ -456,6 +457,7 @@
457458 * Get the name of an image from its title object
458459 *
459460 * @param $title Title
 461+ * @return String
460462 */
461463 public function getNameFromTitle( Title $title ) {
462464 global $wgContLang;
@@ -869,6 +871,7 @@
870872 * be archived, if there is one. Relative to the public zone root.
871873 * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate
872874 * that the source file should be deleted if possible
 875+ * @return FileRepoStatus
873876 */
874877 public function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) {
875878 $status = $this->publishBatch( array( array( $srcPath, $dstRel, $archiveRel ) ), $flags );
@@ -1422,6 +1425,7 @@
14231426 * The parameters are the parts of the key, as for wfMemcKey().
14241427 *
14251428 * STUB
 1429+ * @return bool
14261430 */
14271431 function getSharedCacheKey( /*...*/ ) {
14281432 return false;
Index: trunk/phase3/includes/filerepo/ForeignDBRepo.php
@@ -61,6 +61,7 @@
6262 * Get a key on the primary cache for this repository.
6363 * Returns false if the repository's cache is not accessible at this site.
6464 * The parameters are the parts of the key, as for wfMemcKey().
 65+ * @return bool|mixed
6566 */
6667 function getSharedCacheKey( /*...*/ ) {
6768 if ( $this->hasSharedCache() ) {
Index: trunk/phase3/includes/filerepo/ForeignAPIRepo.php
@@ -77,6 +77,7 @@
7878
7979 /**
8080 * No-ops
 81+ * @return bool
8182 */
8283
8384 function storeBatch( $triplets, $flags = 0 ) {
@@ -231,6 +232,7 @@
232233 * @param $width
233234 * @param $height
234235 * @param String $param Other rendering parameters (page number, etc) from handler's makeParamString.
 236+ * @return bool|string
235237 */
236238 function getThumbUrlFromCache( $name, $width, $height, $params="" ) {
237239 global $wgMemc;
@@ -312,6 +314,7 @@
313315
314316 /**
315317 * @see FileRepo::getZoneUrl()
 318+ * @return String
316319 */
317320 function getZoneUrl( $zone ) {
318321 switch ( $zone ) {
@@ -326,6 +329,7 @@
327330
328331 /**
329332 * Get the local directory corresponding to one of the basic zones
 333+ * @return bool|null|string
330334 */
331335 function getZonePath( $zone ) {
332336 $supported = array( 'public', 'thumb' );
@@ -345,6 +349,7 @@
346350
347351 /**
348352 * The user agent the ForeignAPIRepo will use.
 353+ * @return string
349354 */
350355 public static function getUserAgent() {
351356 return Http::userAgent() . " ForeignAPIRepo/" . self::VERSION;
@@ -353,6 +358,7 @@
354359 /**
355360 * Like a Http:get request, but with custom User-Agent.
356361 * @see Http:get
 362+ * @return bool|String
357363 */
358364 public static function httpGet( $url, $timeout = 'default', $options = array() ) {
359365 $options['timeout'] = $timeout;
@@ -362,7 +368,7 @@
363369 $options['method'] = "GET";
364370
365371 if ( !isset( $options['timeout'] ) ) {
366 - $options['timeout'] = 'default';
 372+ $options['timeout'] = 'default';
367373 }
368374
369375 $req = MWHttpRequest::factory( $url, $options );
@@ -370,9 +376,9 @@
371377 $status = $req->execute();
372378
373379 if ( $status->isOK() ) {
374 - return $req->getContent();
 380+ return $req->getContent();
375381 } else {
376 - return false;
 382+ return false;
377383 }
378384 }
379385
Index: trunk/phase3/includes/filerepo/file/OldLocalFile.php
@@ -64,6 +64,7 @@
6565
6666 /**
6767 * Fields in the oldimage table
 68+ * @return array
6869 */
6970 static function selectFields() {
7071 return array(
Index: trunk/phase3/includes/filerepo/file/LocalFile.php
@@ -121,6 +121,7 @@
122122
123123 /**
124124 * Fields in the image table
 125+ * @return array
125126 */
126127 static function selectFields() {
127128 return array(
@@ -160,6 +161,7 @@
161162 /**
162163 * Get the memcached key for the main data for this file, or false if
163164 * there is no access to the shared cache.
 165+ * @return bool
164166 */
165167 function getCacheKey() {
166168 $hashedName = md5( $this->getName() );
@@ -169,6 +171,7 @@
170172
171173 /**
172174 * Try to load file metadata from memcached. Returns true on success.
 175+ * @return bool
173176 */
174177 function loadFromCache() {
175178 global $wgMemc;
@@ -286,6 +289,7 @@
287290 /**
288291 * Decode a row from the database (either object or array) to an array
289292 * with timestamps and MIME types decoded, and the field prefix removed.
 293+ * @return array
290294 */
291295 function decodeRow( $row, $prefix = 'img_' ) {
292296 $array = (array)$row;
@@ -474,6 +478,7 @@
475479 * Return the width of the image
476480 *
477481 * Returns false on error
 482+ * @return bool
478483 */
479484 public function getWidth( $page = 1 ) {
480485 $this->load();
@@ -494,6 +499,7 @@
495500 * Return the height of the image
496501 *
497502 * Returns false on error
 503+ * @return bool
498504 */
499505 public function getHeight( $page = 1 ) {
500506 $this->load();
@@ -527,6 +533,7 @@
528534
529535 /**
530536 * Get handler-specific metadata
 537+ * @return string
531538 */
532539 function getMetadata() {
533540 $this->load();
@@ -824,6 +831,7 @@
825832 * 0 return line for current version
826833 * 1 query for old versions, return first one
827834 * 2, ... return next old version from above query
 835+ * @return bool
828836 */
829837 public function nextHistoryLine() {
830838 # Polymorphic function name to distinguish foreign and local fetches
@@ -920,6 +928,7 @@
921929
922930 /**
923931 * Record a file upload in the upload log and the image table
 932+ * @return bool
924933 */
925934 function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '',
926935 $watch = false, $timestamp = false )
@@ -939,6 +948,7 @@
940949
941950 /**
942951 * Record a file upload in the upload log and the image table
 952+ * @return bool
943953 */
944954 function recordUpload2(
945955 $oldver, $comment, $pageText, $props = false, $timestamp = false, $user = null
@@ -1336,6 +1346,7 @@
13371347
13381348 /**
13391349 * Get the URL of the file description page.
 1350+ * @return String
13401351 */
13411352 function getDescriptionUrl() {
13421353 return $this->title->getLocalUrl();
@@ -1345,6 +1356,7 @@
13461357 * Get the HTML text of the description page
13471358 * This is not used by ImagePage for local files, since (among other things)
13481359 * it skips the parser cache.
 1360+ * @return bool|mixed
13491361 */
13501362 function getDescriptionText() {
13511363 global $wgParser;
@@ -1634,6 +1646,7 @@
16351647
16361648 /**
16371649 * Run the transaction
 1650+ * @return \FileRepoStatus
16381651 */
16391652 function execute() {
16401653 global $wgUseSquid;
@@ -1724,6 +1737,7 @@
17251738
17261739 /**
17271740 * Removes non-existent files from a deletion batch.
 1741+ * @return array
17281742 */
17291743 function removeNonexistentFiles( $batch ) {
17301744 $files = $newBatch = array();
@@ -1793,6 +1807,7 @@
17941808 * rows and there's no need to keep the image row locked while it's acquiring those locks
17951809 * The caller may have its own transaction open.
17961810 * So we save the batch and let the caller call cleanup()
 1811+ * @return \FileRepoStatus
17971812 */
17981813 function execute() {
17991814 global $wgLang;
@@ -2015,6 +2030,7 @@
20162031
20172032 /**
20182033 * Removes non-existent files from a store batch.
 2034+ * @return array
20192035 */
20202036 function removeNonexistentFiles( $triplets ) {
20212037 $files = $filteredTriplets = array();
@@ -2034,6 +2050,7 @@
20352051
20362052 /**
20372053 * Removes non-existent files from a cleanup batch.
 2054+ * @return array
20382055 */
20392056 function removeNonexistentFromCleanup( $batch ) {
20402057 $files = $newBatch = array();
@@ -2058,6 +2075,7 @@
20592076 /**
20602077 * Delete unused files in the deleted zone.
20612078 * This should be called from outside the transaction in which execute() was called.
 2079+ * @return \FileRepoStatus|void
20622080 */
20632081 function cleanup() {
20642082 if ( !$this->cleanupBatch ) {
@@ -2178,6 +2196,7 @@
21792197
21802198 /**
21812199 * Perform the move.
 2200+ * @return \FileRepoStatus
21822201 */
21832202 function execute() {
21842203 $repo = $this->file->repo;
@@ -2268,6 +2287,7 @@
22692288
22702289 /**
22712290 * Generate triplets for FileRepo::storeBatch().
 2291+ * @return array
22722292 */
22732293 function getMoveTriplets() {
22742294 $moves = array_merge( array( $this->cur ), $this->olds );
@@ -2285,6 +2305,7 @@
22862306
22872307 /**
22882308 * Removes non-existent files from move batch.
 2309+ * @return array
22892310 */
22902311 function removeNonexistentFiles( $triplets ) {
22912312 $files = array();
Index: trunk/phase3/includes/filerepo/file/File.php
@@ -433,6 +433,7 @@
434434 * Get handler-specific metadata
435435 * Overridden by LocalFile, UnregisteredLocalFile
436436 * STUB
 437+ * @return bool
437438 */
438439 public function getMetadata() {
439440 return false;
@@ -462,6 +463,7 @@
463464 * Return the bit depth of the file
464465 * Overridden by LocalFile
465466 * STUB
 467+ * @return int
466468 */
467469 public function getBitDepth() {
468470 return 0;
@@ -471,6 +473,7 @@
472474 * Return the size of the image file, in bytes
473475 * Overridden by LocalFile, UnregisteredLocalFile
474476 * STUB
 477+ * @return bool
475478 */
476479 public function getSize() {
477480 return false;
@@ -492,6 +495,7 @@
493496 * Use the value returned by this function with the MEDIATYPE_xxx constants.
494497 * Overridden by LocalFile,
495498 * STUB
 499+ * @return string
496500 */
497501 function getMediaType() {
498502 return MEDIATYPE_UNKNOWN;
@@ -518,6 +522,7 @@
519523
520524 /**
521525 * Accessor for __get()
 526+ * @return bool
522527 */
523528 protected function getCanRender() {
524529 return $this->canRender();
@@ -938,6 +943,7 @@
939944 * Get all thumbnail names previously generated for this file
940945 * STUB
941946 * Overridden by LocalFile
 947+ * @return array
942948 */
943949 function getThumbnails() {
944950 return array();
@@ -1004,6 +1010,7 @@
10051011 *
10061012 * STUB
10071013 * Overridden in LocalFile
 1014+ * @return bool
10081015 */
10091016 public function nextHistoryLine() {
10101017 return false;
@@ -1360,6 +1367,7 @@
13611368 /**
13621369 * Return the deletion bitfield
13631370 * STUB
 1371+ * @return int
13641372 */
13651373 function getVisibility() {
13661374 return 0;
Index: trunk/phase3/includes/filerepo/file/ForeignAPIFile.php
@@ -68,6 +68,7 @@
6969
7070 /**
7171 * Get the property string for iiprop and aiprop
 72+ * @return string
7273 */
7374 static function getProps() {
7475 return 'timestamp|user|comment|url|size|sha1|metadata|mime';
@@ -183,6 +184,7 @@
184185
185186 /**
186187 * Only useful if we're locally caching thumbs anyway...
 188+ * @return null|string
187189 */
188190 function getThumbPath( $suffix = '' ) {
189191 if ( $this->repo->canCacheThumbs() ) {
Index: trunk/phase3/includes/filerepo/LocalRepo.php
@@ -189,6 +189,7 @@
190190 * We can't say Title object, what database it should use, so we duplicate that function here.
191191 *
192192 * @param $title Title
 193+ * @return bool|int|mixed
193194 */
194195 protected function getArticleID( $title ) {
195196 if( !$title instanceof Title ) {
@@ -233,6 +234,7 @@
234235
235236 /**
236237 * Get a connection to the slave DB
 238+ * @return DatabaseBase
237239 */
238240 function getSlaveDB() {
239241 return wfGetDB( DB_SLAVE );
@@ -240,6 +242,7 @@
241243
242244 /**
243245 * Get a connection to the master DB
 246+ * @return DatabaseBase
244247 */
245248 function getMasterDB() {
246249 return wfGetDB( DB_MASTER );
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -885,6 +885,7 @@
886886
887887 /**
888888 * @see FileBackendStore::moveInternal()
 889+ * @return Status
889890 */
890891 protected function doMoveInternal( array $params ) {
891892 // Copy source to dest
@@ -899,6 +900,7 @@
900901
901902 /**
902903 * @see FileBackend::concatenate()
 904+ * @return Status
903905 */
904906 final public function concatenate( array $params ) {
905907 wfProfileIn( __METHOD__ );
@@ -917,6 +919,7 @@
918920
919921 /**
920922 * @see FileBackendStore::concatenate()
 923+ * @return Status
921924 */
922925 protected function doConcatenate( array $params ) {
923926 $status = Status::newGood();
@@ -972,6 +975,7 @@
973976
974977 /**
975978 * @see FileBackend::doPrepare()
 979+ * @return Status
976980 */
977981 final protected function doPrepare( array $params ) {
978982 wfProfileIn( __METHOD__ );
@@ -1000,6 +1004,7 @@
10011005
10021006 /**
10031007 * @see FileBackendStore::doPrepare()
 1008+ * @return Status
10041009 */
10051010 protected function doPrepareInternal( $container, $dir, array $params ) {
10061011 return Status::newGood();
@@ -1007,6 +1012,7 @@
10081013
10091014 /**
10101015 * @see FileBackend::doSecure()
 1016+ * @return Status
10111017 */
10121018 final protected function doSecure( array $params ) {
10131019 wfProfileIn( __METHOD__ );
@@ -1035,6 +1041,7 @@
10361042
10371043 /**
10381044 * @see FileBackendStore::doSecure()
 1045+ * @return Status
10391046 */
10401047 protected function doSecureInternal( $container, $dir, array $params ) {
10411048 return Status::newGood();
@@ -1042,6 +1049,7 @@
10431050
10441051 /**
10451052 * @see FileBackend::doClean()
 1053+ * @return Status
10461054 */
10471055 final protected function doClean( array $params ) {
10481056 wfProfileIn( __METHOD__ );
@@ -1078,6 +1086,7 @@
10791087
10801088 /**
10811089 * @see FileBackendStore::doClean()
 1090+ * @return Status
10821091 */
10831092 protected function doCleanInternal( $container, $dir, array $params ) {
10841093 return Status::newGood();
@@ -1085,6 +1094,7 @@
10861095
10871096 /**
10881097 * @see FileBackend::fileExists()
 1098+ * @return bool|null
10891099 */
10901100 final public function fileExists( array $params ) {
10911101 wfProfileIn( __METHOD__ );
@@ -1095,6 +1105,7 @@
10961106
10971107 /**
10981108 * @see FileBackend::getFileTimestamp()
 1109+ * @return bool
10991110 */
11001111 final public function getFileTimestamp( array $params ) {
11011112 wfProfileIn( __METHOD__ );
@@ -1105,6 +1116,7 @@
11061117
11071118 /**
11081119 * @see FileBackend::getFileSize()
 1120+ * @return bool
11091121 */
11101122 final public function getFileSize( array $params ) {
11111123 wfProfileIn( __METHOD__ );
@@ -1115,6 +1127,7 @@
11161128
11171129 /**
11181130 * @see FileBackend::getFileStat()
 1131+ * @return bool|void
11191132 */
11201133 final public function getFileStat( array $params ) {
11211134 wfProfileIn( __METHOD__ );
@@ -1148,6 +1161,7 @@
11491162
11501163 /**
11511164 * @see FileBackend::getFileContents()
 1165+ * @return bool|string
11521166 */
11531167 public function getFileContents( array $params ) {
11541168 wfProfileIn( __METHOD__ );
@@ -1165,6 +1179,7 @@
11661180
11671181 /**
11681182 * @see FileBackend::getFileSha1Base36()
 1183+ * @return bool
11691184 */
11701185 final public function getFileSha1Base36( array $params ) {
11711186 wfProfileIn( __METHOD__ );
@@ -1184,6 +1199,7 @@
11851200
11861201 /**
11871202 * @see FileBackendStore::getFileSha1Base36()
 1203+ * @return bool
11881204 */
11891205 protected function doGetFileSha1Base36( array $params ) {
11901206 $fsFile = $this->getLocalReference( $params );
@@ -1196,6 +1212,7 @@
11971213
11981214 /**
11991215 * @see FileBackend::getFileProps()
 1216+ * @return Array
12001217 */
12011218 final public function getFileProps( array $params ) {
12021219 wfProfileIn( __METHOD__ );
@@ -1207,6 +1224,7 @@
12081225
12091226 /**
12101227 * @see FileBackend::getLocalReference()
 1228+ * @return null|\TempFSFile
12111229 */
12121230 public function getLocalReference( array $params ) {
12131231 wfProfileIn( __METHOD__ );
@@ -1226,6 +1244,7 @@
12271245
12281246 /**
12291247 * @see FileBackend::streamFile()
 1248+ * @return Status
12301249 */
12311250 final public function streamFile( array $params ) {
12321251 wfProfileIn( __METHOD__ );
@@ -1253,6 +1272,7 @@
12541273
12551274 /**
12561275 * @see FileBackendStore::streamFile()
 1276+ * @return Status
12571277 */
12581278 protected function doStreamFile( array $params ) {
12591279 $status = Status::newGood();
@@ -1268,7 +1288,8 @@
12691289 }
12701290
12711291 /**
1272 - * @copydoc FileBackend::getFileList()
 1292+ * @copydoc FileBackend::getFileList()
 1293+ * @return Array|FileBackendStoreShardListIterator|null|Traversable
12731294 */
12741295 final public function getFileList( array $params ) {
12751296 list( $fullCont, $dir, $shard ) = $this->resolveStoragePath( $params['dir'] );
@@ -1349,6 +1370,7 @@
13501371
13511372 /**
13521373 * @see FileBackend::doOperationsInternal()
 1374+ * @return Status
13531375 */
13541376 protected function doOperationsInternal( array $ops, array $opts ) {
13551377 wfProfileIn( __METHOD__ );
Index: trunk/phase3/includes/filerepo/backend/FileBackendMultiWrite.php
@@ -76,6 +76,7 @@
7777
7878 /**
7979 * @see FileBackend::doOperationsInternal()
 80+ * @return Status
8081 */
8182 final protected function doOperationsInternal( array $ops, array $opts ) {
8283 $status = Status::newGood();
@@ -277,6 +278,7 @@
278279
279280 /**
280281 * @see FileBackend::doPrepare()
 282+ * @return Status
281283 */
282284 public function doPrepare( array $params ) {
283285 $status = Status::newGood();
@@ -289,6 +291,7 @@
290292
291293 /**
292294 * @see FileBackend::doSecure()
 295+ * @return Status
293296 */
294297 public function doSecure( array $params ) {
295298 $status = Status::newGood();
@@ -301,6 +304,7 @@
302305
303306 /**
304307 * @see FileBackend::doClean()
 308+ * @return Status
305309 */
306310 public function doClean( array $params ) {
307311 $status = Status::newGood();
Index: trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php
@@ -90,6 +90,7 @@
9191
9292 /**
9393 * @see LockManager::doLock()
 94+ * @return Status
9495 */
9596 protected function doLock( array $paths, $type ) {
9697 $status = Status::newGood();
@@ -140,6 +141,7 @@
141142
142143 /**
143144 * @see LockManager::doUnlock()
 145+ * @return Status
144146 */
145147 protected function doUnlock( array $paths, $type ) {
146148 $status = Status::newGood();
Index: trunk/phase3/includes/filerepo/backend/FSFileBackend.php
@@ -62,6 +62,7 @@
6363
6464 /**
6565 * @see FileBackendStore::resolveContainerPath()
 66+ * @return null|string
6667 */
6768 protected function resolveContainerPath( $container, $relStoragePath ) {
6869 // Check that container has a root directory
@@ -130,6 +131,7 @@
131132
132133 /**
133134 * @see FileBackendStore::isPathUsableInternal()
 135+ * @return bool
134136 */
135137 public function isPathUsableInternal( $storagePath ) {
136138 $fsPath = $this->resolveToFSPath( $storagePath );
@@ -151,6 +153,7 @@
152154
153155 /**
154156 * @see FileBackendStore::doStoreInternal()
 157+ * @return Status
155158 */
156159 protected function doStoreInternal( array $params ) {
157160 $status = Status::newGood();
@@ -191,6 +194,7 @@
192195
193196 /**
194197 * @see FileBackendStore::doCopyInternal()
 198+ * @return Status
195199 */
196200 protected function doCopyInternal( array $params ) {
197201 $status = Status::newGood();
@@ -237,6 +241,7 @@
238242
239243 /**
240244 * @see FileBackendStore::doMoveInternal()
 245+ * @return Status
241246 */
242247 protected function doMoveInternal( array $params ) {
243248 $status = Status::newGood();
@@ -285,6 +290,7 @@
286291
287292 /**
288293 * @see FileBackendStore::doDeleteInternal()
 294+ * @return Status
289295 */
290296 protected function doDeleteInternal( array $params ) {
291297 $status = Status::newGood();
@@ -315,6 +321,7 @@
316322
317323 /**
318324 * @see FileBackendStore::doCreateInternal()
 325+ * @return Status
319326 */
320327 protected function doCreateInternal( array $params ) {
321328 $status = Status::newGood();
@@ -355,6 +362,7 @@
356363
357364 /**
358365 * @see FileBackendStore::doPrepareInternal()
 366+ * @return Status
359367 */
360368 protected function doPrepareInternal( $fullCont, $dirRel, array $params ) {
361369 $status = Status::newGood();
@@ -373,6 +381,7 @@
374382
375383 /**
376384 * @see FileBackendStore::doSecureInternal()
 385+ * @return Status
377386 */
378387 protected function doSecureInternal( $fullCont, $dirRel, array $params ) {
379388 $status = Status::newGood();
@@ -407,6 +416,7 @@
408417
409418 /**
410419 * @see FileBackendStore::doCleanInternal()
 420+ * @return Status
411421 */
412422 protected function doCleanInternal( $fullCont, $dirRel, array $params ) {
413423 $status = Status::newGood();
@@ -423,6 +433,7 @@
424434
425435 /**
426436 * @see FileBackendStore::doFileExists()
 437+ * @return array|bool|null
427438 */
428439 protected function doGetFileStat( array $params ) {
429440 $source = $this->resolveToFSPath( $params['src'] );
@@ -455,6 +466,7 @@
456467
457468 /**
458469 * @see FileBackendStore::getFileListInternal()
 470+ * @return array|FSFileBackendFileList|null
459471 */
460472 public function getFileListInternal( $fullCont, $dirRel, array $params ) {
461473 list( $b, $shortCont, $r ) = FileBackend::splitStoragePath( $params['dir'] );
@@ -479,6 +491,7 @@
480492
481493 /**
482494 * @see FileBackendStore::getLocalReference()
 495+ * @return FSFile|null
483496 */
484497 public function getLocalReference( array $params ) {
485498 $source = $this->resolveToFSPath( $params['src'] );
@@ -490,6 +503,7 @@
491504
492505 /**
493506 * @see FileBackendStore::getLocalCopy()
 507+ * @return null|TempFSFile
494508 */
495509 public function getLocalCopy( array $params ) {
496510 $source = $this->resolveToFSPath( $params['src'] );
Index: trunk/phase3/includes/filerepo/backend/SwiftFileBackend.php
@@ -68,6 +68,7 @@
6969
7070 /**
7171 * @see FileBackendStore::resolveContainerPath()
 72+ * @return null
7273 */
7374 protected function resolveContainerPath( $container, $relStoragePath ) {
7475 if ( strlen( urlencode( $relStoragePath ) ) > 1024 ) {
@@ -78,6 +79,7 @@
7980
8081 /**
8182 * @see FileBackendStore::isPathUsableInternal()
 83+ * @return bool
8284 */
8385 public function isPathUsableInternal( $storagePath ) {
8486 list( $container, $rel ) = $this->resolveStoragePathReal( $storagePath );
@@ -99,6 +101,7 @@
100102
101103 /**
102104 * @see FileBackendStore::doCreateInternal()
 105+ * @return Status
103106 */
104107 protected function doCreateInternal( array $params ) {
105108 $status = Status::newGood();
@@ -161,6 +164,7 @@
162165
163166 /**
164167 * @see FileBackendStore::doStoreInternal()
 168+ * @return Status
165169 */
166170 protected function doStoreInternal( array $params ) {
167171 $status = Status::newGood();
@@ -229,6 +233,7 @@
230234
231235 /**
232236 * @see FileBackendStore::doCopyInternal()
 237+ * @return Status
233238 */
234239 protected function doCopyInternal( array $params ) {
235240 $status = Status::newGood();
@@ -284,6 +289,7 @@
285290
286291 /**
287292 * @see FileBackendStore::doDeleteInternal()
 293+ * @return Status
288294 */
289295 protected function doDeleteInternal( array $params ) {
290296 $status = Status::newGood();
@@ -315,6 +321,7 @@
316322
317323 /**
318324 * @see FileBackendStore::doPrepareInternal()
 325+ * @return Status
319326 */
320327 protected function doPrepareInternal( $fullCont, $dir, array $params ) {
321328 $status = Status::newGood();
@@ -360,6 +367,7 @@
361368
362369 /**
363370 * @see FileBackendStore::doSecureInternal()
 371+ * @return Status
364372 */
365373 protected function doSecureInternal( $fullCont, $dir, array $params ) {
366374 $status = Status::newGood();
@@ -394,6 +402,7 @@
395403
396404 /**
397405 * @see FileBackendStore::doCleanInternal()
 406+ * @return Status
398407 */
399408 protected function doCleanInternal( $fullCont, $dir, array $params ) {
400409 $status = Status::newGood();
@@ -438,6 +447,7 @@
439448
440449 /**
441450 * @see FileBackendStore::doFileExists()
 451+ * @return array|bool|null
442452 */
443453 protected function doGetFileStat( array $params ) {
444454 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -499,6 +509,7 @@
500510
501511 /**
502512 * @see FileBackend::getFileContents()
 513+ * @return bool|null|string
503514 */
504515 public function getFileContents( array $params ) {
505516 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
@@ -526,6 +537,7 @@
527538
528539 /**
529540 * @see FileBackendStore::getFileListInternal()
 541+ * @return SwiftFileBackendFileList
530542 */
531543 public function getFileListInternal( $fullCont, $dir, array $params ) {
532544 return new SwiftFileBackendFileList( $this, $fullCont, $dir );
@@ -559,6 +571,7 @@
560572
561573 /**
562574 * @see FileBackendStore::doGetFileSha1base36()
 575+ * @return bool
563576 */
564577 public function doGetFileSha1base36( array $params ) {
565578 $stat = $this->getFileStat( $params );
@@ -571,6 +584,7 @@
572585
573586 /**
574587 * @see FileBackendStore::doStreamFile()
 588+ * @return Status
575589 */
576590 protected function doStreamFile( array $params ) {
577591 $status = Status::newGood();
@@ -610,6 +624,7 @@
611625
612626 /**
613627 * @see FileBackendStore::getLocalCopy()
 628+ * @return null|TempFSFile
614629 */
615630 public function getLocalCopy( array $params ) {
616631 list( $srcCont, $srcRel ) = $this->resolveStoragePathReal( $params['src'] );
Index: trunk/phase3/includes/Article.php
@@ -1770,6 +1770,7 @@
17711771 *
17721772 * @param $fname String Name of called method
17731773 * @param $args Array Arguments to the method
 1774+ * @return mixed
17741775 */
17751776 public function __call( $fname, $args ) {
17761777 if ( is_callable( array( $this->mPage, $fname ) ) ) {
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -20,33 +20,48 @@
2121 */
2222
2323 if( !function_exists( 'iconv' ) ) {
24 - /** @codeCoverageIgnore */
 24+ /**
 25+ * @codeCoverageIgnore
 26+ * @return string
 27+ */
2528 function iconv( $from, $to, $string ) {
2629 return Fallback::iconv( $from, $to, $string );
2730 }
2831 }
2932
3033 if ( !function_exists( 'mb_substr' ) ) {
31 - /** @codeCoverageIgnore */
 34+ /**
 35+ * @codeCoverageIgnore
 36+ * @return string
 37+ */
3238 function mb_substr( $str, $start, $count='end' ) {
3339 return Fallback::mb_substr( $str, $start, $count );
3440 }
3541
36 - /** @codeCoverageIgnore */
 42+ /**
 43+ * @codeCoverageIgnore
 44+ * @return int
 45+ */
3746 function mb_substr_split_unicode( $str, $splitPos ) {
3847 return Fallback::mb_substr_split_unicode( $str, $splitPos );
3948 }
4049 }
4150
4251 if ( !function_exists( 'mb_strlen' ) ) {
43 - /** @codeCoverageIgnore */
 52+ /**
 53+ * @codeCoverageIgnore
 54+ * @return int
 55+ */
4456 function mb_strlen( $str, $enc = '' ) {
4557 return Fallback::mb_strlen( $str, $enc );
4658 }
4759 }
4860
4961 if( !function_exists( 'mb_strpos' ) ) {
50 - /** @codeCoverageIgnore */
 62+ /**
 63+ * @codeCoverageIgnore
 64+ * @return int
 65+ */
5166 function mb_strpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
5267 return Fallback::mb_strpos( $haystack, $needle, $offset, $encoding );
5368 }
@@ -54,7 +69,10 @@
5570 }
5671
5772 if( !function_exists( 'mb_strrpos' ) ) {
58 - /** @codeCoverageIgnore */
 73+ /**
 74+ * @codeCoverageIgnore
 75+ * @return int
 76+ */
5977 function mb_strrpos( $haystack, $needle, $offset = 0, $encoding = '' ) {
6078 return Fallback::mb_strrpos( $haystack, $needle, $offset, $encoding );
6179 }
@@ -63,7 +81,10 @@
6482
6583 // Support for Wietse Venema's taint feature
6684 if ( !function_exists( 'istainted' ) ) {
67 - /** @codeCoverageIgnore */
 85+ /**
 86+ * @codeCoverageIgnore
 87+ * @return int
 88+ */
6889 function istainted( $var ) {
6990 return 0;
7091 }
@@ -885,6 +906,7 @@
886907
887908 /**
888909 * Returns true if debug logging should be suppressed if $wgDebugRawPage = false
 910+ * @return bool
889911 */
890912 function wfIsDebugRawPage() {
891913 static $cache;
Index: trunk/phase3/includes/HttpFunctions.php
@@ -376,6 +376,7 @@
377377 *
378378 * @param $fh handle
379379 * @param $content String
 380+ * @return int
380381 */
381382 public function read( $fh, $content ) {
382383 $this->content .= $content;
Index: trunk/phase3/includes/Cookie.php
@@ -193,6 +193,7 @@
194194
195195 /**
196196 * @see Cookie::serializeToHttpRequest
 197+ * @return string
197198 */
198199 public function serializeToHttpRequest( $path, $domain ) {
199200 $cookies = array();
@@ -213,6 +214,7 @@
214215 *
215216 * @param $cookie String
216217 * @param $domain String: cookie's domain
 218+ * @return null
217219 */
218220 public function parseCookieResponseHeader ( $cookie, $domain ) {
219221 $len = strlen( 'Set-Cookie:' );
Index: trunk/phase3/includes/actions/HistoryAction.php
@@ -782,6 +782,7 @@
783783
784784 /**
785785 * Get the "prevent clickjacking" flag
 786+ * @return bool
786787 */
787788 function getPreventClickjacking() {
788789 return $this->preventClickjacking;
Index: trunk/phase3/includes/api/ApiUpload.php
@@ -113,6 +113,7 @@
114114 }
115115 /**
116116 * Get an uplaod result based on upload context
 117+ * @return array
117118 */
118119 private function getContextResult(){
119120 $warnings = $this->getApiWarnings();
@@ -131,7 +132,8 @@
132133 return $this->performUpload();
133134 }
134135 /**
135 - * Get Stash Result, throws an expetion if the file could not be stashed.
 136+ * Get Stash Result, throws an expetion if the file could not be stashed.
 137+ * @return array
136138 */
137139 private function getStashResult(){
138140 $result = array ();
@@ -149,6 +151,7 @@
150152 /**
151153 * Get Warnings Result
152154 * @param $warnings Array of Api upload warnings
 155+ * @return array
153156 */
154157 private function getWarningsResult( $warnings ){
155158 $result = array();
@@ -165,7 +168,8 @@
166169 return $result;
167170 }
168171 /**
169 - * Get the result of a chunk upload.
 172+ * Get the result of a chunk upload.
 173+ * @return array
170174 */
171175 private function getChunkResult(){
172176 $result = array();
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -313,6 +313,7 @@
314314
315315 /**
316316 * Returns true if this database supports (and uses) cascading deletes
 317+ * @return bool
317318 */
318319 function cascadingDeletes() {
319320 return true;
@@ -321,6 +322,7 @@
322323 /**
323324 * Returns true if this database supports (and uses) triggers (e.g. on the
324325 * page table)
 326+ * @return bool
325327 */
326328 function cleanupTriggers() {
327329 return true;
@@ -330,6 +332,7 @@
331333 * Returns true if this database is strict about what can be put into an
332334 * IP field.
333335 * Specifically, it uses a NULL value instead of an empty string.
 336+ * @return bool
334337 */
335338 function strictIPs() {
336339 return true;
@@ -337,13 +340,15 @@
338341
339342 /**
340343 * Returns true if this database uses timestamps rather than integers
341 - */
 344+ * @return bool
 345+ */
342346 function realTimestamps() {
343347 return true;
344348 }
345349
346350 /**
347351 * Returns true if this database does an implicit sort when doing GROUP BY
 352+ * @return bool
348353 */
349354 function implicitGroupby() {
350355 return false;
@@ -353,6 +358,7 @@
354359 * Returns true if this database does an implicit order by when the column
355360 * has an index
356361 * For example: SELECT page_title FROM page LIMIT 1
 362+ * @return bool
357363 */
358364 function implicitOrderby() {
359365 return false;
@@ -361,6 +367,7 @@
362368 /**
363369 * Returns true if this database can do a native search on IP columns
364370 * e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32';
 371+ * @return bool
365372 */
366373 function searchableIPs() {
367374 return true;
@@ -368,6 +375,7 @@
369376
370377 /**
371378 * Returns true if this database can use functional indexes
 379+ * @return bool
372380 */
373381 function functionalIndexes() {
374382 return true;
@@ -375,6 +383,7 @@
376384
377385 /**
378386 * Returns a unique string representing the wiki on the server
 387+ * @return string
379388 */
380389 public function getWikiID() {
381390 if( $this->mSchema ) {
@@ -546,6 +555,7 @@
547556 /**
548557 * Closes a database connection, if it is open
549558 * Returns success, true if already closed
 559+ * @return bool
550560 */
551561 public function close() {
552562 $this->mOpened = false;
@@ -562,6 +572,7 @@
563573 /**
564574 * Retrieves the most current database error
565575 * Forces a database rollback
 576+ * @return bool|string
566577 */
567578 public function lastError() {
568579 $connerr = db2_conn_errormsg();
@@ -836,6 +847,7 @@
837848 * LIST_SET - comma separated with field names, like a SET clause
838849 * LIST_NAMES - comma separated field names
839850 * LIST_SET_PREPARED - like LIST_SET, except with ? tokens as values
 851+ * @return string
840852 */
841853 function makeList( $a, $mode = LIST_COMMA ) {
842854 if ( !is_array( $a ) ) {
@@ -873,6 +885,7 @@
874886 * @param $sql string SQL query we will append the limit too
875887 * @param $limit integer the SQL limit
876888 * @param $offset integer the SQL offset (default false)
 889+ * @return string
877890 */
878891 public function limitResult( $sql, $limit, $offset=false ) {
879892 if( !is_numeric( $limit ) ) {
@@ -1153,6 +1166,7 @@
11541167 * DELETE query wrapper
11551168 *
11561169 * Use $conds == "*" to delete all rows
 1170+ * @return bool|\ResultWrapper
11571171 */
11581172 public function delete( $table, $conds, $fname = 'DatabaseIbm_db2::delete' ) {
11591173 if ( !$conds ) {
@@ -1640,6 +1654,7 @@
16411655 * in the appropriate places.
16421656 * @param $query String
16431657 * @param $args ...
 1658+ * @return Resource
16441659 */
16451660 public function safeQuery( $query, $args = null ) {
16461661 // copied verbatim from Database.php
@@ -1674,6 +1689,7 @@
16751690
16761691 /**
16771692 * Switches module between regular and install modes
 1693+ * @return string
16781694 */
16791695 public function setMode( $mode ) {
16801696 $old = $this->mMode;
Index: trunk/phase3/includes/db/Database.php
@@ -641,6 +641,7 @@
642642 * Same as new factory( ... ), kept for backward compatibility
643643 * @deprecated since 1.18
644644 * @see Database::factory()
 645+ * @return DatabaseBase
645646 */
646647 public final static function newFromType( $dbType, $p = array() ) {
647648 wfDeprecated( __METHOD__, '1.18' );
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -46,6 +46,7 @@
4747
4848 /**
4949 * Usually aborts on failure
 50+ * @return bool|DatabaseBase|null
5051 */
5152 function open( $server, $user, $password, $dbName ) {
5253 # Test for driver support, to avoid suppressed fatal error
@@ -107,6 +108,7 @@
108109 /**
109110 * Closes a database connection, if it is open
110111 * Returns success, true if already closed
 112+ * @return bool
111113 */
112114 function close() {
113115 $this->mOpened = false;
@@ -226,6 +228,7 @@
227229
228230 /**
229231 * This must be called after nextSequenceVal
 232+ * @return null
230233 */
231234 function insertId() {
232235 return $this->mInsertId;
@@ -310,6 +313,7 @@
311314 * This is not necessarily an accurate estimate, so use sparingly
312315 * Returns -1 if count cannot be found
313316 * Takes same arguments as Database::select()
 317+ * @return int
314318 */
315319 function estimateRowCount( $table, $vars = '*', $conds = '', $fname = 'DatabaseMssql::estimateRowCount', $options = array() ) {
316320 $options['EXPLAIN'] = true;// http://msdn2.microsoft.com/en-us/library/aa259203.aspx
@@ -326,6 +330,7 @@
327331 /**
328332 * Returns information about an index
329333 * If errors are explicitly ignored, returns NULL on failure
 334+ * @return array|bool|null
330335 */
331336 function indexInfo( $table, $index, $fname = 'DatabaseMssql::indexExists' ) {
332337 # This does not return the same info as MYSQL would, but that's OK because MediaWiki never uses the
@@ -365,6 +370,7 @@
366371 *
367372 * Usually aborts on failure
368373 * If errors are explicitly ignored, returns success
 374+ * @return bool
369375 */
370376 function insert( $table, $arrToInsert, $fname = 'DatabaseMssql::insert', $options = array() ) {
371377 # No rows to insert, easy just return now
@@ -494,6 +500,7 @@
495501 * Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes()
496502 * $conds may be "*" to copy the whole table
497503 * srcTable may be an array of tables.
 504+ * @return null|\ResultWrapper
498505 */
499506 function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect',
500507 $insertOptions = array(), $selectOptions = array() ) {
@@ -511,6 +518,7 @@
512519
513520 /**
514521 * Return the next in a sequence, save the value for retrieval via insertId()
 522+ * @return
515523 */
516524 function nextSequenceValue( $seqName ) {
517525 if ( !$this->tableExists( 'sequence_' . $seqName ) ) {
@@ -527,6 +535,7 @@
528536
529537 /**
530538 * Return the current value of a sequence. Assumes it has ben nextval'ed in this session.
 539+ * @return
531540 */
532541 function currentSequenceValue( $seqName ) {
533542 $ret = sqlsrv_query( $this->mConn, "SELECT TOP 1 id FROM [sequence_$seqName] ORDER BY id DESC" );
@@ -559,6 +568,7 @@
560569 * $sql string SQL query we will append the limit too
561570 * $limit integer the SQL limit
562571 * $offset integer the SQL offset (default false)
 572+ * @return mixed|string
563573 */
564574 function limitResult( $sql, $limit, $offset = false ) {
565575 if ( $offset === false || $offset == 0 ) {
@@ -647,6 +657,7 @@
648658
649659 /**
650660 * Query whether a given column exists in the mediawiki schema
 661+ * @return bool
651662 */
652663 function fieldExists( $table, $field, $fname = 'DatabaseMssql::fieldExists' ) {
653664 $table = $this->tableName( $table );
@@ -707,6 +718,7 @@
708719 * Escapes a identifier for use inm SQL.
709720 * Throws an exception if it is invalid.
710721 * Reference: http://msdn.microsoft.com/en-us/library/aa224033%28v=SQL.80%29.aspx
 722+ * @return string
711723 */
712724 private function escapeIdentifier( $identifier ) {
713725 if ( strlen( $identifier ) == 0 ) {
@@ -795,6 +807,7 @@
796808
797809 /**
798810 * @private
 811+ * @return string
799812 */
800813 function tableNamesWithUseIndexOrJOIN( $tables, $use_index = array(), $join_conds = array() ) {
801814 $ret = array();
@@ -893,6 +906,7 @@
894907
895908 /**
896909 * Get the type of the DBMS, as it appears in $wgDBtype.
 910+ * @return string
897911 */
898912 function getType(){
899913 return 'mssql';
@@ -909,6 +923,7 @@
910924 /**
911925 * Since MSSQL doesn't recognize the infinity keyword, set date manually.
912926 * @todo Remove magic date
 927+ * @return string
913928 */
914929 public function getInfinity() {
915930 return '3000-01-31 00:00:00.000';
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -497,6 +497,7 @@
498498
499499 /**
500500 * Based on generic method (parent) with some prior SQLite-sepcific adjustments
 501+ * @return bool
501502 */
502503 function insert( $table, $a, $fname = 'DatabaseSqlite::insert', $options = array() ) {
503504 if ( !count( $a ) ) {
@@ -723,6 +724,7 @@
724725
725726 /**
726727 * No-op version of deadlockLoop
 728+ * @return mixed
727729 */
728730 public function deadlockLoop( /*...*/ ) {
729731 $args = func_get_args();
Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -226,6 +226,7 @@
227227
228228 /**
229229 * Usually aborts on failure
 230+ * @return DatabaseBase|null
230231 */
231232 function open( $server, $user, $password, $dbName ) {
232233 if ( !function_exists( 'oci_connect' ) ) {
@@ -285,6 +286,7 @@
286287 /**
287288 * Closes a database connection, if it is open
288289 * Returns success, true if already closed
 290+ * @return bool
289291 */
290292 function close() {
291293 $this->mOpened = false;
@@ -401,6 +403,7 @@
402404
403405 /**
404406 * This must be called after nextSequenceVal
 407+ * @return null
405408 */
406409 function insertId() {
407410 return $this->mInsertId;
@@ -439,6 +442,7 @@
440443 /**
441444 * Returns information about an index
442445 * If errors are explicitly ignored, returns NULL on failure
 446+ * @return bool
443447 */
444448 function indexInfo( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
445449 return false;
@@ -679,6 +683,7 @@
680684 }
681685 /**
682686 * Return the next in a sequence, save the value for retrieval via insertId()
 687+ * @return null
683688 */
684689 function nextSequenceValue( $seqName ) {
685690 $res = $this->query( "SELECT $seqName.nextval FROM dual" );
@@ -689,6 +694,7 @@
690695
691696 /**
692697 * Return sequence_name if table has a sequence
 698+ * @return bool
693699 */
694700 private function getSequenceData( $table ) {
695701 if ( $this->sequenceData == null ) {
@@ -836,6 +842,7 @@
837843
838844 /**
839845 * Query whether a given index exists
 846+ * @return bool
840847 */
841848 function indexExists( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
842849 $table = $this->tableName( $table );
@@ -855,6 +862,7 @@
856863
857864 /**
858865 * Query whether a given table exists (in the given schema, or the default mw one if not given)
 866+ * @return int
859867 */
860868 function tableExists( $table, $fname = __METHOD__ ) {
861869 $table = $this->tableName( $table );
Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -145,6 +145,7 @@
146146
147147 /**
148148 * Usually aborts on failure
 149+ * @return DatabaseBase|null
149150 */
150151 function open( $server, $user, $password, $dbName ) {
151152 # Test for Postgres support, to avoid suppressed fatal error
@@ -237,6 +238,7 @@
238239 /**
239240 * Closes a database connection, if it is open
240241 * Returns success, true if already closed
 242+ * @return bool
241243 */
242244 function close() {
243245 $this->mOpened = false;
@@ -331,6 +333,7 @@
332334
333335 /**
334336 * This must be called after nextSequenceVal
 337+ * @return null
335338 */
336339 function insertId() {
337340 return $this->mInsertId;
@@ -371,6 +374,7 @@
372375 * This is not necessarily an accurate estimate, so use sparingly
373376 * Returns -1 if count cannot be found
374377 * Takes same arguments as Database::select()
 378+ * @return int
375379 */
376380 function estimateRowCount( $table, $vars = '*', $conds='', $fname = 'DatabasePostgres::estimateRowCount', $options = array() ) {
377381 $options['EXPLAIN'] = true;
@@ -389,6 +393,7 @@
390394 /**
391395 * Returns information about an index
392396 * If errors are explicitly ignored, returns NULL on failure
 397+ * @return bool|null
393398 */
394399 function indexInfo( $table, $index, $fname = 'DatabasePostgres::indexInfo' ) {
395400 $sql = "SELECT indexname FROM pg_indexes WHERE tablename='$table'";
@@ -555,6 +560,7 @@
556561 * $conds may be "*" to copy the whole table
557562 * srcTable may be an array of tables.
558563 * @todo FIXME: Implement this a little better (seperate select/insert)?
 564+ * @return bool
559565 */
560566 function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabasePostgres::insertSelect',
561567 $insertOptions = array(), $selectOptions = array() )
@@ -637,6 +643,7 @@
638644
639645 /**
640646 * Return the next in a sequence, save the value for retrieval via insertId()
 647+ * @return null
641648 */
642649 function nextSequenceValue( $seqName ) {
643650 $safeseq = str_replace( "'", "''", $seqName );
@@ -648,6 +655,7 @@
649656
650657 /**
651658 * Return the current value of a sequence. Assumes it has been nextval'ed in this session.
 659+ * @return
652660 */
653661 function currentSequenceValue( $seqName ) {
654662 $safeseq = str_replace( "'", "''", $seqName );
@@ -747,6 +755,7 @@
748756 /**
749757 * Query whether a given relation exists (in the given schema, or the
750758 * default mw one if not given)
 759+ * @return bool
751760 */
752761 function relationExists( $table, $types, $schema = false ) {
753762 global $wgDBmwschema;
@@ -770,6 +779,7 @@
771780 /**
772781 * For backward compatibility, this function checks both tables and
773782 * views.
 783+ * @return bool
774784 */
775785 function tableExists( $table, $fname = __METHOD__, $schema = false ) {
776786 return $this->relationExists( $table, array( 'r', 'v' ), $schema );
@@ -833,6 +843,7 @@
834844
835845 /**
836846 * Query whether a given schema exists. Returns true if it does, false if it doesn't.
 847+ * @return bool
837848 */
838849 function schemaExists( $schema ) {
839850 $exists = $this->selectField( '"pg_catalog"."pg_namespace"', 1,
@@ -842,6 +853,7 @@
843854
844855 /**
845856 * Returns true if a given role (i.e. user) exists, false otherwise.
 857+ * @return bool
846858 */
847859 function roleExists( $roleName ) {
848860 $exists = $this->selectField( '"pg_catalog"."pg_roles"', 1,
@@ -855,6 +867,7 @@
856868
857869 /**
858870 * pg_field_type() wrapper
 871+ * @return string
859872 */
860873 function fieldType( $res, $index ) {
861874 if ( $res instanceof ResultWrapper ) {
Index: trunk/phase3/includes/debug/Debug.php
@@ -87,6 +87,7 @@
8888
8989 /**
9090 * Returns internal log array
 91+ * @return array
9192 */
9293 public static function getLog() {
9394 return self::$log;
Index: trunk/phase3/includes/ChangesList.php
@@ -364,6 +364,7 @@
365365 * Insert a formatted action
366366 *
367367 * @param $rc RecentChange
 368+ * @return string
368369 */
369370 public function insertLogEntry( $rc ) {
370371 $formatter = LogFormatter::newFromRow( $rc->mAttribs );
@@ -375,6 +376,7 @@
376377 /**
377378 * Insert a formatted comment
378379 * @param $rc RecentChange
 380+ * @return string
379381 */
380382 public function insertComment( $rc ) {
381383 if( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) {
@@ -397,6 +399,7 @@
398400
399401 /**
400402 * Returns the string which indicates the number of watching users
 403+ * @return string
401404 */
402405 protected function numberofWatchingusers( $count ) {
403406 static $cache = array();
@@ -514,6 +517,7 @@
515518 * Format a line using the old system (aka without any javascript).
516519 *
517520 * @param $rc RecentChange
 521+ * @return string
518522 */
519523 public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
520524 global $wgRCShowChangedSize;
@@ -779,6 +783,7 @@
780784
781785 /**
782786 * Enhanced RC group
 787+ * @return string
783788 */
784789 protected function recentChangesBlockGroup( $block ) {
785790 global $wgRCShowChangedSize;

Follow-up revisions

RevisionCommit summaryAuthorDate
r111134Cleaned up some docs after r111101aaron00:49, 10 February 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   21:49, 9 February 2012

I hope these don't cause backport edit conflicts.

Status & tagging log