r108743 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108742‎ | r108743 | r108744 >
Date:19:12, 12 January 2012
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
Kill "* @return void"
Modified paths:
  • /trunk/phase3/includes/HistoryBlob.php (modified) (history)
  • /trunk/phase3/includes/Hooks.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/SquidPurgeClient.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/TitleArray.php (modified) (history)
  • /trunk/phase3/includes/UserArray.php (modified) (history)
  • /trunk/phase3/includes/Wiki.php (modified) (history)
  • /trunk/phase3/includes/WikiPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiImport.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllLinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllpages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryCategoryMembers.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryExtLinksUsage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryIWBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLangBacklinks.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryProtectedTitles.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRandom.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuerySearch.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlistRaw.php (modified) (history)
  • /trunk/phase3/includes/cache/FileCacheBase.php (modified) (history)
  • /trunk/phase3/includes/cache/HTMLFileCache.php (modified) (history)
  • /trunk/phase3/includes/cache/SquidUpdate.php (modified) (history)
  • /trunk/phase3/includes/db/CloneDatabase.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalRepo.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackend.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileBackendGroup.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/FileOp.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php (modified) (history)
  • /trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/file/TempFSFile.php (modified) (history)
  • /trunk/phase3/includes/media/GIFMetadataExtractor.php (modified) (history)
  • /trunk/phase3/includes/media/MediaTransformOutput.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreTagHooks.php (modified) (history)
  • /trunk/phase3/includes/parser/ParserOutput.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialImport.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialMergeHistory.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialShortpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /trunk/phase3/maintenance/benchmarks/bench_delete_truncate.php (modified) (history)
  • /trunk/phase3/maintenance/locking/LockServerDaemon.php (modified) (history)
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/benchmarks/bench_delete_truncate.php
@@ -44,8 +44,7 @@
4545 }
4646
4747 /**
48 - * @param $dbw DatabaseBase
49 - * @return void
 48+ * @param $dbw DatabaseBase
5049 */
5150 private function insertData( $dbw ) {
5251 $range = range( 0, 1024 );
@@ -57,16 +56,14 @@
5857 }
5958
6059 /**
61 - * @param $dbw DatabaseBase
62 - * @return void
 60+ * @param $dbw DatabaseBase
6361 */
6462 private function delete( $dbw ) {
6563 $dbw->delete( 'text', '*', __METHOD__ );
6664 }
6765
6866 /**
69 - * @param $dbw DatabaseBase
70 - * @return void
 67+ * @param $dbw DatabaseBase
7168 */
7269 private function truncate( $dbw ) {
7370 $test = $dbw->tableName( 'test' );
Index: trunk/phase3/maintenance/locking/LockServerDaemon.php
@@ -101,9 +101,6 @@
102102 : 10;
103103 }
104104
105 - /**
106 - * @return void
107 - */
108105 protected function setupSocket() {
109106 if ( !function_exists( 'socket_create' ) ) {
110107 throw new Exception( "PHP sockets extension missing from PHP CLI mode." );
@@ -125,9 +122,6 @@
126123 $this->startTime = time();
127124 }
128125
129 - /**
130 - * @return void
131 - */
132126 public function main() {
133127 // Setup socket and start listing
134128 $this->setupSocket();
@@ -354,8 +348,6 @@
355349
356350 /**
357351 * Clear locks for sessions that have been dead for a while
358 - *
359 - * @return void
360352 */
361353 protected function purgeExpiredLocks() {
362354 $now = time();
@@ -370,7 +362,6 @@
371363 /**
372364 * @param $key string
373365 * @param $session string
374 - * @return void
375366 */
376367 protected function set_sh_lock( $key, $session ) {
377368 if ( !isset( $this->shLocks[$key][$session] ) ) {
@@ -383,7 +374,6 @@
384375 /**
385376 * @param $key string
386377 * @param $session string
387 - * @return void
388378 */
389379 protected function set_ex_lock( $key, $session ) {
390380 if ( !isset( $this->exLocks[$key][$session] ) ) {
@@ -396,7 +386,6 @@
397387 /**
398388 * @param $key string
399389 * @param $session string
400 - * @return void
401390 */
402391 protected function unset_sh_lock( $key, $session ) {
403392 if ( isset( $this->shLocks[$key][$session] ) ) {
@@ -415,7 +404,6 @@
416405 /**
417406 * @param $key string
418407 * @param $session string
419 - * @return void
420408 */
421409 protected function unset_ex_lock( $key, $session ) {
422410 if ( isset( $this->exLocks[$key] ) && $this->exLocks[$key] === $session ) {
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -12,7 +12,6 @@
1313 class CoreParserFunctions {
1414 /**
1515 * @param $parser Parser
16 - * @return void
1716 */
1817 static function register( $parser ) {
1918 global $wgAllowDisplayTitle, $wgAllowSlowParserFunctions;
Index: trunk/phase3/includes/parser/ParserOutput.php
@@ -286,7 +286,6 @@
287287 * @param $name string Title dbKey
288288 * @param $timestamp string MW timestamp of file creation (or false if non-existing)
289289 * @param $sha string base 36 SHA-1 of file (or false if non-existing)
290 - * @return void
291290 */
292291 function addImage( $name, $timestamp = null, $sha1 = null ) {
293292 $this->mImages[$name] = 1;
@@ -300,7 +299,6 @@
301300 * @param $title Title
302301 * @param $page_id
303302 * @param $rev_id
304 - * @return void
305303 */
306304 function addTemplate( $title, $page_id, $rev_id ) {
307305 $ns = $title->getNamespace();
Index: trunk/phase3/includes/parser/CoreTagHooks.php
@@ -12,7 +12,6 @@
1313 class CoreTagHooks {
1414 /**
1515 * @param $parser Parser
16 - * @return void
1716 */
1817 static function register( $parser ) {
1918 global $wgRawHtml;
Index: trunk/phase3/includes/ImagePage.php
@@ -39,8 +39,7 @@
4040 }
4141
4242 /**
43 - * @param $file File:
44 - * @return void
 43+ * @param $file File
4544 */
4645 public function setFile( $file ) {
4746 $this->mPage->setFile( $file );
Index: trunk/phase3/includes/TitleArray.php
@@ -53,7 +53,6 @@
5454
5555 /**
5656 * @param $row ResultWrapper
57 - * @return void
5857 */
5958 protected function setCurrent( $row ) {
6059 if ( $row === false ) {
Index: trunk/phase3/includes/db/Database.php
@@ -3052,7 +3052,6 @@
30533053 * Override database's default connection timeout
30543054 *
30553055 * @param $timeout Integer in seconds
3056 - * @return void
30573056 * @deprecated since 1.19; use setSessionOptions()
30583057 */
30593058 public function setTimeout( $timeout ) {
@@ -3068,7 +3067,6 @@
30693068 * hours or days.
30703069 *
30713070 * @param $options Array
3072 - * @return void
30733071 */
30743072 public function setSessionOptions( array $options ) {}
30753073
Index: trunk/phase3/includes/db/CloneDatabase.php
@@ -86,18 +86,18 @@
8787 * Clone the table structure
8888 */
8989 public function cloneTableStructure() {
90 -
 90+
9191 foreach( $this->tablesToClone as $tbl ) {
9292 # Clean up from previous aborted run. So that table escaping
9393 # works correctly across DB engines, we need to change the pre-
9494 # fix back and forth so tableName() works right.
95 -
 95+
9696 self::changePrefix( $this->oldTablePrefix );
9797 $oldTableName = $this->db->tableName( $tbl, 'raw' );
98 -
 98+
9999 self::changePrefix( $this->newTablePrefix );
100100 $newTableName = $this->db->tableName( $tbl, 'raw' );
101 -
 101+
102102 if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres', 'oracle' ) ) ) {
103103 $this->db->dropTable( $tbl, __METHOD__ );
104104 wfDebug( __METHOD__." dropping {$newTableName}\n", true);
@@ -107,9 +107,9 @@
108108 # Create new table
109109 wfDebug( __METHOD__." duplicating $oldTableName to $newTableName\n", true );
110110 $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
111 -
 111+
112112 }
113 -
 113+
114114 }
115115
116116 /**
@@ -129,8 +129,7 @@
130130 /**
131131 * Change the table prefix on all open DB connections/
132132 *
133 - * @param $prefix
134 - * @return void
 133+ * @param $prefix
135134 */
136135 public static function changePrefix( $prefix ) {
137136 global $wgDBprefix;
@@ -139,18 +138,16 @@
140139 }
141140
142141 /**
143 - * @param $lb LoadBalancer
144 - * @param $prefix
145 - * @return void
 142+ * @param $lb LoadBalancer
 143+ * @param $prefix
146144 */
147145 public static function changeLBPrefix( $lb, $prefix ) {
148146 $lb->forEachOpenConnection( array( 'CloneDatabase', 'changeDBPrefix' ), array( $prefix ) );
149147 }
150148
151149 /**
152 - * @param $db DatabaseBase
153 - * @param $prefix
154 - * @return void
 150+ * @param $db DatabaseBase
 151+ * @param $prefix
155152 */
156153 public static function changeDBPrefix( $db, $prefix ) {
157154 $db->tablePrefix( $prefix );
Index: trunk/phase3/includes/filerepo/file/TempFSFile.php
@@ -66,7 +66,6 @@
6767 * Clean up the temporary file only after an object goes out of scope
6868 *
6969 * @param $object Object
70 - * @return void
7170 */
7271 public function bind( $object ) {
7372 if ( is_object( $object ) ) {
@@ -76,8 +75,6 @@
7776
7877 /**
7978 * Set flag to not clean up after the temporary file
80 - *
81 - * @return void
8279 */
8380 public function preserve() {
8481 $this->canDelete = false;
Index: trunk/phase3/includes/filerepo/file/File.php
@@ -1694,8 +1694,7 @@
16951695 }
16961696
16971697 /**
1698 - * @param $from
1699 - * @return void
 1698+ * @param $from
17001699 */
17011700 function redirectedFrom( $from ) {
17021701 $this->redirected = $from;
Index: trunk/phase3/includes/filerepo/LocalRepo.php
@@ -261,7 +261,6 @@
262262 * Invalidates image redirect cache related to that image
263263 *
264264 * @param $title Title of page
265 - * @return void
266265 */
267266 function invalidateImageRedirect( Title $title ) {
268267 global $wgMemc;
Index: trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php
@@ -281,7 +281,6 @@
282282 *
283283 * @param $lockDb string
284284 * @param $db DatabaseBase
285 - * @return void
286285 * @throws DBError
287286 */
288287 protected function initConnection( $lockDb, DatabaseBase $db ) {}
Index: trunk/phase3/includes/filerepo/backend/lockmanager/LockManagerGroup.php
@@ -27,8 +27,6 @@
2828
2929 /**
3030 * Register lock managers from the global variables
31 - *
32 - * @return void
3331 */
3432 protected function initFromGlobals() {
3533 global $wgLockManagers;
@@ -40,7 +38,6 @@
4139 * Register an array of file lock manager configurations
4240 *
4341 * @param $configs Array
44 - * @return void
4542 * @throws MWException
4643 */
4744 protected function register( array $configs ) {
Index: trunk/phase3/includes/filerepo/backend/FileOp.php
@@ -54,8 +54,6 @@
5555
5656 /**
5757 * Disable file backups for this operation
58 - *
59 - * @return void
6058 */
6159 final protected function disableBackups() {
6260 $this->useBackups = false;
@@ -65,8 +63,6 @@
6664 * Allow stale data for file reads and existence checks.
6765 * If this is called, then disableBackups() should also be called
6866 * unless the affected files are known to have not changed recently.
69 - *
70 - * @return void
7167 */
7268 final protected function allowStaleReads() {
7369 $this->useLatest = false;
@@ -504,7 +500,6 @@
505501 * Log a file operation failure and preserve any temp files
506502 *
507503 * @param $fileOp FileOp
508 - * @return void
509504 */
510505 final protected function logFailure( $action ) {
511506 $params = $this->params;
Index: trunk/phase3/includes/filerepo/backend/FileBackendGroup.php
@@ -32,8 +32,6 @@
3333
3434 /**
3535 * Destroy the singleton instance
36 - *
37 - * @return void
3836 */
3937 public static function destroySingleton() {
4038 self::$instance = null;
@@ -41,8 +39,6 @@
4240
4341 /**
4442 * Register file backends from the global variables
45 - *
46 - * @return void
4743 */
4844 protected function initFromGlobals() {
4945 global $wgLocalFileRepo, $wgForeignFileRepos, $wgFileBackends;
@@ -93,7 +89,6 @@
9490 * Register an array of file backend configurations
9591 *
9692 * @param $configs Array
97 - * @return void
9893 * @throws MWException
9994 */
10095 protected function register( array $configs ) {
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php
@@ -515,7 +515,6 @@
516516 * If $paths is given, then only the cache for those files will be cleared.
517517 *
518518 * @param $paths Array Storage paths
519 - * @return void
520519 */
521520 abstract public function clearCache( array $paths = null );
522521
@@ -1164,8 +1163,6 @@
11651164
11661165 /**
11671166 * Prune the cache if it is too big to add an item
1168 - *
1169 - * @return void
11701167 */
11711168 protected function trimCache() {
11721169 if ( count( $this->cache ) >= $this->maxCacheSize ) {
Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -126,7 +126,6 @@
127127 * directories, in case the user has not configured offline storage
128128 *
129129 * @param $dir string
130 - * @return void
131130 */
132131 protected function initDeletedDir( $dir ) {
133132 $this->backend->secure( // prevent web access & dir listings
@@ -718,8 +717,7 @@
719718 * Each file can be a (zone, rel) pair, virtual url, storage path, or FS path.
720719 * It will try to delete each file, but ignores any errors that may occur.
721720 *
722 - * @param $pairs array List of files to delete
723 - * @return void
 721+ * @param $files array List of files to delete
724722 */
725723 public function cleanupBatch( $files ) {
726724 $operations = array();
@@ -1217,7 +1215,6 @@
12181216 * May use either the database or the filesystem.
12191217 *
12201218 * @param $callback Array|string
1221 - * @return void
12221219 */
12231220 public function enumFiles( $callback ) {
12241221 $this->enumFilesInStorage( $callback );
@@ -1228,7 +1225,6 @@
12291226 * May use either the database or the filesystem.
12301227 *
12311228 * @param $callback Array|string
1232 - * @return void
12331229 */
12341230 protected function enumFilesInStorage( $callback ) {
12351231 $publicRoot = $this->getZonePath( 'public' );
Index: trunk/phase3/includes/SquidPurgeClient.php
@@ -340,7 +340,6 @@
341341
342342 /**
343343 * @param $client SquidPurgeClient
344 - * @return void
345344 */
346345 public function addClient( $client ) {
347346 $this->clients[] = $client;
Index: trunk/phase3/includes/Hooks.php
@@ -39,7 +39,6 @@
4040 *
4141 * @param $name Mixed: name of hook
4242 * @param $callback Mixed: callback function to attach
43 - * @return void
4443 */
4544 public static function register( $name, $callback ) {
4645 if( !isset( self::$handlers[$name] ) ) {
Index: trunk/phase3/includes/api/ApiQueryAllLinks.php
@@ -49,7 +49,6 @@
5050
5151 /**
5252 * @param $resultPageSet ApiPageSet
53 - * @return void
5453 */
5554 private function run( $resultPageSet = null ) {
5655 $db = $this->getDB();
Index: trunk/phase3/includes/api/ApiQueryRandom.php
@@ -46,12 +46,11 @@
4747 }
4848
4949 /**
50 - * @param $randstr
51 - * @param $limit
52 - * @param $namespace
 50+ * @param $randstr
 51+ * @param $limit
 52+ * @param $namespace
5353 * @param $resultPageSet ApiPageSet
54 - * @param $redirect
55 - * @return void
 54+ * @param $redirect
5655 */
5756 protected function prepareQuery( $randstr, $limit, $namespace, &$resultPageSet, $redirect ) {
5857 $this->resetQueryParams();
@@ -101,7 +100,6 @@
102101
103102 /**
104103 * @param $resultPageSet ApiPageSet
105 - * @return void
106104 */
107105 public function run( $resultPageSet = null ) {
108106 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryExtLinksUsage.php
@@ -47,7 +47,6 @@
4848
4949 /**
5050 * @param $resultPageSet ApiPageSet
51 - * @return void
5251 */
5352 private function run( $resultPageSet = null ) {
5453 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryAllpages.php
@@ -45,7 +45,6 @@
4646
4747 /**
4848 * @param $resultPageSet ApiPageSet
49 - * @return void
5049 */
5150 public function executeGenerator( $resultPageSet ) {
5251 if ( $resultPageSet->isResolvingRedirects() ) {
@@ -57,7 +56,6 @@
5857
5958 /**
6059 * @param $resultPageSet ApiPageSet
61 - * @return void
6260 */
6361 private function run( $resultPageSet = null ) {
6462 $db = $this->getDB();
Index: trunk/phase3/includes/api/ApiQueryBacklinks.php
@@ -119,7 +119,6 @@
120120
121121 /**
122122 * @param $resultPageSet ApiPageSet
123 - * @return void
124123 */
125124 private function prepareFirstQuery( $resultPageSet = null ) {
126125 /* SELECT page_id, page_title, page_namespace, page_is_redirect
@@ -161,7 +160,6 @@
162161
163162 /**
164163 * @param $resultPageSet ApiPageSet
165 - * @return void
166164 */
167165 private function prepareSecondQuery( $resultPageSet = null ) {
168166 /* SELECT page_id, page_title, page_namespace, page_is_redirect, pl_title, pl_namespace
@@ -223,7 +221,6 @@
224222
225223 /**
226224 * @param $resultPageSet ApiPageSet
227 - * @return void
228225 */
229226 private function run( $resultPageSet = null ) {
230227 $this->params = $this->extractRequestParams( false );
Index: trunk/phase3/includes/api/ApiQueryBase.php
@@ -505,7 +505,6 @@
506506 * Also adds relevant block information
507507 *
508508 * @param bool $showBlockInfo
509 - * @return void
510509 */
511510 public function showHiddenUsersAddBlockInfo( $showBlockInfo ) {
512511 $userCanViewHiddenUsers = $this->getUser()->isAllowed( 'hideuser' );
Index: trunk/phase3/includes/api/ApiImport.php
@@ -181,7 +181,6 @@
182182 * @param $revisionCount int
183183 * @param $successCount int
184184 * @param $pageInfo
185 - * @return void
186185 */
187186 function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
188187 // Add a result entry
Index: trunk/phase3/includes/api/ApiQueryCategoryMembers.php
@@ -49,7 +49,6 @@
5050
5151 /**
5252 * @param $resultPageSet ApiPageSet
53 - * @return void
5453 */
5554 private function run( $resultPageSet = null ) {
5655 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -61,7 +61,6 @@
6262
6363 /**
6464 * @param $resultPageSet ApiPageSet
65 - * @return void
6665 */
6766 public function executeGenerator( $resultPageSet ) {
6867 if ( $resultPageSet->isResolvingRedirects() ) {
@@ -73,7 +72,6 @@
7473
7574 /**
7675 * @param $resultPageSet ApiPageSet
77 - * @return void
7876 */
7977 private function run( $resultPageSet = null ) {
8078 $repo = $this->mRepo;
Index: trunk/phase3/includes/api/ApiQuerySearch.php
@@ -45,7 +45,6 @@
4646
4747 /**
4848 * @param $resultPageSet ApiPageSet
49 - * @return void
5049 */
5150 private function run( $resultPageSet = null ) {
5251 global $wgContLang;
Index: trunk/phase3/includes/api/ApiQueryWatchlistRaw.php
@@ -46,7 +46,6 @@
4747
4848 /**
4949 * @param $resultPageSet ApiPageSet
50 - * @return void
5150 */
5251 private function run( $resultPageSet = null ) {
5352 $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
Index: trunk/phase3/includes/api/ApiQueryProtectedTitles.php
@@ -45,7 +45,6 @@
4646
4747 /**
4848 * @param $resultPageSet ApiPageSet
49 - * @return void
5049 */
5150 private function run( $resultPageSet = null ) {
5251 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryIWBacklinks.php
@@ -45,7 +45,6 @@
4646
4747 /**
4848 * @param $resultPageSet ApiPageSet
49 - * @return void
5049 */
5150 public function run( $resultPageSet = null ) {
5251 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -50,7 +50,6 @@
5151
5252 /**
5353 * @param $resultPageSet ApiPageSet
54 - * @return void
5554 */
5655 private function run( $resultPageSet = null ) {
5756 $this->selectNamedDB( 'watchlist', DB_SLAVE, 'watchlist' );
Index: trunk/phase3/includes/api/ApiQueryLangBacklinks.php
@@ -45,7 +45,6 @@
4646
4747 /**
4848 * @param $resultPageSet ApiPageSet
49 - * @return void
5049 */
5150 public function run( $resultPageSet = null ) {
5251 $params = $this->extractRequestParams();
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -51,7 +51,6 @@
5252
5353 /**
5454 * @param $pageSet ApiPageSet
55 - * @return void
5655 */
5756 public function requestExtraData( $pageSet ) {
5857 global $wgDisableCounters;
Index: trunk/phase3/includes/resourceloader/ResourceLoader.php
@@ -521,7 +521,6 @@
522522 * @param $context ResourceLoaderContext
523523 * @param $mtime string TS_MW timestamp to use for last-modified
524524 * @param $private bool True iff response contains any private modules
525 - * @return void
526525 */
527526 protected function sendResponseHeaders( ResourceLoaderContext $context, $mtime, $private ) {
528527 global $wgResourceLoaderMaxage;
Index: trunk/phase3/includes/media/MediaTransformOutput.php
@@ -50,7 +50,6 @@
5151
5252 /**
5353 * @param $storagePath string The permanent storage path
54 - * @return void
5554 */
5655 public function setStoragePath( $storagePath ) {
5756 $this->storagePath = $storagePath;
Index: trunk/phase3/includes/media/GIFMetadataExtractor.php
@@ -233,7 +233,6 @@
234234 /**
235235 * @param $fh
236236 * @param $bpp
237 - * @return void
238237 */
239238 static function readGCT( $fh, $bpp ) {
240239 if ( $bpp > 0 ) {
Index: trunk/phase3/includes/Wiki.php
@@ -145,8 +145,6 @@
146146 * - redirect loop
147147 * - special pages
148148 * - normal pages
149 - *
150 - * @return void
151149 */
152150 private function performRequest() {
153151 global $wgServer, $wgUsePathInfo, $wgTitle;
Index: trunk/phase3/includes/cache/FileCacheBase.php
@@ -151,7 +151,6 @@
152152
153153 /**
154154 * Clear the cache for this page
155 - * @return void
156155 */
157156 public function clearCache() {
158157 wfSuppressWarnings();
@@ -162,7 +161,6 @@
163162
164163 /**
165164 * Create parent directors of $this->cachePath()
166 - * @return void
167165 */
168166 protected function checkCacheDirs() {
169167 wfMkdirParents( dirname( $this->cachePath() ), null, __METHOD__ );
@@ -198,7 +196,6 @@
199197 /**
200198 * Roughly increments the cache misses in the last hour by unique visitors
201199 * @param $request WebRequest
202 - * @return void
203200 */
204201 public function incrMissesRecent( WebRequest $request ) {
205202 global $wgMemc;
Index: trunk/phase3/includes/cache/HTMLFileCache.php
@@ -92,7 +92,6 @@
9393 /**
9494 * Read from cache to context output
9595 * @param $context IContextSource
96 - * @return void
9796 */
9897 public function loadFromFileCache( IContextSource $context ) {
9998 global $wgMimeType, $wgLanguageCode;
Index: trunk/phase3/includes/cache/SquidUpdate.php
@@ -99,7 +99,6 @@
100100 * XXX report broken Squids per mail or log
101101 *
102102 * @param $urlArr array
103 - * @return void
104103 */
105104 static function purge( $urlArr ) {
106105 global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
Index: trunk/phase3/includes/Title.php
@@ -261,7 +261,6 @@
262262 * If false is given, the title will be treated as non-existing.
263263 *
264264 * @param $row Object|false database row
265 - * @return void
266265 */
267266 public function loadFromRow( $row ) {
268267 if ( $row ) { // page found
Index: trunk/phase3/includes/WikiPage.php
@@ -367,7 +367,6 @@
368368 * A DB query result object or...
369369 * "fromdb" to get from a slave DB or...
370370 * "fromdbmaster" to get from the master DB
371 - * @return void
372371 */
373372 public function loadPageData( $data = 'fromdb' ) {
374373 if ( $data === 'fromdbmaster' ) {
@@ -622,7 +621,6 @@
623622 /**
624623 * Set the page timestamp (use only to avoid DB queries)
625624 * @param $ts string MW timestamp of last article revision
626 - * @return void
627625 */
628626 public function setTimestamp( $ts ) {
629627 $this->mTimestamp = wfTimestamp( TS_MW, $ts );
@@ -705,7 +703,6 @@
706704 * Set the cached timestamp for the last time the page changed.
707705 * This is only used to help handle slave lag by comparing to page_touched.
708706 * @param $timestamp string
709 - * @return void
710707 */
711708 public function setCachedLastEditTime( $timestamp ) {
712709 global $wgMemc;
Index: trunk/phase3/includes/specials/SpecialImport.php
@@ -349,7 +349,6 @@
350350 * @param int $revisionCount
351351 * @param $successCount
352352 * @param $pageInfo
353 - * @return void
354353 */
355354 function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
356355 global $wgContLang;
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -656,7 +656,6 @@
657657 /**
658658 * Clear the login attempt throttle hit count for the (username,current IP) tuple.
659659 * @param $username string The user name
660 - * @return void
661660 */
662661 public static function clearLoginThrottle( $username ) {
663662 global $wgMemc, $wgRequest;
Index: trunk/phase3/includes/specials/SpecialShortpages.php
@@ -56,7 +56,6 @@
5757 /**
5858 * @param $db DatabaseBase
5959 * @param $res
60 - * @return void
6160 */
6261 function preprocessResults( $db, $res ) {
6362 # There's no point doing a batch check if we aren't caching results;
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php
@@ -39,9 +39,6 @@
4040 parent::__construct( 'MergeHistory', 'mergehistory' );
4141 }
4242
43 - /**
44 - * @return void
45 - */
4643 private function loadRequestParams() {
4744 $request = $this->getRequest();
4845 $this->mAction = $request->getVal( 'action' );
Index: trunk/phase3/includes/Preferences.php
@@ -129,7 +129,6 @@
130130 * @param $user User
131131 * @param $context IContextSource
132132 * @param $defaultPreferences
133 - * @return void
134133 */
135134 static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
136135 global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
@@ -456,7 +455,6 @@
457456 * @param $user User
458457 * @param $context IContextSource
459458 * @param $defaultPreferences
460 - * @return void
461459 */
462460 static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
463461 ## Skin #####################################
@@ -532,7 +530,6 @@
533531 * @param $user User
534532 * @param $context IContextSource
535533 * @param $defaultPreferences
536 - * @return void
537534 */
538535 static function datetimePreferences( $user, IContextSource $context, &$defaultPreferences ) {
539536 ## Date and time #####################################
Index: trunk/phase3/includes/UserArray.php
@@ -60,7 +60,6 @@
6161
6262 /**
6363 * @param $row
64 - * @return void
6564 */
6665 protected function setCurrent( $row ) {
6766 if ( $row === false ) {
Index: trunk/phase3/includes/Pager.php
@@ -394,8 +394,6 @@
395395 * Called from getBody(), before getStartBody() is called and
396396 * after doQuery() was called. This will be called only if there
397397 * are rows in the result set.
398 - *
399 - * @return void
400398 */
401399 protected function doBatchLookups() {}
402400
Index: trunk/phase3/includes/HistoryBlob.php
@@ -94,7 +94,6 @@
9595
9696 /**
9797 * @param $text string
98 - * @return void
9998 */
10099 public function setText( $text ) {
101100 $this->uncompress();
Index: trunk/phase3/thumb.php
@@ -29,8 +29,6 @@
3030
3131 /**
3232 * Handle a thumbnail request via query parameters
33 - *
34 - * @return void
3533 */
3634 function wfThumbHandleRequest() {
3735 $params = get_magic_quotes_gpc()
@@ -42,8 +40,6 @@
4341
4442 /**
4543 * Handle a thumbnail request via thumbnail file URL
46 - *
47 - * @return void
4844 */
4945 function wfThumbHandle404() {
5046 # lighttpd puts the original request in REQUEST_URI, while
@@ -69,7 +65,6 @@
7066 * Stream a thumbnail specified by parameters
7167 *
7268 * @param $params Array
73 - * @return void
7469 */
7570 function wfStreamThumb( array $params ) {
7671 wfProfileIn( __METHOD__ );
@@ -266,7 +261,6 @@
267262 *
268263 * @param $status integer
269264 * @param $msg string
270 - * @return void
271265 */
272266 function wfThumbError( $status, $msg ) {
273267 global $wgShowHostnames;

Follow-up revisions

RevisionCommit summaryAuthorDate
r108745Reverted r108743 per CR comment. This should at least be discussed first.aaron19:41, 12 January 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   19:13, 12 January 2012

Whhhy? It distinguishes a lack of documentation with someone deliberately saying that nothing should be returned?

#Comment by Siebrand (talk | contribs)   20:38, 12 January 2012

Agreed. For testability, all methods should preferably return something. Removing it, should be replaced with a FIXME, or it could remain.

#Comment by Aaron Schulz (talk | contribs)   20:42, 12 January 2012

That depends on the method. A lot of methods can return nothing, like mutators or such. Certainly any thing that has a meaningful return value or that can possibly fail in any way should have a return value.

Status & tagging log