r105189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105188‎ | r105189 | r105190 >
Date:16:50, 5 December 2011
Author:reedy
Status:ok
Tags:
Comment:
More documentation of parameters following up r104591
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseError.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)
  • /trunk/phase3/includes/db/LBFactory.php (modified) (history)
  • /trunk/phase3/includes/db/LBFactory_Multi.php (modified) (history)
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseError.php
@@ -262,10 +262,10 @@
263263
264264 /**
265265 * @param $db DatabaseBase
266 - * @param $error
267 - * @param $errno
268 - * @param $sql
269 - * @param $fname
 266+ * @param $error string
 267+ * @param $errno int|string
 268+ * @param $sql string
 269+ * @param $fname string
270270 */
271271 function __construct( DatabaseBase &$db, $error, $errno, $sql, $fname ) {
272272 $message = "A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script\n" .
Index: trunk/phase3/includes/db/LBFactory_Multi.php
@@ -54,7 +54,7 @@
5555 var $lastWiki, $lastSection;
5656
5757 /**
58 - * @param $conf
 58+ * @param $conf array
5959 */
6060 function __construct( $conf ) {
6161 $this->chronProt = new ChronologyProtector;
@@ -173,7 +173,7 @@
174174 * Make a new load balancer object based on template and load array
175175 *
176176 * @param $template
177 - * @param $loads
 177+ * @param $loads array
178178 * @param $groupLoads
179179 * @return LoadBalancer
180180 */
@@ -191,7 +191,7 @@
192192 * Make a server array as expected by LoadBalancer::__construct, using a template and load array
193193 *
194194 * @param $template
195 - * @param $loads
 195+ * @param $loads array
196196 * @param $groupLoads
197197 * @return array
198198 */
@@ -248,7 +248,7 @@
249249
250250 /**
251251 * Get the database name and prefix based on the wiki ID
252 - * @param bool $wiki
 252+ * @param $wiki bool
253253 * @return array
254254 */
255255 function getDBNameAndPrefix( $wiki = false ) {
Index: trunk/phase3/includes/db/Database.php
@@ -2280,7 +2280,7 @@
22812281 * Any implementation of this function should *not* involve reusing
22822282 * sequence numbers created for rolled-back transactions.
22832283 * See http://bugs.mysql.com/bug.php?id=30767 for details.
2284 - * @param $seqName
 2284+ * @param $seqName string
22852285 * @return null
22862286 */
22872287 function nextSequenceValue( $seqName ) {
@@ -2374,9 +2374,9 @@
23752375 * REPLACE query wrapper for MySQL and SQLite, which have a native REPLACE
23762376 * statement.
23772377 *
2378 - * @param $table Table name
2379 - * @param $rows Rows to insert
2380 - * @param $fname Caller function name
 2378+ * @param $table string Table name
 2379+ * @param $rows array Rows to insert
 2380+ * @param $fname string Caller function name
23812381 *
23822382 * @return ResultWrapper
23832383 */
@@ -3017,8 +3017,8 @@
30183018 * don't allow simple quoted strings to be inserted. To insert into such
30193019 * a field, pass the data through this function before passing it to
30203020 * DatabaseBase::insert().
3021 - * @param $b
3022 - * @return
 3021+ * @param $b string
 3022+ * @return string
30233023 */
30243024 function encodeBlob( $b ) {
30253025 return $b;
@@ -3028,8 +3028,8 @@
30293029 * Some DBMSs return a special placeholder object representing blob fields
30303030 * in result objects. Pass the object through this function to return the
30313031 * original string.
3032 - * @param $b
3033 - * @return
 3032+ * @param $b string
 3033+ * @return string
30343034 */
30353035 function decodeBlob( $b ) {
30363036 return $b;
Index: trunk/phase3/includes/db/LBFactory.php
@@ -42,7 +42,6 @@
4343
4444 /**
4545 * Shut down, close connections and destroy the cached instance.
46 - *
4746 */
4847 static function destroyInstance() {
4948 if ( self::$instance ) {
@@ -111,7 +110,7 @@
112111 * Execute a function for each tracked load balancer
113112 * The callback is called with the load balancer as the first parameter,
114113 * and $params passed as the subsequent parameters.
115 - * @param $callback
 114+ * @param $callback string|array
116115 * @param array $params
117116 */
118117 abstract function forEachLB( $callback, $params = array() );
@@ -124,7 +123,7 @@
125124
126125 /**
127126 * Call a method of each tracked load balancer
128 - * @param $methodName
 127+ * @param $methodName string
129128 * @param $args array
130129 */
131130 function forEachLBCallMethod( $methodName, $args = array() ) {
@@ -134,7 +133,7 @@
135134 /**
136135 * Private helper for forEachLBCallMethod
137136 * @param $loadBalancer
138 - * @param $methodName
 137+ * @param $methodName string
139138 * @param $args
140139 */
141140 function callMethod( $loadBalancer, $methodName, $args ) {
Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -101,7 +101,7 @@
102102 * Given an array of non-normalised probabilities, this function will select
103103 * an element and return the appropriate key
104104 *
105 - * @param $weights
 105+ * @param $weights array
106106 *
107107 * @return int
108108 */
@@ -132,7 +132,7 @@
133133 }
134134
135135 /**
136 - * @param $loads
 136+ * @param $loads array
137137 * @param $wiki bool
138138 * @return bool|int|string
139139 */
@@ -336,8 +336,8 @@
337337
338338 /**
339339 * Wait for a specified number of microseconds, and return the period waited
340 - * @param $t
341 - * @return
 340+ * @param $t int
 341+ * @return int
342342 */
343343 function sleep( $t ) {
344344 wfProfileIn( __METHOD__ );
@@ -351,7 +351,7 @@
352352 * Set the master wait position
353353 * If a DB_SLAVE connection has been opened already, waits
354354 * Otherwise sets a variable telling it to wait if such a connection is opened
355 - * @param $pos
 355+ * @param $pos int
356356 */
357357 public function waitFor( $pos ) {
358358 wfProfileIn( __METHOD__ );
@@ -369,7 +369,7 @@
370370
371371 /**
372372 * Set the master wait position and wait for ALL slaves to catch up to it
373 - * @param $pos
 373+ * @param $pos int
374374 */
375375 public function waitForAll( $pos ) {
376376 wfProfileIn( __METHOD__ );
@@ -384,7 +384,7 @@
385385 * Get any open connection to a given server index, local or foreign
386386 * Returns false if there is no connection open
387387 *
388 - * @param $i
 388+ * @param $i int
389389 * @return DatabaseBase|false
390390 */
391391 function getAnyOpenConnection( $i ) {
Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -23,7 +23,7 @@
2424 }
2525
2626 /**
27 - * @param $sql
 27+ * @param $sql string
2828 * @return resource
2929 */
3030 protected function doQuery( $sql ) {
@@ -36,10 +36,10 @@
3737 }
3838
3939 /**
40 - * @param $server
41 - * @param $user
42 - * @param $password
43 - * @param $dbName
 40+ * @param $server string
 41+ * @param $user string
 42+ * @param $password string
 43+ * @param $dbName string
4444 * @return bool
4545 * @throws DBConnectionError
4646 */
@@ -167,7 +167,7 @@
168168 }
169169
170170 /**
171 - * @param $res
 171+ * @param $res ResultWrapper
172172 * @throws DBUnexpectedError
173173 */
174174 function freeResult( $res ) {
@@ -183,7 +183,7 @@
184184 }
185185
186186 /**
187 - * @param $res
 187+ * @param $res ResultWrapper
188188 * @return object|stdClass
189189 * @throws DBUnexpectedError
190190 */
@@ -201,7 +201,7 @@
202202 }
203203
204204 /**
205 - * @param $res
 205+ * @param $res ResultWrapper
206206 * @return array
207207 * @throws DBUnexpectedError
208208 */
@@ -220,7 +220,7 @@
221221
222222 /**
223223 * @throws DBUnexpectedError
224 - * @param $res
 224+ * @param $res ResultWrapper
225225 * @return int
226226 */
227227 function numRows( $res ) {
@@ -237,7 +237,7 @@
238238 }
239239
240240 /**
241 - * @param $res
 241+ * @param $res ResultWrapper
242242 * @return int
243243 */
244244 function numFields( $res ) {
@@ -248,8 +248,8 @@
249249 }
250250
251251 /**
252 - * @param $res
253 - * @param $n
 252+ * @param $res ResultWrapper
 253+ * @param $n string
254254 * @return string
255255 */
256256 function fieldName( $res, $n ) {
@@ -267,7 +267,7 @@
268268 }
269269
270270 /**
271 - * @param $res
 271+ * @param $res ResultWrapper
272272 * @param $row
273273 * @return bool
274274 */
@@ -318,9 +318,9 @@
319319 }
320320
321321 /**
322 - * @param $table
 322+ * @param $table string
323323 * @param $uniqueIndexes
324 - * @param $rows
 324+ * @param $rows array
325325 * @param $fname string
326326 * @return ResultWrapper
327327 */
@@ -382,8 +382,8 @@
383383 * Get information about an index into an object
384384 * Returns false if the index does not exist
385385 *
386 - * @param $table
387 - * @param $index
 386+ * @param $table string
 387+ * @param $index string
388388 * @param $fname string
389389 * @return false|array
390390 */
@@ -670,8 +670,8 @@
671671 }
672672
673673 /**
674 - * @param $lockName
675 - * @param $method
 674+ * @param $lockName string
 675+ * @param $method string
676676 * @param $timeout int
677677 * @return bool
678678 */
@@ -690,9 +690,9 @@
691691
692692 /**
693693 * FROM MYSQL DOCS: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock
694 - * @param $lockName
 694+ * @param $lockName string
695695 * @param $method string
696 - * @return
 696+ * @return bool
697697 */
698698 public function unlock( $lockName, $method ) {
699699 $lockName = $this->addQuotes( $lockName );
@@ -702,9 +702,9 @@
703703 }
704704
705705 /**
706 - * @param $read
707 - * @param $write
708 - * @param $method
 706+ * @param $read array
 707+ * @param $write array
 708+ * @param $method string
709709 * @param $lowPriority bool
710710 */
711711 public function lockTables( $read, $write, $method, $lowPriority = true ) {
@@ -761,13 +761,13 @@
762762
763763 /**
764764 * DELETE where the condition is a join. MySql uses multi-table deletes.
765 - * @param $delTable
766 - * @param $joinTable
767 - * @param $delVar
768 - * @param $joinVar
 765+ * @param $delTable string
 766+ * @param $joinTable string
 767+ * @param $delVar string
 768+ * @param $joinVar string
769769 * @param $conds array|string
770770 * @param $fname bool
771 - * @return bool|\ResultWrapper
 771+ * @return bool|ResultWrapper
772772 */
773773 function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'DatabaseBase::deleteJoin' ) {
774774 if ( !$conds ) {
Index: trunk/phase3/includes/Skin.php
@@ -288,7 +288,7 @@
289289 abstract function outputPage( OutputPage $out = null );
290290
291291 /**
292 - * @param $data
 292+ * @param $data array
293293 * @return string
294294 */
295295 static function makeVariablesScript( $data ) {
@@ -543,7 +543,7 @@
544544 }
545545
546546 /**
547 - * @param $debugText
 547+ * @param $debugText string
548548 * @return string
549549 */
550550 private function formatDebugHTML( $debugText ) {
@@ -734,7 +734,7 @@
735735 }
736736
737737 /**
738 - * @param string $type
 738+ * @param $type string
739739 * @return string
740740 */
741741 function getCopyright( $type = 'detect' ) {
@@ -976,7 +976,7 @@
977977 }
978978
979979 /**
980 - * @param $id
 980+ * @param $id User|int
981981 * @return bool
982982 */
983983 function showEmailUser( $id ) {
@@ -1027,7 +1027,7 @@
10281028 }
10291029
10301030 /**
1031 - * @param $name
 1031+ * @param $name string
10321032 * @param $urlaction string
10331033 * @return String
10341034 */
@@ -1037,8 +1037,8 @@
10381038 }
10391039
10401040 /**
1041 - * @param $name
1042 - * @param $subpage
 1041+ * @param $name string
 1042+ * @param $subpage string
10431043 * @param $urlaction string
10441044 * @return String
10451045 */
@@ -1048,7 +1048,7 @@
10491049 }
10501050
10511051 /**
1052 - * @param $name
 1052+ * @param $name string
10531053 * @param $urlaction string
10541054 * @return String
10551055 */
@@ -1059,7 +1059,7 @@
10601060 }
10611061
10621062 /**
1063 - * @param $name
 1063+ * @param $name string
10641064 * @param $urlaction string
10651065 * @return String
10661066 */
@@ -1134,7 +1134,7 @@
11351135 * make sure we have some title to operate on
11361136 *
11371137 * @param $title Title
1138 - * @param $name
 1138+ * @param $name string
11391139 */
11401140 static function checkTitle( &$title, $name ) {
11411141 if ( !is_object( $title ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104591Moar documentationsreedy21:04, 29 November 2011

Status & tagging log