@@ -328,7 +328,7 @@ |
||
328 | 328 | /** |
329 | 329 | * @param DatabaseBase $db |
330 | 330 | * @param string $error |
331 | - * @param int|string $errno |
|
331 | + * @param integer $errno |
|
332 | 332 | * @param string $sql |
333 | 333 | * @param string $fname |
334 | 334 | */ |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | /** |
370 | 370 | * SELECT wrapper |
371 | 371 | * |
372 | - * @param mixed $table Array or string, table name(s) (prefix auto-added) |
|
373 | - * @param mixed $vars Array or string, field name(s) to be retrieved |
|
372 | + * @param string $table Array or string, table name(s) (prefix auto-added) |
|
373 | + * @param string $vars Array or string, field name(s) to be retrieved |
|
374 | 374 | * @param mixed $conds Array or string, condition(s) for WHERE |
375 | 375 | * @param string $fname Calling function name (use __METHOD__) for logs/profiling |
376 | 376 | * @param array $options Associative array of options (e.g. |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | * code for list of supported stuff |
379 | 379 | * @param array $join_conds Associative array of table join conditions |
380 | 380 | * (optional) (e.g. array( 'page' => array('LEFT JOIN','page_latest=rev_id') ) |
381 | - * @return mixed Database result resource (feed to Database::fetchObject |
|
381 | + * @return MssqlResultWrapper Database result resource (feed to Database::fetchObject |
|
382 | 382 | * or whatever), or false on failure |
383 | 383 | * @throws DBQueryError |
384 | 384 | * @throws DBUnexpectedError |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | * @param string $fname |
717 | 717 | * @param array $insertOptions |
718 | 718 | * @param array $selectOptions |
719 | - * @return null|ResultWrapper |
|
719 | + * @return ResultWrapper |
|
720 | 720 | * @throws Exception |
721 | 721 | */ |
722 | 722 | public function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__, |
@@ -860,7 +860,7 @@ discard block |
||
860 | 860 | * |
861 | 861 | * @param string $sql SQL query we will append the limit too |
862 | 862 | * @param int $limit The SQL limit |
863 | - * @param bool|int $offset The SQL offset (default false) |
|
863 | + * @param string|false $offset The SQL offset (default false) |
|
864 | 864 | * @return array|string |
865 | 865 | * @throws DBUnexpectedError |
866 | 866 | */ |
@@ -1149,7 +1149,7 @@ discard block |
||
1149 | 1149 | /** |
1150 | 1150 | * @param array $options An associative array of options to be turned into |
1151 | 1151 | * an SQL query, valid keys are listed in the function. |
1152 | - * @return array |
|
1152 | + * @return string[] |
|
1153 | 1153 | */ |
1154 | 1154 | public function makeSelectOptions( $options ) { |
1155 | 1155 | $tailOpts = ''; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | |
229 | 229 | /** |
230 | 230 | * @param ResultWrapper|resource $res |
231 | - * @return stdClass|bool |
|
231 | + * @return stdClass |
|
232 | 232 | * @throws DBUnexpectedError |
233 | 233 | */ |
234 | 234 | function fetchObject( $res ) { |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | /** |
364 | 364 | * Get the name of the specified field in a result |
365 | 365 | * |
366 | - * @param ResultWrapper|resource $res |
|
366 | + * @param resource $res |
|
367 | 367 | * @param int $n |
368 | 368 | * @return string |
369 | 369 | */ |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | /** |
387 | 387 | * Get the type of the specified field in a result |
388 | 388 | * |
389 | - * @param ResultWrapper|resource $res |
|
389 | + * @param resource $res |
|
390 | 390 | * @param int $n |
391 | 391 | * @return string |
392 | 392 | */ |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | /** |
409 | 409 | * Move internal result pointer |
410 | 410 | * |
411 | - * @param ResultWrapper|resource $res |
|
411 | + * @param resource $res |
|
412 | 412 | * @param int $row |
413 | 413 | * @return bool |
414 | 414 | */ |
@@ -941,6 +941,9 @@ discard block |
||
941 | 941 | return ( $row->lockstatus == 1 ); |
942 | 942 | } |
943 | 943 | |
944 | + /** |
|
945 | + * @param string $lockName |
|
946 | + */ |
|
944 | 947 | private function makeLockName( $lockName ) { |
945 | 948 | // http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock |
946 | 949 | // Newer version enforce a 64 char length limit. |
@@ -1296,6 +1299,9 @@ discard block |
||
1296 | 1299 | $is_pk, $is_unique, $is_multiple, $is_key, $type, $binary, |
1297 | 1300 | $is_numeric, $is_blob, $is_unsigned, $is_zerofill; |
1298 | 1301 | |
1302 | + /** |
|
1303 | + * @param stdClass $info |
|
1304 | + */ |
|
1299 | 1305 | function __construct( $info ) { |
1300 | 1306 | $this->name = $info->name; |
1301 | 1307 | $this->tablename = $info->table; |
@@ -85,6 +85,9 @@ discard block |
||
85 | 85 | unset( $this->db ); |
86 | 86 | } |
87 | 87 | |
88 | + /** |
|
89 | + * @param integer $row |
|
90 | + */ |
|
88 | 91 | public function seek( $row ) { |
89 | 92 | $this->cursor = min( $row, $this->nrows ); |
90 | 93 | } |
@@ -356,12 +359,15 @@ discard block |
||
356 | 359 | /** |
357 | 360 | * Closes a database connection, if it is open |
358 | 361 | * Returns success, true if already closed |
359 | - * @return bool |
|
362 | + * @return boolean|null |
|
360 | 363 | */ |
361 | 364 | protected function closeConnection() { |
362 | 365 | return oci_close( $this->mConn ); |
363 | 366 | } |
364 | 367 | |
368 | + /** |
|
369 | + * @return integer|null |
|
370 | + */ |
|
365 | 371 | function execFlags() { |
366 | 372 | return $this->mTrxLevel ? OCI_NO_AUTO_COMMIT : OCI_COMMIT_ON_SUCCESS; |
367 | 373 | } |
@@ -484,7 +490,7 @@ discard block |
||
484 | 490 | |
485 | 491 | /** |
486 | 492 | * This must be called after nextSequenceVal |
487 | - * @return null|int |
|
493 | + * @return integer |
|
488 | 494 | */ |
489 | 495 | function insertId() { |
490 | 496 | return $this->mInsertId; |
@@ -571,6 +577,9 @@ discard block |
||
571 | 577 | return $retVal; |
572 | 578 | } |
573 | 579 | |
580 | + /** |
|
581 | + * @param string $table |
|
582 | + */ |
|
574 | 583 | private function fieldBindStatement( $table, $col, &$val, $includeCol = false ) { |
575 | 584 | $col_info = $this->fieldInfoMulti( $table, $col ); |
576 | 585 | $col_type = $col_info != false ? $col_info->type() : 'CONSTANT'; |
@@ -610,7 +619,7 @@ discard block |
||
610 | 619 | * @param string $table |
611 | 620 | * @param array $row |
612 | 621 | * @param string $fname |
613 | - * @return bool |
|
622 | + * @return boolean|null |
|
614 | 623 | * @throws DBUnexpectedError |
615 | 624 | */ |
616 | 625 | private function insertOneRow( $table, $row, $fname ) { |
@@ -812,6 +821,9 @@ discard block |
||
812 | 821 | return strtoupper( parent::tableName( $name, $format ) ); |
813 | 822 | } |
814 | 823 | |
824 | + /** |
|
825 | + * @param string $name |
|
826 | + */ |
|
815 | 827 | function tableNameInternal( $name ) { |
816 | 828 | $name = $this->tableName( $name ); |
817 | 829 | |
@@ -1269,6 +1281,9 @@ discard block |
||
1269 | 1281 | return "'" . $this->strencode( $s ) . "'"; |
1270 | 1282 | } |
1271 | 1283 | |
1284 | + /** |
|
1285 | + * @param string $s |
|
1286 | + */ |
|
1272 | 1287 | public function addIdentifierQuotes( $s ) { |
1273 | 1288 | if ( !$this->getFlag( DBO_DDLMODE ) ) { |
1274 | 1289 | $s = '/*Q*/' . $s; |
@@ -1332,7 +1347,7 @@ discard block |
||
1332 | 1347 | * |
1333 | 1348 | * @param array $options An associative array of options to be turned into |
1334 | 1349 | * an SQL query, valid keys are listed in the function. |
1335 | - * @return array |
|
1350 | + * @return string[] |
|
1336 | 1351 | */ |
1337 | 1352 | function makeSelectOptions( $options ) { |
1338 | 1353 | $preLimitTail = $postLimitTail = ''; |
@@ -1406,7 +1421,7 @@ discard block |
||
1406 | 1421 | * @param array $conds |
1407 | 1422 | * @param string $fname |
1408 | 1423 | * @param array $options |
1409 | - * @return bool |
|
1424 | + * @return boolean|null |
|
1410 | 1425 | * @throws DBUnexpectedError |
1411 | 1426 | */ |
1412 | 1427 | function update( $table, $values, $conds, $fname = __METHOD__, $options = array() ) { |
@@ -168,6 +168,11 @@ discard block |
||
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
171 | + /** |
|
172 | + * @param string $keyword |
|
173 | + * @param string $msg_ok |
|
174 | + * @param string $msg_failed |
|
175 | + */ |
|
171 | 176 | protected function query( $keyword, $msg_ok, $msg_failed ) { |
172 | 177 | if ( $this->dbw->doQuery( $keyword . " " . $this->id ) !== false ) { |
173 | 178 | } else { |
@@ -259,6 +264,9 @@ discard block |
||
259 | 264 | return true; |
260 | 265 | } |
261 | 266 | |
267 | + /** |
|
268 | + * @param string $name |
|
269 | + */ |
|
262 | 270 | function hasConstraint( $name ) { |
263 | 271 | $sql = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " . |
264 | 272 | "WHERE c.connamespace = n.oid AND conname = '" . |
@@ -550,7 +558,7 @@ discard block |
||
550 | 558 | * Return the result of the last call to nextSequenceValue(); |
551 | 559 | * This must be called after nextSequenceValue(). |
552 | 560 | * |
553 | - * @return int|null |
|
561 | + * @return integer |
|
554 | 562 | */ |
555 | 563 | function insertId() { |
556 | 564 | return $this->mInsertId; |
@@ -1310,6 +1318,10 @@ discard block |
||
1310 | 1318 | return $this->relationExists( $sequence, 'S', $schema ); |
1311 | 1319 | } |
1312 | 1320 | |
1321 | + /** |
|
1322 | + * @param string $table |
|
1323 | + * @param string $trigger |
|
1324 | + */ |
|
1313 | 1325 | function triggerExists( $table, $trigger ) { |
1314 | 1326 | $q = <<<SQL |
1315 | 1327 | SELECT 1 FROM pg_class, pg_namespace, pg_trigger |
@@ -1333,6 +1345,10 @@ discard block |
||
1333 | 1345 | return $rows; |
1334 | 1346 | } |
1335 | 1347 | |
1348 | + /** |
|
1349 | + * @param string $table |
|
1350 | + * @param string $rule |
|
1351 | + */ |
|
1336 | 1352 | function ruleExists( $table, $rule ) { |
1337 | 1353 | $exists = $this->selectField( 'pg_rules', 'rulename', |
1338 | 1354 | array( |
@@ -1475,7 +1491,7 @@ discard block |
||
1475 | 1491 | * |
1476 | 1492 | * @param array $options An associative array of options to be turned into |
1477 | 1493 | * an SQL query, valid keys are listed in the function. |
1478 | - * @return array |
|
1494 | + * @return string[] |
|
1479 | 1495 | */ |
1480 | 1496 | function makeSelectOptions( $options ) { |
1481 | 1497 | $preLimitTail = $postLimitTail = ''; |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | * Filter the options used in SELECT statements |
552 | 552 | * |
553 | 553 | * @param array $options |
554 | - * @return array |
|
554 | + * @return string[] |
|
555 | 555 | */ |
556 | 556 | function makeSelectOptions( $options ) { |
557 | 557 | foreach ( $options as $k => $v ) { |
@@ -1048,6 +1048,9 @@ discard block |
||
1048 | 1048 | class SQLiteField implements Field { |
1049 | 1049 | private $info, $tableName; |
1050 | 1050 | |
1051 | + /** |
|
1052 | + * @param string $tableName |
|
1053 | + */ |
|
1051 | 1054 | function __construct( $info, $tableName ) { |
1052 | 1055 | $this->info = $info; |
1053 | 1056 | $this->tableName = $tableName; |
@@ -31,6 +31,9 @@ |
||
31 | 31 | /** @var string */ |
32 | 32 | protected $mData; |
33 | 33 | |
34 | + /** |
|
35 | + * @param string $data |
|
36 | + */ |
|
34 | 37 | function __construct( $data ) { |
35 | 38 | $this->mData = $data; |
36 | 39 | } |
@@ -30,6 +30,9 @@ |
||
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | + /** |
|
34 | + * @param string $name |
|
35 | + */ |
|
33 | 36 | function __call( $name, array $arguments ) { |
34 | 37 | if ( $this->conn === null ) { |
35 | 38 | list( $db, $groups, $wiki ) = $this->params; |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param string|bool $group Query group, or false for the generic reader |
231 | 231 | * @param string|bool $wiki Wiki ID, or false for the current wiki |
232 | 232 | * @throws MWException |
233 | - * @return bool|int|string |
|
233 | + * @return string |
|
234 | 234 | */ |
235 | 235 | public function getReaderIndex( $group = false, $wiki = false ) { |
236 | 236 | global $wgDBtype; |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | * Returns false if there is no connection open |
436 | 436 | * |
437 | 437 | * @param int $i |
438 | - * @return DatabaseBase|bool False on failure |
|
438 | + * @return DatabaseBase|null False on failure |
|
439 | 439 | */ |
440 | 440 | public function getAnyOpenConnection( $i ) { |
441 | 441 | foreach ( $this->mConns as $conns ) { |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | |
969 | 969 | /** |
970 | 970 | * Get the current master position for chronology control purposes |
971 | - * @return mixed |
|
971 | + * @return DBMasterPos |
|
972 | 972 | */ |
973 | 973 | public function getMasterPos() { |
974 | 974 | # If this entire request was served from a slave without opening a connection to the |
@@ -1266,7 +1266,7 @@ discard block |
||
1266 | 1266 | /** |
1267 | 1267 | * Call a function with each open connection object |
1268 | 1268 | * @param callable $callback |
1269 | - * @param array $params |
|
1269 | + * @param string[] $params |
|
1270 | 1270 | */ |
1271 | 1271 | public function forEachOpenConnection( $callback, array $params = array() ) { |
1272 | 1272 | foreach ( $this->mConns as $conns2 ) { |