Index: trunk/phase3/maintenance/fuzz-tester.php |
— | — | @@ -817,7 +817,7 @@ |
818 | 818 | * Returns the matched character slash-escaped as in a C string |
819 | 819 | * Helper for makeTitleSafe callback |
820 | 820 | * @param $matches |
821 | | - * @return atring |
| 821 | + * @return string |
822 | 822 | */ |
823 | 823 | static private function stringEscape( $matches ) { |
824 | 824 | return sprintf( "\\x%02x", ord( $matches[1] ) ); |
Index: trunk/phase3/maintenance/generateSitemap.php |
— | — | @@ -264,7 +264,7 @@ |
265 | 265 | * @return String |
266 | 266 | */ |
267 | 267 | function guessPriority( $namespace ) { |
268 | | - return MWNamespace::isMain( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK]; |
| 268 | + return MWNamespace::isSubject( $namespace ) ? $this->priorities[self::GS_MAIN] : $this->priorities[self::GS_TALK]; |
269 | 269 | } |
270 | 270 | |
271 | 271 | /** |
Index: trunk/phase3/maintenance/refreshLinks.php |
— | — | @@ -230,8 +230,8 @@ |
231 | 231 | * Removes non-existing links from pages from pagelinks, imagelinks, |
232 | 232 | * categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables. |
233 | 233 | * |
234 | | - * @param $maxLag |
235 | | - * @param $batchSize The size of deletion batches |
| 234 | + * @param $maxLag int |
| 235 | + * @param $batchSize int The size of deletion batches |
236 | 236 | * |
237 | 237 | * @author Merlijn van Deen <valhallasw@arctus.nl> |
238 | 238 | */ |
Index: trunk/phase3/maintenance/userOptions.inc |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | * @param $opts array |
78 | 78 | * @param $args array |
79 | 79 | * |
80 | | - * @return true |
| 80 | + * @return bool |
81 | 81 | */ |
82 | 82 | private function initializeOpts( $opts, $args ) { |
83 | 83 | |
Index: trunk/phase3/maintenance/removeUnusedAccounts.php |
— | — | @@ -86,7 +86,7 @@ |
87 | 87 | * (No edits, no deleted edits, no log entries, no current/old uploads) |
88 | 88 | * |
89 | 89 | * @param $id User's ID |
90 | | - * @param $master Perform checking on the master |
| 90 | + * @param $master bool Perform checking on the master |
91 | 91 | * @return bool |
92 | 92 | */ |
93 | 93 | private function isInactiveAccount( $id, $master = false ) { |
Index: trunk/phase3/maintenance/importImages.inc |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | /** |
28 | 28 | * Search a directory for files with one of a set of extensions |
29 | 29 | * |
30 | | - * @param $dir Path to directory to search |
| 30 | + * @param $dir string Path to directory to search |
31 | 31 | * @param $exts Array of extensions to search for |
32 | 32 | * @return mixed Array of filenames on success, or false on failure |
33 | 33 | */ |
— | — | @@ -74,9 +74,9 @@ |
75 | 75 | * files for acme.foo.bar and the extension ".txt". With $maxStrip = 2, |
76 | 76 | * acme.txt would also be acceptable. |
77 | 77 | * |
78 | | - * @param $file base path |
79 | | - * @param $auxExtension the extension to be appended to the base path |
80 | | - * @param $maxStrip the maximum number of extensions to strip from the base path (default: 1) |
| 78 | + * @param $file string base path |
| 79 | + * @param $auxExtension string the extension to be appended to the base path |
| 80 | + * @param $maxStrip int the maximum number of extensions to strip from the base path (default: 1) |
81 | 81 | * @return string or false |
82 | 82 | */ |
83 | 83 | function findAuxFile( $file, $auxExtension, $maxStrip = 1 ) { |
Index: trunk/phase3/maintenance/backup.inc |
— | — | @@ -262,7 +262,7 @@ |
263 | 263 | |
264 | 264 | // Discourage the server from disconnecting us if it takes a long time |
265 | 265 | // to read out the big ol' batch query. |
266 | | - $db->setTimeout( 3600 * 24 ); |
| 266 | + $db->setSessionOptions( array( 'connTimeout' => 3600 * 24 ) ); |
267 | 267 | |
268 | 268 | return $db; |
269 | 269 | } |
Index: trunk/phase3/maintenance/findHooks.php |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * Get hooks from a PHP file |
161 | | - * @param $file Full filename to the PHP file. |
| 161 | + * @param $file string Full filename to the PHP file. |
162 | 162 | * @return array of hooks found. |
163 | 163 | */ |
164 | 164 | private function getHooksFromFile( $file ) { |
— | — | @@ -188,7 +188,7 @@ |
189 | 189 | |
190 | 190 | /** |
191 | 191 | * Get bad hooks (where the hook name could not be determined) from a PHP file |
192 | | - * @param $file Full filename to the PHP file. |
| 192 | + * @param $file string Full filename to the PHP file. |
193 | 193 | * @return array of bad wfRunHooks() lines |
194 | 194 | */ |
195 | 195 | private function getBadHooksFromFile( $file ) { |
Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | * same channel are concatenated, but any intervening messages in another |
368 | 368 | * channel start a new line. |
369 | 369 | * @param $msg String: the message without trailing newline |
370 | | - * @param $channel Channel identifier or null for no |
| 370 | + * @param $channel string Channel identifier or null for no |
371 | 371 | * channel. Channel comparison uses ===. |
372 | 372 | */ |
373 | 373 | public function outputChanneled( $msg, $channel = null ) { |
— | — | @@ -1080,7 +1080,7 @@ |
1081 | 1081 | |
1082 | 1082 | /** |
1083 | 1083 | * Lock the search index |
1084 | | - * @param &$db Database object |
| 1084 | + * @param &$db DatabaseBase object |
1085 | 1085 | */ |
1086 | 1086 | private function lockSearchindex( &$db ) { |
1087 | 1087 | $write = array( 'searchindex' ); |
— | — | @@ -1090,7 +1090,7 @@ |
1091 | 1091 | |
1092 | 1092 | /** |
1093 | 1093 | * Unlock the tables |
1094 | | - * @param &$db Database object |
| 1094 | + * @param &$db DatabaseBase object |
1095 | 1095 | */ |
1096 | 1096 | private function unlockSearchindex( &$db ) { |
1097 | 1097 | $db->unlockTables( __CLASS__ . '::' . __METHOD__ ); |
— | — | @@ -1099,7 +1099,7 @@ |
1100 | 1100 | /** |
1101 | 1101 | * Unlock and lock again |
1102 | 1102 | * Since the lock is low-priority, queued reads will be able to complete |
1103 | | - * @param &$db Database object |
| 1103 | + * @param &$db DatabaseBase object |
1104 | 1104 | */ |
1105 | 1105 | private function relockSearchindex( &$db ) { |
1106 | 1106 | $this->unlockSearchindex( $db ); |
— | — | @@ -1147,7 +1147,7 @@ |
1148 | 1148 | |
1149 | 1149 | /** |
1150 | 1150 | * Update the searchindex table for a given pageid |
1151 | | - * @param $dbw Database: a database write handle |
| 1151 | + * @param $dbw DatabaseBase a database write handle |
1152 | 1152 | * @param $pageId Integer: the page ID to update. |
1153 | 1153 | * @return null|string |
1154 | 1154 | */ |
Index: trunk/phase3/maintenance/reassignEdits.php |
— | — | @@ -62,8 +62,8 @@ |
63 | 63 | * |
64 | 64 | * @param $from User to take edits from |
65 | 65 | * @param $to User to assign edits to |
66 | | - * @param $rc Update the recent changes table |
67 | | - * @param $report Don't change things; just echo numbers |
| 66 | + * @param $rc bool Update the recent changes table |
| 67 | + * @param $report bool Don't change things; just echo numbers |
68 | 68 | * @return integer Number of entries changed, or that would be changed |
69 | 69 | */ |
70 | 70 | private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) { |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | /** |
152 | 152 | * Initialise the user object |
153 | 153 | * |
154 | | - * @param $username Username or IP address |
| 154 | + * @param $username string Username or IP address |
155 | 155 | * @return User |
156 | 156 | */ |
157 | 157 | private function initialiseUser( $username ) { |
Index: trunk/phase3/maintenance/rebuildLocalisationCache.php |
— | — | @@ -111,7 +111,7 @@ |
112 | 112 | /** |
113 | 113 | * Helper function to rebuild list of languages codes. Prints the code |
114 | 114 | * for each language which is rebuilt. |
115 | | - * @param $codes list List of language codes to rebuild. |
| 115 | + * @param $codes array List of language codes to rebuild. |
116 | 116 | * @param $lc LocalisationCache Instance of LocalisationCache_BulkLoad (?) |
117 | 117 | * @param $force bool Rebuild up-to-date languages |
118 | 118 | * @return int Number of rebuilt languages |
Index: trunk/phase3/maintenance/upgrade1_5.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Open a connection to the master server with the admin rights. |
120 | | - * @return Database |
| 120 | + * @return DatabaseBase |
121 | 121 | * @access private |
122 | 122 | */ |
123 | 123 | function newConnection() { |
— | — | @@ -141,7 +141,7 @@ |
142 | 142 | * Open a second connection to the master server, with buffering off. |
143 | 143 | * This will let us stream large datasets in and write in chunks on the |
144 | 144 | * other end. |
145 | | - * @return Database |
| 145 | + * @return DatabaseBase |
146 | 146 | * @access private |
147 | 147 | */ |
148 | 148 | function streamConnection() { |
— | — | @@ -342,7 +342,7 @@ |
343 | 343 | * MW_UPGRADE_COPY - straight copy |
344 | 344 | * MW_UPGRADE_ENCODE - for old Latin1 wikis, conv to UTF-8 |
345 | 345 | * MW_UPGRADE_NULL - just put NULL |
346 | | - * @param callable $callback An optional callback to modify the data |
| 346 | + * @param $callback callback An optional callback to modify the data |
347 | 347 | * or perform other processing. Func should be |
348 | 348 | * ( object $row, array $copy ) and return $copy |
349 | 349 | * @access private |
Index: trunk/phase3/maintenance/language/rebuildLanguage.php |
— | — | @@ -30,12 +30,12 @@ |
31 | 31 | * Rewrite a messages array. |
32 | 32 | * |
33 | 33 | * @param $languages |
34 | | - * @param $code The language code. |
| 34 | + * @param $code string The language code. |
35 | 35 | * @param bool $write Write to the messages file? |
36 | 36 | * @param bool $listUnknown List the unknown messages? |
37 | 37 | * @param bool $removeUnknown Remove the unknown messages? |
38 | 38 | * @param bool $removeDupes Remove the duplicated messages? |
39 | | - * @param $dupeMsgSource The source file intended to remove from the array. |
| 39 | + * @param $dupeMsgSource string The source file intended to remove from the array. |
40 | 40 | */ |
41 | 41 | function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknown, $removeDupes, $dupeMsgSource ) { |
42 | 42 | $messages = $languages->getMessages( $code ); |
— | — | @@ -49,8 +49,8 @@ |
50 | 50 | /** |
51 | 51 | * Remove duplicates from a message array. |
52 | 52 | * |
53 | | - * @param $oldMsgArray The input message array. |
54 | | - * @param $dupeMsgSource The source file path for duplicates. |
| 53 | + * @param $oldMsgArray array The input message array. |
| 54 | + * @param $dupeMsgSource string The source file path for duplicates. |
55 | 55 | * @return Array $newMsgArray The output message array, with duplicates removed. |
56 | 56 | */ |
57 | 57 | function removeDupes( $oldMsgArray, $dupeMsgSource ) { |
Index: trunk/phase3/maintenance/language/writeMessagesArray.inc |
— | — | @@ -156,6 +156,7 @@ |
157 | 157 | * @param $messages Array: key of messages. |
158 | 158 | * @param $ignored Array: list of ingored message keys. |
159 | 159 | * @param $optional Array: list of optional message keys. |
| 160 | + * @return array |
160 | 161 | */ |
161 | 162 | public static function makeComments( $messages, $ignored, $optional ) { |
162 | 163 | # Comment collector |
— | — | @@ -181,7 +182,7 @@ |
182 | 183 | * @param $messageComments Array: optional comments for messages in this block. |
183 | 184 | * @param $prefix String: prefix for every line, for indenting purposes. |
184 | 185 | * |
185 | | - * @return The block, formatted in PHP. |
| 186 | + * @return string The block, formatted in PHP. |
186 | 187 | */ |
187 | 188 | public static function writeMessagesBlock( $blockComment, $messages, |
188 | 189 | $messageComments = array(), $prefix = '' ) { |
Index: trunk/phase3/maintenance/language/checkLanguage.inc |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * Constructor. |
45 | | - * @param $options Options for script. |
| 45 | + * @param $options array Options for script. |
46 | 46 | */ |
47 | 47 | public function __construct( Array $options ) { |
48 | 48 | if ( isset( $options['help'] ) ) { |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | |
96 | 96 | /** |
97 | 97 | * Get the default checks. |
98 | | - * @return A list of the default checks. |
| 98 | + * @return array A list of the default checks. |
99 | 99 | */ |
100 | 100 | protected function defaultChecks() { |
101 | 101 | return array( |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | |
109 | 109 | /** |
110 | 110 | * Get the checks which check other things than messages. |
111 | | - * @return A list of the non-message checks. |
| 111 | + * @return array A list of the non-message checks. |
112 | 112 | */ |
113 | 113 | protected function nonMessageChecks() { |
114 | 114 | return array( |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Get all checks. |
133 | | - * @return An array of all check names mapped to their function names. |
| 133 | + * @return array An array of all check names mapped to their function names. |
134 | 134 | */ |
135 | 135 | protected function getChecks() { |
136 | 136 | return array( |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | |
159 | 159 | /** |
160 | 160 | * Get total count for each check non-messages check. |
161 | | - * @return An array of all check names mapped to a two-element array: |
| 161 | + * @return array An array of all check names mapped to a two-element array: |
162 | 162 | * function name to get the total count and language code or null |
163 | 163 | * for checked code. |
164 | 164 | */ |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | |
178 | 178 | /** |
179 | 179 | * Get all check descriptions. |
180 | | - * @return An array of all check names mapped to their descriptions. |
| 180 | + * @return array An array of all check names mapped to their descriptions. |
181 | 181 | */ |
182 | 182 | protected function getDescriptions() { |
183 | 183 | return array( |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | |
206 | 206 | /** |
207 | 207 | * Get help. |
208 | | - * @return The help string. |
| 208 | + * @return string The help string. |
209 | 209 | */ |
210 | 210 | protected function help() { |
211 | 211 | return <<<ENDS |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | |
297 | 297 | /** |
298 | 298 | * Get the check blacklist. |
299 | | - * @return The list of checks which should not be executed. |
| 299 | + * @return array The list of checks which should not be executed. |
300 | 300 | */ |
301 | 301 | protected function getCheckBlacklist() { |
302 | 302 | global $checkBlacklist; |
— | — | @@ -336,9 +336,9 @@ |
337 | 337 | |
338 | 338 | /** |
339 | 339 | * Format a message key. |
340 | | - * @param $key The message key. |
341 | | - * @param $code The language code. |
342 | | - * @return The formatted message key. |
| 340 | + * @param $key string The message key. |
| 341 | + * @param $code string The language code. |
| 342 | + * @return string The formatted message key. |
343 | 343 | */ |
344 | 344 | protected function formatKey( $key, $code ) { |
345 | 345 | if ( $this->doLinks ) { |
— | — | @@ -355,7 +355,6 @@ |
356 | 356 | |
357 | 357 | /** |
358 | 358 | * Output the checks results as plain text. |
359 | | - * @return The checks results as plain text. |
360 | 359 | */ |
361 | 360 | protected function outputText() { |
362 | 361 | foreach ( $this->results as $code => $results ) { |
— | — | @@ -401,7 +400,6 @@ |
402 | 401 | |
403 | 402 | /** |
404 | 403 | * Output the checks results as wiki text. |
405 | | - * @return The checks results as wiki text. |
406 | 404 | */ |
407 | 405 | function outputWiki() { |
408 | 406 | global $wgContLang; |
— | — | @@ -462,7 +460,7 @@ |
463 | 461 | |
464 | 462 | /** |
465 | 463 | * Check if there are any results for the checks, in any language. |
466 | | - * @return True if there are any results, false if not. |
| 464 | + * @return bool True if there are any results, false if not. |
467 | 465 | */ |
468 | 466 | protected function isEmpty() { |
469 | 467 | foreach( $this->results as $results ) { |
— | — | @@ -484,8 +482,8 @@ |
485 | 483 | |
486 | 484 | /** |
487 | 485 | * Constructor. |
488 | | - * @param $options Options for script. |
489 | | - * @param $extension The extension name (or names). |
| 486 | + * @param $options array Options for script. |
| 487 | + * @param $extension string The extension name (or names). |
490 | 488 | */ |
491 | 489 | public function __construct( Array $options, $extension ) { |
492 | 490 | if ( isset( $options['help'] ) ) { |
— | — | @@ -569,7 +567,7 @@ |
570 | 568 | |
571 | 569 | /** |
572 | 570 | * Get the default checks. |
573 | | - * @return A list of the default checks. |
| 571 | + * @return array A list of the default checks. |
574 | 572 | */ |
575 | 573 | protected function defaultChecks() { |
576 | 574 | return array( |
— | — | @@ -580,7 +578,7 @@ |
581 | 579 | |
582 | 580 | /** |
583 | 581 | * Get the checks which check other things than messages. |
584 | | - * @return A list of the non-message checks. |
| 582 | + * @return array A list of the non-message checks. |
585 | 583 | */ |
586 | 584 | protected function nonMessageChecks() { |
587 | 585 | return array(); |
— | — | @@ -588,7 +586,7 @@ |
589 | 587 | |
590 | 588 | /** |
591 | 589 | * Get the checks that can easily be treated by non-speakers of the language. |
592 | | - * @return A list of the easy checks. |
| 590 | + * @return arrayA list of the easy checks. |
593 | 591 | */ |
594 | 592 | protected function easyChecks() { |
595 | 593 | return array( |
— | — | @@ -598,7 +596,7 @@ |
599 | 597 | |
600 | 598 | /** |
601 | 599 | * Get help. |
602 | | - * @return The help string. |
| 600 | + * @return string The help string. |
603 | 601 | */ |
604 | 602 | protected function help() { |
605 | 603 | return <<<ENDS |
Index: trunk/phase3/maintenance/language/languages.inc |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | * Load the list of languages: all the Messages*.php |
45 | 45 | * files in the languages directory. |
46 | 46 | * |
47 | | - * @param $exif Treat the EXIF messages? |
| 47 | + * @param $exif bool Treat the EXIF messages? |
48 | 48 | */ |
49 | 49 | function __construct( $exif = true ) { |
50 | 50 | require( dirname(__FILE__) . '/messageTypes.inc' ); |
— | — | @@ -244,7 +244,7 @@ |
245 | 245 | * |
246 | 246 | * @param $code string The language code. |
247 | 247 | * |
248 | | - * @return Namespace names. |
| 248 | + * @return array Namespace names. |
249 | 249 | */ |
250 | 250 | public function getNamespaceNames( $code ) { |
251 | 251 | $this->loadFile( $code ); |
— | — | @@ -256,7 +256,7 @@ |
257 | 257 | * |
258 | 258 | * @param $code string The language code. |
259 | 259 | * |
260 | | - * @return Namespace aliases. |
| 260 | + * @return array Namespace aliases. |
261 | 261 | */ |
262 | 262 | public function getNamespaceAliases( $code ) { |
263 | 263 | $this->loadFile( $code ); |
— | — | @@ -268,7 +268,7 @@ |
269 | 269 | * |
270 | 270 | * @param $code string The language code. |
271 | 271 | * |
272 | | - * @return Magic words. |
| 272 | + * @return array Magic words. |
273 | 273 | */ |
274 | 274 | public function getMagicWords( $code ) { |
275 | 275 | $this->loadFile( $code ); |
— | — | @@ -280,7 +280,7 @@ |
281 | 281 | * |
282 | 282 | * @param $code string The language code. |
283 | 283 | * |
284 | | - * @return Special page aliases. |
| 284 | + * @return array Special page aliases. |
285 | 285 | */ |
286 | 286 | public function getSpecialPageAliases( $code ) { |
287 | 287 | $this->loadFile( $code ); |
— | — | @@ -734,7 +734,7 @@ |
735 | 735 | |
736 | 736 | /** |
737 | 737 | * Load the messages group. |
738 | | - * @param $group The messages group. |
| 738 | + * @param $group MessageGroup The messages group. |
739 | 739 | */ |
740 | 740 | function __construct( MessageGroup $group ) { |
741 | 741 | $this->mMessageGroup = $group; |
Index: trunk/phase3/maintenance/locking/LockServerDaemon.php |
— | — | @@ -258,7 +258,7 @@ |
259 | 259 | * store it in the dead session tracking if it still has locks. |
260 | 260 | * |
261 | 261 | * @param $socket resource |
262 | | - * @return book |
| 262 | + * @return bool |
263 | 263 | */ |
264 | 264 | protected function recordDeadSocket( $socket ) { |
265 | 265 | $session = array_search( $socket, $this->sessions ); |
— | — | @@ -382,7 +382,7 @@ |
383 | 383 | |
384 | 384 | /** |
385 | 385 | * @param $sock resource |
386 | | - * @return string|false |
| 386 | + * @return string|bool |
387 | 387 | */ |
388 | 388 | public function readRcvBuffer( $sock ) { |
389 | 389 | $key = array_search( $sock, $this->clients ); |
Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -387,6 +387,8 @@ |
388 | 388 | * may not survive a long-term server outage. |
389 | 389 | * |
390 | 390 | * FIXME: WTF? Why is it using a loop and then returning unconditionally? |
| 391 | + * @param $id int |
| 392 | + * @return bool|string |
391 | 393 | */ |
392 | 394 | private function getTextDbSafe( $id ) { |
393 | 395 | while ( true ) { |