r44044 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44043‎ | r44044 | r44045 >
Date:18:50, 29 November 2008
Author:ialex
Status:ok
Tags:
Comment:
* fixed Doxygen errors in Database.php, DatabasePostgres.php, DatabaseOracle.php and DatabaseMssql.php
* renamed \2types and \3types both to \types (with different number of param), Doxygen doesn't seem to like numbers in aliases
* Added aliases for @private, @protected and @public
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/db/Database.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/maintenance/Doxyfile (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Doxyfile
@@ -279,8 +279,8 @@
280280 SEARCHENGINE = NO
281281
282282 ALIASES = "type{1}=<b> \1 </b>:" \
283 - "2types{2}=<b> \1 </b> or <b> \2 </b>:" \
284 - "3types{3}=<b> \1 </b>, <b> \2 </b>, or <b> \3 </b>:" \
 283+ "types{2}=<b> \1 </b> or <b> \2 </b>:" \
 284+ "types{3}=<b> \1 </b>, <b> \2 </b>, or <b> \3 </b>:" \
285285 "arrayof{2}=<b> Array </b> of \2" \
286286 "null=\type{Null}" \
287287 "boolean=\type{Boolean}" \
@@ -289,4 +289,8 @@
290290 "int=\integer" \
291291 "string=\type{String}" \
292292 "str=\string" \
293 - "mixed=\type{Mixed}"
\ No newline at end of file
 293+ "mixed=\type{Mixed}" \
 294+ "access=\n<b> Access </b>:\n" \
 295+ "private=\access private" \
 296+ "protected=\access protected" \
 297+ "public=\access public"
\ No newline at end of file
Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -509,10 +509,10 @@
510510 * Returns an SQL expression for a simple conditional.
511511 * Uses CASE on Oracle
512512 *
513 - * @param string $cond SQL expression which will result in a boolean value
514 - * @param string $trueVal SQL expression to return if true
515 - * @param string $falseVal SQL expression to return if false
516 - * @return string SQL fragment
 513+ * @param $cond String: SQL expression which will result in a boolean value
 514+ * @param $trueVal String: SQL expression to return if true
 515+ * @param $falseVal String: SQL expression to return if false
 516+ * @return String: SQL fragment
517517 */
518518 function conditional( $cond, $trueVal, $falseVal ) {
519519 return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
@@ -640,7 +640,7 @@
641641 *
642642 * @private
643643 *
644 - * @param array $options an associative array of options to be turned into
 644+ * @param $options Array: an associative array of options to be turned into
645645 * an SQL query, valid keys are listed in the function.
646646 * @return array
647647 */
Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -723,10 +723,10 @@
724724 * $args may be a single associative array, or an array of these with numeric keys,
725725 * for multi-row insert (Postgres version 8.2 and above only).
726726 *
727 - * @param array $table String: Name of the table to insert to.
728 - * @param array $args Array: Items to insert into the table.
729 - * @param array $fname String: Name of the function, for profiling
730 - * @param mixed $options String or Array. Valid options: IGNORE
 727+ * @param $table String: Name of the table to insert to.
 728+ * @param $args Array: Items to insert into the table.
 729+ * @param $fname String: Name of the function, for profiling
 730+ * @param $options String or Array. Valid options: IGNORE
731731 *
732732 * @return bool Success of insert operation. IGNORE always returns true.
733733 */
@@ -1001,10 +1001,10 @@
10021002 * Returns an SQL expression for a simple conditional.
10031003 * Uses CASE on Postgres
10041004 *
1005 - * @param string $cond SQL expression which will result in a boolean value
1006 - * @param string $trueVal SQL expression to return if true
1007 - * @param string $falseVal SQL expression to return if false
1008 - * @return string SQL fragment
 1005+ * @param $cond String: SQL expression which will result in a boolean value
 1006+ * @param $trueVal String: SQL expression to return if true
 1007+ * @param $falseVal String: SQL expression to return if false
 1008+ * @return String: SQL fragment
10091009 */
10101010 function conditional( $cond, $trueVal, $falseVal ) {
10111011 return " (CASE WHEN $cond THEN $trueVal ELSE $falseVal END) ";
@@ -1305,7 +1305,7 @@
13061306 *
13071307 * @private
13081308 *
1309 - * @param string $com SQL string, read from a stream (usually tables.sql)
 1309+ * @param $ins String: SQL string, read from a stream (usually tables.sql)
13101310 *
13111311 * @return string SQL string
13121312 */
@@ -1330,7 +1330,7 @@
13311331 *
13321332 * @private
13331333 *
1334 - * @param array $options an associative array of options to be turned into
 1334+ * @param $options Array: an associative array of options to be turned into
13351335 * an SQL query, valid keys are listed in the function.
13361336 * @return array
13371337 */
Index: trunk/phase3/includes/db/Database.php
@@ -207,13 +207,13 @@
208208
209209 /**
210210 * Return the last query that went through Database::query()
211 - * @return string
 211+ * @return String
212212 */
213213 function lastQuery() { return $this->mLastQuery; }
214214
215215 /**
216216 * Is a connection to the database open?
217 - * @return bool
 217+ * @return Boolean
218218 */
219219 function isOpen() { return $this->mOpened; }
220220
@@ -248,13 +248,13 @@
249249 # Other functions
250250 #------------------------------------------------------------------------------
251251
252 - /**@{{
 252+ /**
253253 * Constructor.
254 - * @param string $server database server host
255 - * @param string $user database user name
256 - * @param string $password database user password
257 - * @param string $dbname database name
258 - * @param failFunction
 254+ * @param $server String: database server host
 255+ * @param $user String: database user name
 256+ * @param $password String: database user password
 257+ * @param $dbName String: database name
 258+ * @param $failFunction
259259 * @param $flags
260260 * @param $tablePrefix String: database table prefixes. By default use the prefix gave in LocalSettings.php
261261 */
@@ -298,7 +298,11 @@
299299 }
300300
301301 /**
302 - * @static
 302+ * Same as new Database( ... ), kept for backward compatibility
 303+ * @param $server String: database server host
 304+ * @param $user String: database user name
 305+ * @param $password String: database user password
 306+ * @param $dbName String: database name
303307 * @param failFunction
304308 * @param $flags
305309 */
@@ -310,6 +314,10 @@
311315 /**
312316 * Usually aborts on failure
313317 * If the failFunction is set to a non-zero integer, returns success
 318+ * @param $server String: database server host
 319+ * @param $user String: database user name
 320+ * @param $password String: database user password
 321+ * @param $dbName String: database name
314322 */
315323 function open( $server, $user, $password, $dbName ) {
316324 global $wgAllDBsAreLocalhost;
@@ -419,7 +427,6 @@
420428 wfProfileOut( __METHOD__ );
421429 return $success;
422430 }
423 - /**@}}*/
424431
425432 protected function installErrorHandler() {
426433 $this->mPHPError = false;
@@ -449,7 +456,7 @@
450457 * Closes a database connection.
451458 * if it is open : commits any open transactions
452459 *
453 - * @return bool operation success. true if already closed.
 460+ * @return Bool operation success. true if already closed.
454461 */
455462 function close()
456463 {
@@ -465,7 +472,7 @@
466473 }
467474
468475 /**
469 - * @param string $error fallback error message, used if none is given by MySQL
 476+ * @param $error String: fallback error message, used if none is given by MySQL
470477 */
471478 function reportConnectionError( $error = 'Unknown error' ) {
472479 $myError = $this->lastError();
@@ -491,7 +498,7 @@
492499 * @param $sql String: SQL query
493500 * @param $fname String: Name of the calling function, for profiling/SHOW PROCESSLIST
494501 * comment (you can use __METHOD__ or add some extra info)
495 - * @param $tempIgnore Bool: Whether to avoid throwing an exception on errors...
 502+ * @param $tempIgnore Boolean: Whether to avoid throwing an exception on errors...
496503 * maybe best to catch the exception instead?
497504 * @return true for a successful write query, ResultWrapper object for a successful read query,
498505 * or false on failure if $tempIgnore set
@@ -595,7 +602,7 @@
596603 * The DBMS-dependent part of query()
597604 * @param $sql String: SQL query.
598605 * @return Result object to feed to fetchObject, fetchRow, ...; or false on failure
599 - * @access private
 606+ * @private
600607 */
601608 /*private*/ function doQuery( $sql ) {
602609 if( $this->bufferResults() ) {
@@ -607,11 +614,11 @@
608615 }
609616
610617 /**
611 - * @param $error
612 - * @param $errno
613 - * @param $sql
614 - * @param string $fname
615 - * @param bool $tempIgnore
 618+ * @param $error String
 619+ * @param $errno Integer
 620+ * @param $sql String
 621+ * @param $fname String
 622+ * @param $tempIgnore Boolean
616623 */
617624 function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
618625 global $wgCommandLineMode;
@@ -653,8 +660,8 @@
654661
655662 /**
656663 * Execute a prepared query with the various arguments
657 - * @param string $prepared the prepared sql
658 - * @param mixed $args Either an array here, or put scalars as varargs
 664+ * @param $prepared String: the prepared sql
 665+ * @param $args Mixed: Either an array here, or put scalars as varargs
659666 */
660667 function execute( $prepared, $args = null ) {
661668 if( !is_array( $args ) ) {
@@ -669,8 +676,8 @@
670677 /**
671678 * Prepare & execute an SQL statement, quoting and inserting arguments
672679 * in the appropriate places.
673 - * @param string $query
674 - * @param string $args ...
 680+ * @param $query String
 681+ * @param $args ...
675682 */
676683 function safeQuery( $query, $args = null ) {
677684 $prepared = $this->prepare( $query, 'Database::safeQuery' );
@@ -687,8 +694,8 @@
688695 /**
689696 * For faking prepared SQL statements on DBs that don't support
690697 * it directly.
691 - * @param string $preparedSql - a 'preparable' SQL statement
692 - * @param array $args - array of arguments to fill it with
 698+ * @param $preparedQuery String: a 'preparable' SQL statement
 699+ * @param $args Array of arguments to fill it with
693700 * @return string executable SQL
694701 */
695702 function fillPrepared( $preparedQuery, $args ) {
@@ -703,8 +710,8 @@
704711 * The arguments should be in $this->preparedArgs and must not be touched
705712 * while we're doing this.
706713 *
707 - * @param array $matches
708 - * @return string
 714+ * @param $matches Array
 715+ * @return String
709716 * @private
710717 */
711718 function fillPreparedArg( $matches ) {
@@ -725,11 +732,9 @@
726733 }
727734 }
728735
729 - /**#@+
730 - * @param mixed $res A SQL result
731 - */
732736 /**
733737 * Free a result object
 738+ * @param $res Mixed: A SQL result
734739 */
735740 function freeResult( $res ) {
736741 if ( $res instanceof ResultWrapper ) {
@@ -781,6 +786,7 @@
782787
783788 /**
784789 * Get the number of rows in a result object
 790+ * @param $res Mixed: A SQL result
785791 */
786792 function numRows( $res ) {
787793 if ( $res instanceof ResultWrapper ) {
@@ -796,6 +802,7 @@
797803 /**
798804 * Get the number of fields in a result object
799805 * See documentation for mysql_num_fields()
 806+ * @param $res Mixed: A SQL result
800807 */
801808 function numFields( $res ) {
802809 if ( $res instanceof ResultWrapper ) {
@@ -808,6 +815,8 @@
809816 * Get a field name in a result object
810817 * See documentation for mysql_field_name():
811818 * http://www.php.net/mysql_field_name
 819+ * @param $res Mixed: A SQL result
 820+ * @param $n Integer
812821 */
813822 function fieldName( $res, $n ) {
814823 if ( $res instanceof ResultWrapper ) {
@@ -831,6 +840,8 @@
832841 /**
833842 * Change the position of the cursor in a result object
834843 * See mysql_data_seek()
 844+ * @param $res Mixed: A SQL result
 845+ * @param $row Mixed: Either MySQL row or ResultWrapper
835846 */
836847 function dataSeek( $res, $row ) {
837848 if ( $res instanceof ResultWrapper ) {
@@ -877,7 +888,6 @@
878889 * See mysql_affected_rows() for more details
879890 */
880891 function affectedRows() { return mysql_affected_rows( $this->mConn ); }
881 - /**#@-*/ // end of template : @param $result
882892
883893 /**
884894 * Simple UPDATE wrapper
@@ -887,8 +897,7 @@
888898 * This function exists for historical reasons, Database::update() has a more standard
889899 * calling convention and feature set
890900 */
891 - function set( $table, $var, $value, $cond, $fname = 'Database::set' )
892 - {
 901+ function set( $table, $var, $value, $cond, $fname = 'Database::set' ) {
893902 $table = $this->tableName( $table );
894903 $sql = "UPDATE $table SET $var = '" .
895904 $this->strencode( $value ) . "' WHERE ($cond)";
@@ -925,9 +934,9 @@
926935 *
927936 * @private
928937 *
929 - * @param array $options an associative array of options to be turned into
 938+ * @param $options Array: associative array of options to be turned into
930939 * an SQL query, valid keys are listed in the function.
931 - * @return array
 940+ * @return Array
932941 */
933942 function makeSelectOptions( $options ) {
934943 $preLimitTail = $postLimitTail = '';
@@ -976,14 +985,14 @@
977986 /**
978987 * SELECT wrapper
979988 *
980 - * @param mixed $table Array or string, table name(s) (prefix auto-added)
981 - * @param mixed $vars Array or string, field name(s) to be retrieved
982 - * @param mixed $conds Array or string, condition(s) for WHERE
983 - * @param string $fname Calling function name (use __METHOD__) for logs/profiling
984 - * @param array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')),
985 - * see Database::makeSelectOptions code for list of supported stuff
986 - * @param array $join_conds Associative array of table join conditions (optional)
987 - * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
 989+ * @param $table Mixed: Array or string, table name(s) (prefix auto-added)
 990+ * @param $vars Mixed: Array or string, field name(s) to be retrieved
 991+ * @param $conds Mixed: Array or string, condition(s) for WHERE
 992+ * @param $fname String: Calling function name (use __METHOD__) for logs/profiling
 993+ * @param $options Array: Associative array of options (e.g. array('GROUP BY' => 'page_title')),
 994+ * see Database::makeSelectOptions code for list of supported stuff
 995+ * @param $join_conds Array: Associative array of table join conditions (optional)
 996+ * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
988997 * @return mixed Database result resource (feed to Database::fetchObject or whatever), or false on failure
989998 */
990999 function select( $table, $vars, $conds='', $fname = 'Database::select', $options = array(), $join_conds = array() )
@@ -995,14 +1004,14 @@
9961005 /**
9971006 * SELECT wrapper
9981007 *
999 - * @param mixed $table Array or string, table name(s) (prefix auto-added)
1000 - * @param mixed $vars Array or string, field name(s) to be retrieved
1001 - * @param mixed $conds Array or string, condition(s) for WHERE
1002 - * @param string $fname Calling function name (use __METHOD__) for logs/profiling
1003 - * @param array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')),
1004 - * see Database::makeSelectOptions code for list of supported stuff
1005 - * @param array $join_conds Associative array of table join conditions (optional)
1006 - * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
 1008+ * @param $table Mixed: Array or string, table name(s) (prefix auto-added)
 1009+ * @param $vars Mixed: Array or string, field name(s) to be retrieved
 1010+ * @param $conds Mixed: Array or string, condition(s) for WHERE
 1011+ * @param $fname String: Calling function name (use __METHOD__) for logs/profiling
 1012+ * @param $options Array: Associative array of options (e.g. array('GROUP BY' => 'page_title')),
 1013+ * see Database::makeSelectOptions code for list of supported stuff
 1014+ * @param $join_conds Array: Associative array of table join conditions (optional)
 1015+ * (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') )
10071016 * @return string, the SQL text
10081017 */
10091018 function selectSQLText( $table, $vars, $conds='', $fname = 'Database::select', $options = array(), $join_conds = array() ) {
@@ -1053,13 +1062,17 @@
10541063 * Single row SELECT wrapper
10551064 * Aborts or returns FALSE on error
10561065 *
1057 - * $vars: the selected variables
1058 - * $conds: a condition map, terms are ANDed together.
 1066+ * @param $table String: table name
 1067+ * @param $vars String: the selected variables
 1068+ * @param $conds Array: a condition map, terms are ANDed together.
10591069 * Items with numeric keys are taken to be literal conditions
10601070 * Takes an array of selected variables, and a condition map, which is ANDed
10611071 * e.g: selectRow( "page", array( "page_id" ), array( "page_namespace" =>
10621072 * NS_MAIN, "page_title" => "Astronomy" ) ) would return an object where
10631073 * $obj- >page_id is the ID of the Astronomy article
 1074+ * @param $fname String: Calling functio name
 1075+ * @param $options Array
 1076+ * @param $join_conds Array
10641077 *
10651078 * @todo migrate documentation to phpdocumentor format
10661079 */
@@ -1109,8 +1122,7 @@
11101123 * Removes most variables from an SQL query and replaces them with X or N for numbers.
11111124 * It's only slightly flawed. Don't use for anything important.
11121125 *
1113 - * @param string $sql A SQL Query
1114 - * @static
 1126+ * @param $sql String: A SQL Query
11151127 */
11161128 static function generalizeSQL( $sql ) {
11171129 # This does the same as the regexp below would do, but in such a way
@@ -1303,7 +1315,7 @@
13041316 * Make UPDATE options for the Database::update function
13051317 *
13061318 * @private
1307 - * @param array $options The options passed to Database::update
 1319+ * @param $options Array: The options passed to Database::update
13081320 * @return string
13091321 */
13101322 function makeUpdateOptions( $options ) {
@@ -1321,14 +1333,14 @@
13221334 /**
13231335 * UPDATE wrapper, takes a condition array and a SET array
13241336 *
1325 - * @param string $table The table to UPDATE
1326 - * @param array $values An array of values to SET
1327 - * @param array $conds An array of conditions (WHERE). Use '*' to update all rows.
1328 - * @param string $fname The Class::Function calling this function
1329 - * (for the log)
1330 - * @param array $options An array of UPDATE options, can be one or
 1337+ * @param $table String: The table to UPDATE
 1338+ * @param $values Array: An array of values to SET
 1339+ * @param $conds Array: An array of conditions (WHERE). Use '*' to update all rows.
 1340+ * @param $fname String: The Class::Function calling this function
 1341+ * (for the log)
 1342+ * @param $options Array: An array of UPDATE options, can be one or
13311343 * more of IGNORE, LOW_PRIORITY
1332 - * @return bool
 1344+ * @return Boolean
13331345 */
13341346 function update( $table, $values, $conds, $fname = 'Database::update', $options = array() ) {
13351347 $table = $this->tableName( $table );
@@ -1433,8 +1445,8 @@
14341446 * themselves. Pass the canonical name to such functions. This is only needed
14351447 * when calling query() directly.
14361448 *
1437 - * @param string $name database table name
1438 - * @return string full database name
 1449+ * @param $name String: database table name
 1450+ * @return String: full database name
14391451 */
14401452 function tableName( $name ) {
14411453 global $wgSharedDB, $wgSharedPrefix, $wgSharedTables;
@@ -1563,8 +1575,8 @@
15641576
15651577 /**
15661578 * Wrapper for addslashes()
1567 - * @param string $s String to be slashed.
1568 - * @return string slashed string.
 1579+ * @param $s String: to be slashed.
 1580+ * @return String: slashed string.
15691581 */
15701582 function strencode( $s ) {
15711583 return mysql_real_escape_string( $s, $this->mConn );
@@ -1655,11 +1667,12 @@
16561668 *
16571669 * DO NOT put the join condition in $conds
16581670 *
1659 - * @param string $delTable The table to delete from.
1660 - * @param string $joinTable The other table.
1661 - * @param string $delVar The variable to join on, in the first table.
1662 - * @param string $joinVar The variable to join on, in the second table.
1663 - * @param array $conds Condition array of field names mapped to variables, ANDed together in the WHERE clause
 1671+ * @param $delTable String: The table to delete from.
 1672+ * @param $joinTable String: The other table.
 1673+ * @param $delVar String: The variable to join on, in the first table.
 1674+ * @param $joinVar String: The variable to join on, in the second table.
 1675+ * @param $conds Array: Condition array of field names mapped to variables, ANDed together in the WHERE clause
 1676+ * @param $fname String: Calling function name (use __METHOD__) for logs/profiling
16641677 */
16651678 function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'Database::deleteJoin' ) {
16661679 if ( !$conds ) {
@@ -1755,9 +1768,9 @@
17561769 /**
17571770 * Construct a LIMIT query with optional offset
17581771 * This is used for query pages
1759 - * $sql string SQL query we will append the limit too
1760 - * $limit integer the SQL limit
1761 - * $offset integer the SQL offset (default false)
 1772+ * @param $sql String: SQL query we will append the limit too
 1773+ * @param $limit Integer: the SQL limit
 1774+ * @param $offset Integer the SQL offset (default false)
17621775 */
17631776 function limitResult($sql, $limit, $offset=false) {
17641777 if( !is_numeric($limit) ) {
@@ -1775,10 +1788,10 @@
17761789 * Returns an SQL expression for a simple conditional.
17771790 * Uses IF on MySQL.
17781791 *
1779 - * @param string $cond SQL expression which will result in a boolean value
1780 - * @param string $trueVal SQL expression to return if true
1781 - * @param string $falseVal SQL expression to return if false
1782 - * @return string SQL fragment
 1792+ * @param $cond String: SQL expression which will result in a boolean value
 1793+ * @param $trueVal String: SQL expression to return if true
 1794+ * @param $falseVal String: SQL expression to return if false
 1795+ * @return String: SQL fragment
17831796 */
17841797 function conditional( $cond, $trueVal, $falseVal ) {
17851798 return " IF($cond, $trueVal, $falseVal) ";
@@ -1788,9 +1801,9 @@
17891802 * Returns a comand for str_replace function in SQL query.
17901803 * Uses REPLACE() in MySQL
17911804 *
1792 - * @param string $orig String or column to modify
1793 - * @param string $old String or column to seek
1794 - * @param string $new String or column to replace with
 1805+ * @param $orig String: column to modify
 1806+ * @param $old String: column to seek
 1807+ * @param $new String: column to replace with
17951808 */
17961809 function strreplace( $orig, $old, $new ) {
17971810 return "REPLACE({$orig}, {$old}, {$new})";
@@ -1861,9 +1874,8 @@
18621875 /**
18631876 * Do a SELECT MASTER_POS_WAIT()
18641877 *
1865 - * @param string $file the binlog file
1866 - * @param string $pos the binlog position
1867 - * @param integer $timeout the maximum number of seconds to wait for synchronisation
 1878+ * @param $pos MySQLMasterPos object
 1879+ * @param $timeout Integer: the maximum number of seconds to wait for synchronisation
18681880 */
18691881 function masterPosWait( MySQLMasterPos $pos, $timeout ) {
18701882 $fname = 'Database::masterPosWait';
@@ -2024,14 +2036,14 @@
20252037 }
20262038
20272039 /**
2028 - * @return string wikitext of a link to the server software's web site
 2040+ * @return String: wikitext of a link to the server software's web site
20292041 */
20302042 function getSoftwareLink() {
20312043 return "[http://www.mysql.com/ MySQL]";
20322044 }
20332045
20342046 /**
2035 - * @return string Version information from the database
 2047+ * @return String: Version information from the database
20362048 */
20372049 function getServerVersion() {
20382050 return mysql_get_server_info( $this->mConn );
@@ -2129,7 +2141,7 @@
21302142 * May be useful for very long batch queries such as
21312143 * full-wiki dumps, where a single query reads out
21322144 * over hours or days.
2133 - * @param int $timeout in seconds
 2145+ * @param $timeout Integer in seconds
21342146 */
21352147 public function setTimeout( $timeout ) {
21362148 $this->query( "SET net_read_timeout=$timeout" );
@@ -2139,9 +2151,9 @@
21402152 /**
21412153 * Read and execute SQL commands from a file.
21422154 * Returns true on success, error string or exception on failure (depending on object's error ignore settings)
2143 - * @param string $filename File name to open
2144 - * @param callback $lineCallback Optional function called before reading each line
2145 - * @param callback $resultCallback Optional function called for each MySQL result
 2155+ * @param $filename String: File name to open
 2156+ * @param $lineCallback Callback: Optional function called before reading each line
 2157+ * @param $resultCallback Callback: Optional function called for each MySQL result
21462158 */
21472159 function sourceFile( $filename, $lineCallback = false, $resultCallback = false ) {
21482160 $fp = fopen( $filename, 'r' );
@@ -2156,9 +2168,9 @@
21572169 /**
21582170 * Read and execute commands from an open file handle
21592171 * Returns true on success, error string or exception on failure (depending on object's error ignore settings)
2160 - * @param string $fp File handle
2161 - * @param callback $lineCallback Optional function called before reading each line
2162 - * @param callback $resultCallback Optional function called for each MySQL result
 2172+ * @param $fp String: File handle
 2173+ * @param $lineCallback Callback: Optional function called before reading each line
 2174+ * @param $resultCallback Callback: Optional function called for each MySQL result
21632175 */
21642176 function sourceStream( $fp, $lineCallback = false, $resultCallback = false ) {
21652177 $cmd = "";
@@ -2263,8 +2275,8 @@
22642276 * Abstracted from Filestore::lock() so child classes can implement for
22652277 * their own needs.
22662278 *
2267 - * @param string $lockName Name of lock to aquire
2268 - * @param string $method Name of method calling us
 2279+ * @param $lockName String: Name of lock to aquire
 2280+ * @param $method String: Name of method calling us
22692281 * @return bool
22702282 */
22712283 public function lock( $lockName, $method ) {
@@ -2286,8 +2298,8 @@
22872299 * @todo fixme - Figure out a way to return a bool
22882300 * based on successful lock release.
22892301 *
2290 - * @param string $lockName Name of lock to release
2291 - * @param string $method Name of method calling us
 2302+ * @param $lockName String: Name of lock to release
 2303+ * @param $method String: Name of method calling us
22922304 */
22932305 public function unlock( $lockName, $method ) {
22942306 $lockName = $this->addQuotes( $lockName );
@@ -2299,7 +2311,7 @@
23002312 * Get search engine class. All subclasses of this
23012313 * need to implement this if they wish to use searching.
23022314 *
2303 - * @return string
 2315+ * @return String
23042316 */
23052317 public function getSearchEngine() {
23062318 return "SearchMySQL";
@@ -2423,8 +2435,8 @@
24242436
24252437 /**
24262438 * Construct a database error
2427 - * @param Database $db The database object which threw the error
2428 - * @param string $error A simple error message to be used for debugging
 2439+ * @param $db Database object which threw the error
 2440+ * @param $error A simple error message to be used for debugging
24292441 */
24302442 function __construct( Database &$db, $error ) {
24312443 $this->db =& $db;
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -154,9 +154,6 @@
155155 return $ret;
156156 }
157157
158 - /**#@+
159 - * @param mixed $res A SQL result
160 - */
161158 /**
162159 * Free a result object
163160 */
@@ -225,6 +222,7 @@
226223 /**
227224 * Get the number of fields in a result object
228225 * See documentation for mysql_num_fields()
 226+ * @param $res SQL result object as returned from Database::query(), etc.
229227 */
230228 function numFields( $res ) {
231229 if ( $res instanceof ResultWrapper ) {
@@ -237,6 +235,8 @@
238236 * Get a field name in a result object
239237 * See documentation for mysql_field_name():
240238 * http://www.php.net/mysql_field_name
 239+ * @param $res SQL result object as returned from Database::query(), etc.
 240+ * @param $n Int
241241 */
242242 function fieldName( $res, $n ) {
243243 if ( $res instanceof ResultWrapper ) {
@@ -263,6 +263,8 @@
264264 /**
265265 * Change the position of the cursor in a result object
266266 * See mysql_data_seek()
 267+ * @param $res SQL result object as returned from Database::query(), etc.
 268+ * @param $row Database row
267269 */
268270 function dataSeek( $res, $row ) {
269271 if ( $res instanceof ResultWrapper ) {
@@ -339,7 +341,7 @@
340342 *
341343 * @private
342344 *
343 - * @param array $options an associative array of options to be turned into
 345+ * @param $options Array: an associative array of options to be turned into
344346 * an SQL query, valid keys are listed in the function.
345347 * @return array
346348 */
@@ -390,11 +392,11 @@
391393 /**
392394 * SELECT wrapper
393395 *
394 - * @param mixed $table Array or string, table name(s) (prefix auto-added)
395 - * @param mixed $vars Array or string, field name(s) to be retrieved
396 - * @param mixed $conds Array or string, condition(s) for WHERE
397 - * @param string $fname Calling function name (use __METHOD__) for logs/profiling
398 - * @param array $options Associative array of options (e.g. array('GROUP BY' => 'page_title')),
 396+ * @param $table Mixed: Array or string, table name(s) (prefix auto-added)
 397+ * @param $vars Mixed: Array or string, field name(s) to be retrieved
 398+ * @param $conds Mixed: Array or string, condition(s) for WHERE
 399+ * @param $fname String: Calling function name (use __METHOD__) for logs/profiling
 400+ * @param $options Array: Associative array of options (e.g. array('GROUP BY' => 'page_title')),
399401 * see Database::makeSelectOptions code for list of supported stuff
400402 * @return mixed Database result resource (feed to Database::fetchObject or whatever), or false on failure
401403 */
@@ -643,12 +645,12 @@
644646 /**
645647 * UPDATE wrapper, takes a condition array and a SET array
646648 *
647 - * @param string $table The table to UPDATE
648 - * @param array $values An array of values to SET
649 - * @param array $conds An array of conditions (WHERE). Use '*' to update all rows.
650 - * @param string $fname The Class::Function calling this function
651 - * (for the log)
652 - * @param array $options An array of UPDATE options, can be one or
 649+ * @param $table String: The table to UPDATE
 650+ * @param $values Array: An array of values to SET
 651+ * @param $conds Array: An array of conditions (WHERE). Use '*' to update all rows.
 652+ * @param $fname String: The Class::Function calling this function
 653+ * (for the log)
 654+ * @param $options Array: An array of UPDATE options, can be one or
653655 * more of IGNORE, LOW_PRIORITY
654656 * @return bool
655657 */
@@ -666,7 +668,7 @@
667669 * Make UPDATE options for the Database::update function
668670 *
669671 * @private
670 - * @param array $options The options passed to Database::update
 672+ * @param $options Array: The options passed to Database::update
671673 * @return string
672674 */
673675 function makeUpdateOptions( $options ) {
@@ -698,7 +700,7 @@
699701
700702 /**
701703 * MSSQL doubles quotes instead of escaping them
702 - * @param string $s String to be slashed.
 704+ * @param $s String to be slashed.
703705 * @return string slashed string.
704706 */
705707 function strencode($s) {
@@ -755,11 +757,12 @@
756758 *
757759 * DO NOT put the join condition in $conds
758760 *
759 - * @param string $delTable The table to delete from.
760 - * @param string $joinTable The other table.
761 - * @param string $delVar The variable to join on, in the first table.
762 - * @param string $joinVar The variable to join on, in the second table.
763 - * @param array $conds Condition array of field names mapped to variables, ANDed together in the WHERE clause
 761+ * @param $delTable String: The table to delete from.
 762+ * @param $joinTable String: The other table.
 763+ * @param $delVar String: The variable to join on, in the first table.
 764+ * @param $joinVar String: The variable to join on, in the second table.
 765+ * @param $conds Array: Condition array of field names mapped to variables, ANDed together in the WHERE clause
 766+ * @param $fname String: Calling function name
764767 */
765768 function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = 'Database::deleteJoin' ) {
766769 if ( !$conds ) {
@@ -857,9 +860,9 @@
858861 /**
859862 * Returns an SQL expression for a simple conditional.
860863 *
861 - * @param string $cond SQL expression which will result in a boolean value
862 - * @param string $trueVal SQL expression to return if true
863 - * @param string $falseVal SQL expression to return if false
 864+ * @param $cond String: SQL expression which will result in a boolean value
 865+ * @param $trueVal String: SQL expression to return if true
 866+ * @param $falseVal String: SQL expression to return if false
864867 * @return string SQL fragment
865868 */
866869 function conditional( $cond, $trueVal, $falseVal ) {
Index: trunk/phase3/includes/User.php
@@ -436,8 +436,7 @@
437437 /**
438438 * Get database id given a user name
439439 * @param $name \string Username
440 - * @return \2types{\int,\null} The corresponding user's ID, or null if user is nonexistent
441 - * @static
 440+ * @return \types{\int,\null} The corresponding user's ID, or null if user is nonexistent
442441 */
443442 static function idFromName( $name ) {
444443 $nt = Title::makeTitleSafe( NS_USER, $name );
@@ -631,7 +630,7 @@
632631 * Given unvalidated user input, return a canonical username, or false if
633632 * the username is invalid.
634633 * @param $name \string User input
635 - * @param $validate \2types{\string,\bool} Type of validation to use:
 634+ * @param $validate \types{\string,\bool} Type of validation to use:
636635 * - false No validation
637636 * - 'valid' Valid for batch processes
638637 * - 'usable' Valid for batch processes and login
@@ -1487,7 +1486,7 @@
14881487 *
14891488 * @see getNewtalk()
14901489 * @param $field \string 'user_ip' for anonymous users, 'user_id' otherwise
1491 - * @param $id \2types{\string,\int} User's IP address for anonymous users, User ID otherwise
 1490+ * @param $id \types{\string,\int} User's IP address for anonymous users, User ID otherwise
14921491 * @param $fromMaster \bool true to fetch from the master, false for a slave
14931492 * @return \bool True if the user has new messages
14941493 * @private
@@ -1506,7 +1505,7 @@
15071506 /**
15081507 * Add or update the new messages flag
15091508 * @param $field \string 'user_ip' for anonymous users, 'user_id' otherwise
1510 - * @param $id \2types{\string,\int} User's IP address for anonymous users, User ID otherwise
 1509+ * @param $id \types{\string,\int} User's IP address for anonymous users, User ID otherwise
15111510 * @return \bool True if successful, false otherwise
15121511 * @private
15131512 */
@@ -1528,7 +1527,7 @@
15291528 /**
15301529 * Clear the new messages flag for the given user
15311530 * @param $field \string 'user_ip' for anonymous users, 'user_id' otherwise
1532 - * @param $id \2types{\string,\int} User's IP address for anonymous users, User ID otherwise
 1531+ * @param $id \types{\string,\int} User's IP address for anonymous users, User ID otherwise
15331532 * @return \bool True if successful, false otherwise
15341533 * @private
15351534 */
@@ -2712,7 +2711,7 @@
27132712 * login credentials aren't being hijacked with a foreign form
27142713 * submission.
27152714 *
2716 - * @param $salt \2types{\string,\arrayof{\string}} Optional function-specific data for hashing
 2715+ * @param $salt \types{\string,\arrayof{\string}} Optional function-specific data for hashing
27172716 * @return \string The new edit token
27182717 */
27192718 function editToken( $salt = '' ) {
@@ -2778,7 +2777,7 @@
27792778 * Generate a new e-mail confirmation token and send a confirmation/invalidation
27802779 * mail to the user's given address.
27812780 *
2782 - * @return \2types{\bool,\type{WikiError}} True on success, a WikiError object on failure.
 2781+ * @return \types{\bool,\type{WikiError}} True on success, a WikiError object on failure.
27832782 */
27842783 function sendConfirmationMail() {
27852784 global $wgLang;
@@ -2805,7 +2804,7 @@
28062805 * @param $body \string Message body
28072806 * @param $from \string Optional From address; if unspecified, default $wgPasswordSender will be used
28082807 * @param $replyto \string Reply-To address
2809 - * @return \2types{\bool,\type{WikiError}} True on success, a WikiError object on failure
 2808+ * @return \types{\bool,\type{WikiError}} True on success, a WikiError object on failure
28102809 */
28112810 function sendMail( $subject, $body, $from = null, $replyto = null ) {
28122811 if( is_null( $from ) ) {
@@ -2983,7 +2982,7 @@
29842983 /**
29852984 * Get the timestamp of account creation.
29862985 *
2987 - * @return \2types{\string,\bool} string Timestamp of account creation, or false for
 2986+ * @return \types{\string,\bool} string Timestamp of account creation, or false for
29882987 * non-existent/anonymous user accounts.
29892988 */
29902989 public function getRegistration() {
@@ -3106,7 +3105,7 @@
31073106 * Get the title of a page describing a particular group
31083107 *
31093108 * @param $group \string Internal group name
3110 - * @return \2types{\type{Title},\bool} Title of the page if it exists, false otherwise
 3109+ * @return \types{\type{Title},\bool} Title of the page if it exists, false otherwise
31113110 */
31123111 static function getGroupPage( $group ) {
31133112 global $wgMessageCache;

Status & tagging log