@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * Borrows Recent Changes' feed generation functions for formatting; |
| 318 | 318 | * includes a diff to the previous revision (if any). |
| 319 | 319 | * |
| 320 | - * @param stdClass|array $row Database row |
|
| 320 | + * @param null|stdClass $row Database row |
|
| 321 | 321 | * @return FeedItem |
| 322 | 322 | */ |
| 323 | 323 | function feedItem( $row ) { |
@@ -534,6 +534,10 @@ discard block |
||
| 534 | 534 | return $s; |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | + /** |
|
| 538 | + * @param string $name |
|
| 539 | + * @param string $msg |
|
| 540 | + */ |
|
| 537 | 541 | private function getRevisionButton( $name, $msg ) { |
| 538 | 542 | $this->preventClickjacking(); |
| 539 | 543 | # Note bug #20966, <button> is non-standard in IE<8 |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * @param Exception|Throwable $e Original exception |
| 32 | 32 | * @param integer $mode MWExceptionExposer::AS_* constant |
| 33 | - * @param Exception|Throwable|null $eNew New exception from attempting to show the first |
|
| 33 | + * @param Exception $eNew New exception from attempting to show the first |
|
| 34 | 34 | */ |
| 35 | 35 | public static function output( $e, $mode, $eNew = null ) { |
| 36 | 36 | global $wgMimeType; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
| 327 | - * @param Exception|Throwable $e |
|
| 327 | + * @param DBConnectionError $e |
|
| 328 | 328 | */ |
| 329 | 329 | private static function reportOutageHTML( $e ) { |
| 330 | 330 | global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors; |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | /** |
| 817 | 817 | * Get the position of the master from SHOW SLAVE STATUS |
| 818 | 818 | * |
| 819 | - * @return MySQLMasterPos|bool |
|
| 819 | + * @return DBMasterPos |
|
| 820 | 820 | */ |
| 821 | 821 | function getSlavePos() { |
| 822 | 822 | $res = $this->query( 'SHOW SLAVE STATUS', __METHOD__ ); |
@@ -1012,6 +1012,9 @@ discard block |
||
| 1012 | 1012 | return false; |
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | + /** |
|
| 1016 | + * @param string $lockName |
|
| 1017 | + */ |
|
| 1015 | 1018 | private function makeLockName( $lockName ) { |
| 1016 | 1019 | // http://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_get-lock |
| 1017 | 1020 | // Newer version enforce a 64 char length limit. |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | - * @return stdClass|array|bool |
|
| 125 | + * @return null|stdClass |
|
| 126 | 126 | */ |
| 127 | 127 | function current() { |
| 128 | 128 | if ( is_null( $this->currentRow ) ) { |
@@ -59,6 +59,9 @@ discard block |
||
| 59 | 59 | return false; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $name |
|
| 64 | + */ |
|
| 62 | 65 | function hasConstraint( $name ) { |
| 63 | 66 | $sql = "SELECT 1 FROM pg_catalog.pg_constraint c, pg_catalog.pg_namespace n " . |
| 64 | 67 | "WHERE c.connamespace = n.oid AND conname = '" . |
@@ -1109,6 +1112,10 @@ discard block |
||
| 1109 | 1112 | return $this->relationExists( $sequence, 'S', $schema ); |
| 1110 | 1113 | } |
| 1111 | 1114 | |
| 1115 | + /** |
|
| 1116 | + * @param string $table |
|
| 1117 | + * @param string $trigger |
|
| 1118 | + */ |
|
| 1112 | 1119 | function triggerExists( $table, $trigger ) { |
| 1113 | 1120 | $q = <<<SQL |
| 1114 | 1121 | SELECT 1 FROM pg_class, pg_namespace, pg_trigger |
@@ -1132,6 +1139,10 @@ discard block |
||
| 1132 | 1139 | return $rows; |
| 1133 | 1140 | } |
| 1134 | 1141 | |
| 1142 | + /** |
|
| 1143 | + * @param string $table |
|
| 1144 | + * @param string $rule |
|
| 1145 | + */ |
|
| 1135 | 1146 | function ruleExists( $table, $rule ) { |
| 1136 | 1147 | $exists = $this->selectField( 'pg_rules', 'rulename', |
| 1137 | 1148 | [ |
@@ -1279,7 +1290,7 @@ discard block |
||
| 1279 | 1290 | * |
| 1280 | 1291 | * @param array $options An associative array of options to be turned into |
| 1281 | 1292 | * an SQL query, valid keys are listed in the function. |
| 1282 | - * @return array |
|
| 1293 | + * @return string[] |
|
| 1283 | 1294 | */ |
| 1284 | 1295 | function makeSelectOptions( $options ) { |
| 1285 | 1296 | $preLimitTail = $postLimitTail = ''; |
@@ -84,21 +84,6 @@ |
||
| 84 | 84 | * |
| 85 | 85 | * Sub-classes will extend the required keys in $conf with additional parameters |
| 86 | 86 | * |
| 87 | - * @param $conf $params Array with keys: |
|
| 88 | - * - localDomain: A DatabaseDomain or domain ID string. |
|
| 89 | - * - readOnlyReason : Reason the master DB is read-only if so [optional] |
|
| 90 | - * - srvCache : BagOStuff object for server cache [optional] |
|
| 91 | - * - memCache : BagOStuff object for cluster memory cache [optional] |
|
| 92 | - * - wanCache : WANObjectCache object [optional] |
|
| 93 | - * - hostname : The name of the current server [optional] |
|
| 94 | - * - cliMode: Whether the execution context is a CLI script. [optional] |
|
| 95 | - * - profiler : Class name or instance with profileIn()/profileOut() methods. [optional] |
|
| 96 | - * - trxProfiler: TransactionProfiler instance. [optional] |
|
| 97 | - * - replLogger: PSR-3 logger instance. [optional] |
|
| 98 | - * - connLogger: PSR-3 logger instance. [optional] |
|
| 99 | - * - queryLogger: PSR-3 logger instance. [optional] |
|
| 100 | - * - perfLogger: PSR-3 logger instance. [optional] |
|
| 101 | - * - errorLogger : Callback that takes an Exception and logs it. [optional] |
|
| 102 | 87 | * @throws InvalidArgumentException |
| 103 | 88 | */ |
| 104 | 89 | public function __construct( array $conf ) { |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | * objects or LinkCache entries. Uses $wgContentHandlerUseDB to determine |
| 366 | 366 | * whether to include page_content_model. |
| 367 | 367 | * |
| 368 | - * @return array |
|
| 368 | + * @return string[] |
|
| 369 | 369 | */ |
| 370 | 370 | protected static function getSelectFields() { |
| 371 | 371 | global $wgContentHandlerUseDB, $wgPageLanguageUseDB; |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | * Get the prefixed DB key associated with an ID |
| 559 | 559 | * |
| 560 | 560 | * @param int $id The page_id of the article |
| 561 | - * @return Title|null An object representing the article, or null if no such article was found |
|
| 561 | + * @return null|string An object representing the article, or null if no such article was found |
|
| 562 | 562 | */ |
| 563 | 563 | public static function nameOf( $id ) { |
| 564 | 564 | $dbr = wfGetDB( DB_REPLICA ); |
@@ -1079,7 +1079,6 @@ discard block |
||
| 1079 | 1079 | /** |
| 1080 | 1080 | * Returns true if the title is inside one of the specified namespaces. |
| 1081 | 1081 | * |
| 1082 | - * @param int|int[] $namespaces,... The namespaces to check for |
|
| 1083 | 1082 | * @return bool |
| 1084 | 1083 | * @since 1.19 |
| 1085 | 1084 | */ |
@@ -1889,7 +1888,7 @@ discard block |
||
| 1889 | 1888 | * - quick : does cheap permission checks from replica DBs (usable for GUI creation) |
| 1890 | 1889 | * - full : does cheap and expensive checks possibly from a replica DB |
| 1891 | 1890 | * - secure : does cheap and expensive checks, using the master as needed |
| 1892 | - * @param array $ignoreErrors Array of Strings Set this to a list of message keys |
|
| 1891 | + * @param string[] $ignoreErrors Array of Strings Set this to a list of message keys |
|
| 1893 | 1892 | * whose corresponding errors may be ignored. |
| 1894 | 1893 | * @return array Array of arrays of the arguments to wfMessage to explain permissions problems. |
| 1895 | 1894 | */ |
@@ -1990,7 +1989,7 @@ discard block |
||
| 1990 | 1989 | * Add the resulting error code to the errors array |
| 1991 | 1990 | * |
| 1992 | 1991 | * @param array $errors List of current errors |
| 1993 | - * @param array $result Result of errors |
|
| 1992 | + * @param string $result Result of errors |
|
| 1994 | 1993 | * |
| 1995 | 1994 | * @return array List of errors |
| 1996 | 1995 | */ |
@@ -2385,7 +2384,7 @@ discard block |
||
| 2385 | 2384 | * |
| 2386 | 2385 | * @param string $action The action to check |
| 2387 | 2386 | * @param bool $short Short circuit on first error |
| 2388 | - * @return array List of errors |
|
| 2387 | + * @return string[] List of errors |
|
| 2389 | 2388 | */ |
| 2390 | 2389 | private function missingPermissionError( $action, $short ) { |
| 2391 | 2390 | // We avoid expensive display logic for quickUserCan's and such |
@@ -3925,7 +3924,7 @@ discard block |
||
| 3925 | 3924 | * |
| 3926 | 3925 | * @param int $revId Revision ID. Get the revision that was before this one. |
| 3927 | 3926 | * @param int $flags Title::GAID_FOR_UPDATE |
| 3928 | - * @return int|bool Old revision ID, or false if none exists |
|
| 3927 | + * @return integer Old revision ID, or false if none exists |
|
| 3929 | 3928 | */ |
| 3930 | 3929 | public function getPreviousRevisionID( $revId, $flags = 0 ) { |
| 3931 | 3930 | $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA ); |
@@ -4065,8 +4064,8 @@ discard block |
||
| 4065 | 4064 | * Get the number of revisions between the given revision. |
| 4066 | 4065 | * Used for diffs and other things that really need it. |
| 4067 | 4066 | * |
| 4068 | - * @param int|Revision $old Old revision or rev ID (first before range) |
|
| 4069 | - * @param int|Revision $new New revision or rev ID (first after range) |
|
| 4067 | + * @param Revision $old Old revision or rev ID (first before range) |
|
| 4068 | + * @param Revision $new New revision or rev ID (first after range) |
|
| 4070 | 4069 | * @param int|null $max Limit of Revisions to count, will be incremented to detect truncations |
| 4071 | 4070 | * @return int Number of revisions between these revisions. |
| 4072 | 4071 | */ |
@@ -4178,9 +4177,9 @@ discard block |
||
| 4178 | 4177 | * Used for diffs and other things that really need it. |
| 4179 | 4178 | * |
| 4180 | 4179 | * @param int|Revision $old Old revision or rev ID (first before range by default) |
| 4181 | - * @param int|Revision $new New revision or rev ID (first after range by default) |
|
| 4180 | + * @param Revision $new New revision or rev ID (first after range by default) |
|
| 4182 | 4181 | * @param int $limit Maximum number of authors |
| 4183 | - * @param string|array $options (Optional): Single option, or an array of options: |
|
| 4182 | + * @param string $options (Optional): Single option, or an array of options: |
|
| 4184 | 4183 | * 'include_old' Include $old in the range; $new is excluded. |
| 4185 | 4184 | * 'include_new' Include $new in the range; $old is excluded. |
| 4186 | 4185 | * 'include_both' Include both $old and $new in the range. |
@@ -4336,7 +4335,7 @@ discard block |
||
| 4336 | 4335 | /** |
| 4337 | 4336 | * Get the default message text or false if the message doesn't exist |
| 4338 | 4337 | * |
| 4339 | - * @return string|bool |
|
| 4338 | + * @return false|string |
|
| 4340 | 4339 | */ |
| 4341 | 4340 | public function getDefaultMessageText() { |
| 4342 | 4341 | global $wgContLang; |
@@ -4784,7 +4783,7 @@ discard block |
||
| 4784 | 4783 | } |
| 4785 | 4784 | |
| 4786 | 4785 | /** |
| 4787 | - * @return array |
|
| 4786 | + * @return string[] |
|
| 4788 | 4787 | */ |
| 4789 | 4788 | public function __sleep() { |
| 4790 | 4789 | return [ |
@@ -143,6 +143,9 @@ |
||
| 143 | 143 | wfWaitForSlaves(); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | + /** |
|
| 147 | + * @param boolean $dieOnError |
|
| 148 | + */ |
|
| 146 | 149 | protected function sqlDoQuery( IDatabase $db, $line, $dieOnError ) { |
| 147 | 150 | try { |
| 148 | 151 | $res = $db->query( $line ); |