@@ -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 = ''; |
@@ -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 ); |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | * |
422 | 422 | * @since 1.24 |
423 | 423 | * @param array $params All supplied parameters for the module |
424 | - * @return string|array|null |
|
424 | + * @return string |
|
425 | 425 | */ |
426 | 426 | protected function getWebUITokenSalt( array $params ) { |
427 | 427 | return null; |
@@ -627,6 +627,7 @@ discard block |
||
627 | 627 | /** |
628 | 628 | * Set the continuation manager |
629 | 629 | * @param ApiContinuationManager|null |
630 | + * @param ApiContinuationManager|null $manager |
|
630 | 631 | */ |
631 | 632 | public function setContinuationManager( $manager ) { |
632 | 633 | // Main module has setContinuationManager() method overridden |
@@ -710,6 +711,7 @@ discard block |
||
710 | 711 | * |
711 | 712 | * @param array $params User provided set of parameters, as from $this->extractRequestParams() |
712 | 713 | * @param string $required,... Names of parameters of which exactly one must be set |
714 | + * @param string $required |
|
713 | 715 | */ |
714 | 716 | public function requireOnlyOneParameter( $params, $required /*...*/ ) { |
715 | 717 | $required = func_get_args(); |
@@ -736,6 +738,7 @@ discard block |
||
736 | 738 | * |
737 | 739 | * @param array $params User provided set of parameters, as from $this->extractRequestParams() |
738 | 740 | * @param string $required,... Names of parameters of which at most one must be set |
741 | + * @param string $required |
|
739 | 742 | */ |
740 | 743 | public function requireMaxOneParameter( $params, $required /*...*/ ) { |
741 | 744 | $required = func_get_args(); |
@@ -759,6 +762,7 @@ discard block |
||
759 | 762 | * @since 1.23 |
760 | 763 | * @param array $params User provided set of parameters, as from $this->extractRequestParams() |
761 | 764 | * @param string $required,... Names of parameters of which at least one must be set |
765 | + * @param string $required |
|
762 | 766 | */ |
763 | 767 | public function requireAtLeastOneParameter( $params, $required /*...*/ ) { |
764 | 768 | $required = func_get_args(); |
@@ -1431,7 +1435,7 @@ discard block |
||
1431 | 1435 | |
1432 | 1436 | /** |
1433 | 1437 | * Truncate an array to a certain length. |
1434 | - * @param array $arr Array to truncate |
|
1438 | + * @param string[] $arr Array to truncate |
|
1435 | 1439 | * @param int $limit Maximum length |
1436 | 1440 | * @return bool True if the array was truncated, false otherwise |
1437 | 1441 | */ |
@@ -2638,7 +2642,7 @@ discard block |
||
2638 | 2642 | * "apihelp-{$this->getModulePath()}-description". |
2639 | 2643 | * |
2640 | 2644 | * @deprecated since 1.25 |
2641 | - * @return Message|string|array |
|
2645 | + * @return boolean |
|
2642 | 2646 | */ |
2643 | 2647 | protected function getDescription() { |
2644 | 2648 | return false; |
@@ -2715,7 +2719,7 @@ discard block |
||
2715 | 2719 | |
2716 | 2720 | /** |
2717 | 2721 | * @deprecated since 1.25, always returns 0 |
2718 | - * @return float |
|
2722 | + * @return integer |
|
2719 | 2723 | */ |
2720 | 2724 | public function getProfileTime() { |
2721 | 2725 | wfDeprecated( __METHOD__, '1.25' ); |
@@ -2738,7 +2742,7 @@ discard block |
||
2738 | 2742 | |
2739 | 2743 | /** |
2740 | 2744 | * @deprecated since 1.25, always returns 0 |
2741 | - * @return float |
|
2745 | + * @return integer |
|
2742 | 2746 | */ |
2743 | 2747 | public function getProfileDBTime() { |
2744 | 2748 | wfDeprecated( __METHOD__, '1.25' ); |
@@ -192,7 +192,7 @@ |
||
192 | 192 | /** |
193 | 193 | * Get an explanatory message if this backend is read-only |
194 | 194 | * |
195 | - * @return string|bool Returns false if the backend is not read-only |
|
195 | + * @return string|false Returns false if the backend is not read-only |
|
196 | 196 | */ |
197 | 197 | final public function getReadOnlyReason() { |
198 | 198 | return ( $this->readOnly != '' ) ? $this->readOnly : false; |
@@ -491,7 +491,7 @@ |
||
491 | 491 | * <exif:DigitalZoomRatio>0/10</exif:DigitalZoomRatio> |
492 | 492 | * and are processing the 0/10 bit. |
493 | 493 | * |
494 | - * @param XMLParser $parser XMLParser reference to the xml parser |
|
494 | + * @param resource $parser XMLParser reference to the xml parser |
|
495 | 495 | * @param string $data Character data |
496 | 496 | * @throws RuntimeException On invalid data |
497 | 497 | */ |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | protected $repoClass = 'ForeignApiRepo'; |
37 | 37 | |
38 | 38 | /** |
39 | - * @param Title|string|bool $title |
|
39 | + * @param Title|null $title |
|
40 | 40 | * @param ForeignApiRepo $repo |
41 | 41 | * @param array $info |
42 | 42 | * @param bool $exists |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * @return bool|null|string |
|
172 | + * @return string|null |
|
173 | 173 | */ |
174 | 174 | public function getMetadata() { |
175 | 175 | if ( isset( $this->mInfo['metadata'] ) ) { |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | - * @return bool|int|null |
|
211 | + * @return integer|null |
|
212 | 212 | */ |
213 | 213 | public function getSize() { |
214 | 214 | return isset( $this->mInfo['size'] ) ? intval( $this->mInfo['size'] ) : null; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | |
273 | 273 | /** |
274 | - * @return bool|string |
|
274 | + * @return false|string |
|
275 | 275 | */ |
276 | 276 | function getTimestamp() { |
277 | 277 | return wfTimestamp( TS_MW, |
@@ -234,7 +234,6 @@ discard block |
||
234 | 234 | * [ 'y' ] |
235 | 235 | * ] |
236 | 236 | * |
237 | - * @param array $array1,... |
|
238 | 237 | * @return array |
239 | 238 | */ |
240 | 239 | function wfMergeErrorArrays( /*...*/ ) { |
@@ -261,8 +260,8 @@ discard block |
||
261 | 260 | * |
262 | 261 | * @param array $array The array. |
263 | 262 | * @param array $insert The array to insert. |
264 | - * @param mixed $after The key to insert after |
|
265 | - * @return array |
|
263 | + * @param string $after The key to insert after |
|
264 | + * @return string[] |
|
266 | 265 | */ |
267 | 266 | function wfArrayInsertAfter( array $array, array $insert, $after ) { |
268 | 267 | // Find the offset of the element to insert after. |
@@ -1301,7 +1300,7 @@ discard block |
||
1301 | 1300 | /** |
1302 | 1301 | * Get the value of $wgReadOnly or the contents of $wgReadOnlyFile. |
1303 | 1302 | * |
1304 | - * @return string|bool String when in read-only mode; false otherwise |
|
1303 | + * @return string|false String when in read-only mode; false otherwise |
|
1305 | 1304 | * @since 1.27 |
1306 | 1305 | */ |
1307 | 1306 | function wfConfiguredReadOnlyReason() { |
@@ -1376,7 +1375,6 @@ discard block |
||
1376 | 1375 | * This function replaces all old wfMsg* functions. |
1377 | 1376 | * |
1378 | 1377 | * @param string|string[]|MessageSpecifier $key Message key, or array of keys, or a MessageSpecifier |
1379 | - * @param mixed $params,... Normal message parameters |
|
1380 | 1378 | * @return Message |
1381 | 1379 | * |
1382 | 1380 | * @since 1.17 |
@@ -1397,7 +1395,6 @@ discard block |
||
1397 | 1395 | * for the first message which is non-empty. If all messages are empty then an |
1398 | 1396 | * instance of the first message key is returned. |
1399 | 1397 | * |
1400 | - * @param string|string[] $keys,... Message keys |
|
1401 | 1398 | * @return Message |
1402 | 1399 | * |
1403 | 1400 | * @since 1.18 |
@@ -1628,7 +1625,7 @@ discard block |
||
1628 | 1625 | * @todo FIXME: We may want to blacklist some broken browsers |
1629 | 1626 | * |
1630 | 1627 | * @param bool $force |
1631 | - * @return bool Whereas client accept gzip compression |
|
1628 | + * @return null|boolean Whereas client accept gzip compression |
|
1632 | 1629 | */ |
1633 | 1630 | function wfClientAcceptsGzip( $force = false ) { |
1634 | 1631 | static $result = null; |
@@ -1716,7 +1713,7 @@ discard block |
||
1716 | 1713 | * @param mixed $dest |
1717 | 1714 | * @param mixed $source |
1718 | 1715 | * @param bool $force |
1719 | - * @return mixed |
|
1716 | + * @return string |
|
1720 | 1717 | */ |
1721 | 1718 | function wfSetVar( &$dest, $source, $force = false ) { |
1722 | 1719 | $temp = $dest; |
@@ -1766,7 +1763,7 @@ discard block |
||
1766 | 1763 | /** |
1767 | 1764 | * Provide a simple HTTP error. |
1768 | 1765 | * |
1769 | - * @param int|string $code |
|
1766 | + * @param integer $code |
|
1770 | 1767 | * @param string $label |
1771 | 1768 | * @param string $desc |
1772 | 1769 | */ |
@@ -1999,8 +1996,8 @@ discard block |
||
1999 | 1996 | * |
2000 | 1997 | * @param mixed $outputtype A timestamp in one of the supported formats, the |
2001 | 1998 | * function will autodetect which format is supplied and act accordingly. |
2002 | - * @param mixed $ts Optional timestamp to convert, default 0 for the current time |
|
2003 | - * @return string|bool String / false The same date in the format specified in $outputtype or false |
|
1999 | + * @param integer $ts Optional timestamp to convert, default 0 for the current time |
|
2000 | + * @return false|string String / false The same date in the format specified in $outputtype or false |
|
2004 | 2001 | */ |
2005 | 2002 | function wfTimestamp( $outputtype = TS_UNIX, $ts = 0 ) { |
2006 | 2003 | $ret = MWTimestamp::convert( $outputtype, $ts ); |
@@ -2039,7 +2036,7 @@ discard block |
||
2039 | 2036 | /** |
2040 | 2037 | * Check if the operating system is Windows |
2041 | 2038 | * |
2042 | - * @return bool True if it's Windows, false otherwise. |
|
2039 | + * @return boolean|null True if it's Windows, false otherwise. |
|
2043 | 2040 | */ |
2044 | 2041 | function wfIsWindows() { |
2045 | 2042 | static $isWindows = null; |
@@ -2268,7 +2265,7 @@ discard block |
||
2268 | 2265 | /** |
2269 | 2266 | * Check if wfShellExec() is effectively disabled via php.ini config |
2270 | 2267 | * |
2271 | - * @return bool|string False or 'disabled' |
|
2268 | + * @return string|false False or 'disabled' |
|
2272 | 2269 | * @since 1.22 |
2273 | 2270 | */ |
2274 | 2271 | function wfShellExecDisabled() { |
@@ -2882,7 +2879,7 @@ discard block |
||
2882 | 2879 | * @param int $pad Minimum number of digits in the output (pad with zeroes) |
2883 | 2880 | * @param bool $lowercase Whether to output in lowercase or uppercase |
2884 | 2881 | * @param string $engine Either "gmp", "bcmath", or "php" |
2885 | - * @return string|bool The output number as a string, or false on error |
|
2882 | + * @return false|string The output number as a string, or false on error |
|
2886 | 2883 | */ |
2887 | 2884 | function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1, |
2888 | 2885 | $lowercase = true, $engine = 'auto' |
@@ -2967,7 +2964,6 @@ discard block |
||
2967 | 2964 | /** |
2968 | 2965 | * Make a cache key for the local wiki. |
2969 | 2966 | * |
2970 | - * @param string $args,... |
|
2971 | 2967 | * @return string |
2972 | 2968 | */ |
2973 | 2969 | function wfMemcKey( /*...*/ ) { |
@@ -2984,7 +2980,6 @@ discard block |
||
2984 | 2980 | * |
2985 | 2981 | * @param string $db |
2986 | 2982 | * @param string $prefix |
2987 | - * @param string $args,... |
|
2988 | 2983 | * @return string |
2989 | 2984 | */ |
2990 | 2985 | function wfForeignMemcKey( $db, $prefix /*...*/ ) { |
@@ -3004,7 +2999,6 @@ discard block |
||
3004 | 2999 | * in the first segment will clash with wfMemcKey/wfForeignMemcKey. |
3005 | 3000 | * |
3006 | 3001 | * @since 1.26 |
3007 | - * @param string $args,... |
|
3008 | 3002 | * @return string |
3009 | 3003 | */ |
3010 | 3004 | function wfGlobalCacheKey( /*...*/ ) { |
@@ -3119,7 +3113,7 @@ discard block |
||
3119 | 3113 | * Returns a valid placeholder object if the file does not exist. |
3120 | 3114 | * |
3121 | 3115 | * @param Title|string $title |
3122 | - * @return LocalFile|null A File, or null if passed an invalid Title |
|
3116 | + * @return File|null A File, or null if passed an invalid Title |
|
3123 | 3117 | */ |
3124 | 3118 | function wfLocalFile( $title ) { |
3125 | 3119 | return RepoGroup::singleton()->getLocalRepo()->newFile( $title ); |
@@ -3324,7 +3318,7 @@ discard block |
||
3324 | 3318 | /** |
3325 | 3319 | * Set PHP's time limit to the larger of php.ini or $wgTransactionalTimeLimit |
3326 | 3320 | * |
3327 | - * @return int Prior time limit |
|
3321 | + * @return string Prior time limit |
|
3328 | 3322 | * @since 1.26 |
3329 | 3323 | */ |
3330 | 3324 | function wfTransactionalTimeLimit() { |
@@ -3460,7 +3454,7 @@ discard block |
||
3460 | 3454 | * |
3461 | 3455 | * @param string $format The format string (See php's docs) |
3462 | 3456 | * @param string $data A binary string of binary data |
3463 | - * @param int|bool $length The minimum length of $data or false. This is to |
|
3457 | + * @param integer $length The minimum length of $data or false. This is to |
|
3464 | 3458 | * prevent reading beyond the end of $data. false to disable the check. |
3465 | 3459 | * |
3466 | 3460 | * Also be careful when using this function to read unsigned 32 bit integer |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | * |
300 | 300 | * @param string $host |
301 | 301 | * @param int $port |
302 | - * @param bool|int $defaultPort |
|
302 | + * @param integer $defaultPort |
|
303 | 303 | * @return string |
304 | 304 | */ |
305 | 305 | public static function combineHostAndPort( $host, $port, $defaultPort = false ) { |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | * hexadecimal string which sorts after the IPv4 addresses. |
403 | 403 | * |
404 | 404 | * @param string $ip Quad dotted/octet IP address. |
405 | - * @return string|bool False on failure |
|
405 | + * @return string|false False on failure |
|
406 | 406 | */ |
407 | 407 | public static function toHex( $ip ) { |
408 | 408 | if ( self::isIPv6( $ip ) ) { |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | * Given an IPv6 address in octet notation, returns a pure hex string. |
436 | 436 | * |
437 | 437 | * @param string $ip Octet ipv6 IP address. |
438 | - * @return string|bool Pure hex (uppercase); false on failure |
|
438 | + * @return false|string Pure hex (uppercase); false on failure |
|
439 | 439 | */ |
440 | 440 | private static function IPv6ToRawHex( $ip ) { |
441 | 441 | $ip = self::sanitizeIP( $ip ); |
@@ -35,6 +35,7 @@ |
||
35 | 35 | * The sample rate specified in a StatsdData entity overrides the sample rate specified here. |
36 | 36 | * |
37 | 37 | * {@inheritDoc} |
38 | + * @return StatsdDataInterface[] |
|
38 | 39 | */ |
39 | 40 | public function appendSampleRate( $data, $sampleRate = 1 ) { |
40 | 41 | if ( $sampleRate < 1 ) { |