@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | * NOTE: This ONLY works for getTitleInfo() and isKnownEmpty(), NOT FOR ANYTHING ELSE. |
137 | 137 | * In particular, it doesn't work for getContent() or getScript() etc. |
138 | 138 | * |
139 | - * @return IDatabase|null |
|
139 | + * @return DatabaseBase|null |
|
140 | 140 | */ |
141 | 141 | protected function getDB() { |
142 | 142 | return wfGetDB( DB_REPLICA ); |
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | - * @param string $title |
|
146 | + * @param string $titleText |
|
147 | 147 | * @return null|string |
148 | 148 | */ |
149 | 149 | protected function getContent( $titleText ) { |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | * @since 1.28 |
333 | 333 | * @param ResourceLoaderContext $context |
334 | 334 | * @param IDatabase $db |
335 | - * @param string[] $modules |
|
335 | + * @param string[] $moduleNames |
|
336 | 336 | */ |
337 | 337 | public static function preloadTitleInfo( |
338 | 338 | ResourceLoaderContext $context, IDatabase $db, array $moduleNames |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | /** |
437 | 437 | * Return the list of revision fields that should be selected to create |
438 | 438 | * a new revision. |
439 | - * @return array |
|
439 | + * @return string[] |
|
440 | 440 | */ |
441 | 441 | public static function selectFields() { |
442 | 442 | global $wgContentHandlerUseDB; |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | /** |
468 | 468 | * Return the list of revision fields that should be selected to create |
469 | 469 | * a new revision from an archive row. |
470 | - * @return array |
|
470 | + * @return string[] |
|
471 | 471 | */ |
472 | 472 | public static function selectArchiveFields() { |
473 | 473 | global $wgContentHandlerUseDB; |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | /** |
499 | 499 | * Return the list of text fields that should be selected to read the |
500 | 500 | * revision text |
501 | - * @return array |
|
501 | + * @return string[] |
|
502 | 502 | */ |
503 | 503 | public static function selectTextFields() { |
504 | 504 | return [ |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | |
510 | 510 | /** |
511 | 511 | * Return the list of page fields that should be selected from page table |
512 | - * @return array |
|
512 | + * @return string[] |
|
513 | 513 | */ |
514 | 514 | public static function selectPageFields() { |
515 | 515 | return [ |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | |
525 | 525 | /** |
526 | 526 | * Return the list of user fields that should be selected from user table |
527 | - * @return array |
|
527 | + * @return string[] |
|
528 | 528 | */ |
529 | 529 | public static function selectUserFields() { |
530 | 530 | return [ 'user_name' ]; |
@@ -872,7 +872,7 @@ discard block |
||
872 | 872 | /** |
873 | 873 | * Fetch revision's user id without regard for the current user's permissions |
874 | 874 | * |
875 | - * @return string |
|
875 | + * @return integer |
|
876 | 876 | * @deprecated since 1.25, use getUser( Revision::RAW ) |
877 | 877 | */ |
878 | 878 | public function getRawUser() { |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | * |
1796 | 1796 | * @param Title $title |
1797 | 1797 | * @param int $id |
1798 | - * @return string|bool False if not found |
|
1798 | + * @return string|false False if not found |
|
1799 | 1799 | */ |
1800 | 1800 | static function getTimestampFromId( $title, $id, $flags = 0 ) { |
1801 | 1801 | $db = ( $flags & self::READ_LATEST ) |
@@ -1894,7 +1894,7 @@ discard block |
||
1894 | 1894 | * @param IDatabase $db |
1895 | 1895 | * @param int $pageId Page ID |
1896 | 1896 | * @param int $revId Known current revision of this page |
1897 | - * @return Revision|bool Returns false if missing |
|
1897 | + * @return Revision Returns false if missing |
|
1898 | 1898 | * @since 1.28 |
1899 | 1899 | */ |
1900 | 1900 | public static function newKnownCurrent( IDatabase $db, $pageId, $revId ) { |
@@ -126,16 +126,27 @@ |
||
126 | 126 | return true; |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param string $field |
|
131 | + * @param string $op |
|
132 | + * @param null|IDatabase $dbw |
|
133 | + */ |
|
129 | 134 | private static function buildSetBitDeletedField( $field, $op, $value, $dbw ) { |
130 | 135 | return $field . ' = ' . ( $op === '&' |
131 | 136 | ? $dbw->bitAnd( $field, $value ) |
132 | 137 | : $dbw->bitOr( $field, $value ) ); |
133 | 138 | } |
134 | 139 | |
140 | + /** |
|
141 | + * @param integer $userId |
|
142 | + */ |
|
135 | 143 | public static function suppressUserName( $name, $userId, $dbw = null ) { |
136 | 144 | return self::setUsernameBitfields( $name, $userId, '|', $dbw ); |
137 | 145 | } |
138 | 146 | |
147 | + /** |
|
148 | + * @param integer|null $userId |
|
149 | + */ |
|
139 | 150 | public static function unsuppressUserName( $name, $userId, $dbw = null ) { |
140 | 151 | return self::setUsernameBitfields( $name, $userId, '&', $dbw ); |
141 | 152 | } |
@@ -371,7 +371,7 @@ |
||
371 | 371 | * Do all updates and commit them. More or less a replacement |
372 | 372 | * for the original initStats, but without output. |
373 | 373 | * |
374 | - * @param IDatabase|bool $database |
|
374 | + * @param DatabaseBase|null $database |
|
375 | 375 | * - boolean: Whether to use the master DB |
376 | 376 | * - IDatabase: Database connection to use |
377 | 377 | * @param array $options Array of options, may contain the following values |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | /** |
108 | 108 | * Create a FormOptions object with options as specified by the user |
109 | 109 | * |
110 | - * @param array $parameters |
|
110 | + * @param string $parameters |
|
111 | 111 | * |
112 | 112 | * @return FormOptions |
113 | 113 | */ |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | /** |
338 | 338 | * Return a IDatabase object for reading |
339 | 339 | * |
340 | - * @return IDatabase |
|
340 | + * @return DatabaseBase|null |
|
341 | 341 | */ |
342 | 342 | protected function getDB() { |
343 | 343 | return wfGetDB( DB_REPLICA ); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * Subclasses return an array of fields to order by here. Don't append |
162 | 162 | * DESC to the field names, that'll be done automatically if |
163 | 163 | * sortDescending() returns true. |
164 | - * @return array |
|
164 | + * @return string[] |
|
165 | 165 | * @since 1.18 |
166 | 166 | */ |
167 | 167 | function getOrderFields() { |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | |
374 | 374 | /** |
375 | 375 | * Get a DB connection to be used for slow recache queries |
376 | - * @return IDatabase |
|
376 | + * @return DatabaseBase|null |
|
377 | 377 | */ |
378 | 378 | function getRecacheDB() { |
379 | 379 | return wfGetDB( DB_REPLICA, [ $this->getName(), 'QueryPage::recache', 'vslow' ] ); |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | /** |
435 | 435 | * Somewhat deprecated, you probably want to be using execute() |
436 | 436 | * @param int|bool $offset |
437 | - * @param int|bool $limit |
|
437 | + * @param integer $limit |
|
438 | 438 | * @return ResultWrapper |
439 | 439 | */ |
440 | 440 | public function doQuery( $offset = false, $limit = false ) { |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | /** |
776 | 776 | * Override for custom handling. If the titles/links are ok, just do |
777 | 777 | * feedItemDesc() |
778 | - * @param object $row |
|
778 | + * @param null|stdClass $row |
|
779 | 779 | * @return FeedItem|null |
780 | 780 | */ |
781 | 781 | function feedResult( $row ) { |
@@ -807,6 +807,9 @@ discard block |
||
807 | 807 | return isset( $row->comment ) ? htmlspecialchars( $row->comment ) : ''; |
808 | 808 | } |
809 | 809 | |
810 | + /** |
|
811 | + * @return string |
|
812 | + */ |
|
810 | 813 | function feedItemAuthor( $row ) { |
811 | 814 | return isset( $row->user_text ) ? $row->user_text : ''; |
812 | 815 | } |
@@ -35,6 +35,9 @@ discard block |
||
35 | 35 | */ |
36 | 36 | protected $mNavigationBar; |
37 | 37 | |
38 | + /** |
|
39 | + * @param string|null $target |
|
40 | + */ |
|
38 | 41 | function __construct( IContextSource $context, $target, $namespace = false ) { |
39 | 42 | parent::__construct( $context ); |
40 | 43 | $msgs = [ 'deletionlog', 'undeleteviewlink', 'diff' ]; |
@@ -347,7 +350,7 @@ discard block |
||
347 | 350 | /** |
348 | 351 | * Get the Database object in use |
349 | 352 | * |
350 | - * @return IDatabase |
|
353 | + * @return DatabaseBase|null |
|
351 | 354 | */ |
352 | 355 | public function getDatabase() { |
353 | 356 | return $this->mDb; |
@@ -296,6 +296,9 @@ discard block |
||
296 | 296 | ); |
297 | 297 | } |
298 | 298 | |
299 | + /** |
|
300 | + * @param FormOptions $opts |
|
301 | + */ |
|
299 | 302 | protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, |
300 | 303 | &$join_conds, $opts |
301 | 304 | ) { |
@@ -310,7 +313,7 @@ discard block |
||
310 | 313 | /** |
311 | 314 | * Return a IDatabase object for reading |
312 | 315 | * |
313 | - * @return IDatabase |
|
316 | + * @return DatabaseBase|null |
|
314 | 317 | */ |
315 | 318 | protected function getDB() { |
316 | 319 | return wfGetDB( DB_REPLICA, 'watchlist' ); |
@@ -534,6 +537,9 @@ discard block |
||
534 | 537 | $this->setBottomText( $opts ); |
535 | 538 | } |
536 | 539 | |
540 | + /** |
|
541 | + * @param FormOptions $options |
|
542 | + */ |
|
537 | 543 | function cutoffselector( $options ) { |
538 | 544 | // Cast everything to strings immediately, so that we know all of the values have the same |
539 | 545 | // precision, and can be compared with '==='. 2/24 has a few more decimal places than its |
@@ -648,7 +654,7 @@ discard block |
||
648 | 654 | * The assumption made here is that when a subject page is watched a talk page is also watched. |
649 | 655 | * Hence the number of individual items is halved. |
650 | 656 | * |
651 | - * @return int |
|
657 | + * @return double |
|
652 | 658 | */ |
653 | 659 | protected function countItems() { |
654 | 660 | $store = MediaWikiServices::getInstance()->getWatchedItemStore(); |
@@ -117,10 +117,16 @@ |
||
117 | 117 | return $this->repo->getRootDirectory() . '/' . $this->repo->getHashPath( $name ) . $name; |
118 | 118 | } |
119 | 119 | |
120 | + /** |
|
121 | + * @param Database|null $db |
|
122 | + */ |
|
120 | 123 | private function imageExists( $name, $db ) { |
121 | 124 | return $db->selectField( 'image', '1', [ 'img_name' => $name ], __METHOD__ ); |
122 | 125 | } |
123 | 126 | |
127 | + /** |
|
128 | + * @param Database|null $db |
|
129 | + */ |
|
124 | 130 | private function pageExists( $name, $db ) { |
125 | 131 | return $db->selectField( |
126 | 132 | 'page', |