@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | /** |
219 | 219 | * Show the main upload form |
220 | 220 | * |
221 | - * @param HTMLForm|string $form An HTMLForm instance or HTML string to show |
|
221 | + * @param UploadForm $form An HTMLForm instance or HTML string to show |
|
222 | 222 | */ |
223 | 223 | protected function showUploadForm( $form ) { |
224 | 224 | # Add links if file was previously deleted |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | * |
602 | 602 | * Note that the page target can be changed *on the form*, so our check |
603 | 603 | * state can get out of sync. |
604 | - * @return bool|string |
|
604 | + * @return boolean |
|
605 | 605 | */ |
606 | 606 | protected function getWatchCheck() { |
607 | 607 | if ( $this->getUser()->getOption( 'watchdefault' ) ) { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * Most subclasses will want to call assertRepoDefined() here. |
161 | 161 | * |
162 | 162 | * @param Title|string|bool $title |
163 | - * @param FileRepo|bool $repo |
|
163 | + * @param FileRepo $repo |
|
164 | 164 | */ |
165 | 165 | function __construct( $title, $repo ) { |
166 | 166 | // Some subclasses do not use $title, but set name/title some other way |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | * Most callers don't check the return value, but ForeignAPIFile::getPath |
412 | 412 | * returns false. |
413 | 413 | * |
414 | - * @return string|bool ForeignAPIFile::getPath can return false |
|
414 | + * @return string ForeignAPIFile::getPath can return false |
|
415 | 415 | */ |
416 | 416 | public function getPath() { |
417 | 417 | if ( !isset( $this->path ) ) { |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | * Overridden by LocalFile, UnregisteredLocalFile |
458 | 458 | * |
459 | 459 | * @param int $page |
460 | - * @return int|bool |
|
460 | + * @return boolean |
|
461 | 461 | */ |
462 | 462 | public function getWidth( $page = 1 ) { |
463 | 463 | return false; |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | * Overridden by LocalFile, UnregisteredLocalFile |
472 | 472 | * |
473 | 473 | * @param int $page |
474 | - * @return bool|int False on failure |
|
474 | + * @return boolean False on failure |
|
475 | 475 | */ |
476 | 476 | public function getHeight( $page = 1 ) { |
477 | 477 | return false; |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | * |
485 | 485 | * @param int $desiredWidth |
486 | 486 | * @param int $page |
487 | - * @return bool|int |
|
487 | + * @return integer |
|
488 | 488 | */ |
489 | 489 | public function getThumbnailBucket( $desiredWidth, $page = 1 ) { |
490 | 490 | global $wgThumbnailBuckets, $wgThumbnailMinimumBucketDistance; |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * Get handler-specific metadata |
634 | 634 | * Overridden by LocalFile, UnregisteredLocalFile |
635 | 635 | * STUB |
636 | - * @return bool|array |
|
636 | + * @return boolean |
|
637 | 637 | */ |
638 | 638 | public function getMetadata() { |
639 | 639 | return false; |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | /** |
643 | 643 | * Like getMetadata but returns a handler independent array of common values. |
644 | 644 | * @see MediaHandler::getCommonMetaArray() |
645 | - * @return array|bool Array or false if not supported |
|
645 | + * @return boolean Array or false if not supported |
|
646 | 646 | * @since 1.23 |
647 | 647 | */ |
648 | 648 | public function getCommonMetaArray() { |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | * |
661 | 661 | * @param array|string $metadata Array or string of (serialized) metadata |
662 | 662 | * @param int $version Version number. |
663 | - * @return array Array containing metadata, or what was passed to it on fail |
|
663 | + * @return ApiResult Array containing metadata, or what was passed to it on fail |
|
664 | 664 | * (unserializing if not array) |
665 | 665 | */ |
666 | 666 | public function convertMetadataVersion( $metadata, $version ) { |
@@ -1359,7 +1359,7 @@ discard block |
||
1359 | 1359 | /** |
1360 | 1360 | * Get a MediaHandler instance for this file |
1361 | 1361 | * |
1362 | - * @return MediaHandler|bool Registered MediaHandler for file's MIME type |
|
1362 | + * @return MediaHandler Registered MediaHandler for file's MIME type |
|
1363 | 1363 | * or false if none found |
1364 | 1364 | */ |
1365 | 1365 | function getHandler() { |
@@ -1782,7 +1782,7 @@ discard block |
||
1782 | 1782 | * @param bool $watch |
1783 | 1783 | * @param string|bool $timestamp |
1784 | 1784 | * @param null|User $user User object or null to use $wgUser |
1785 | - * @return bool |
|
1785 | + * @return boolean|null |
|
1786 | 1786 | * @throws MWException |
1787 | 1787 | */ |
1788 | 1788 | function recordUpload( $oldver, $desc, $license = '', $copyStatus = '', $source = '', |
@@ -1817,7 +1817,7 @@ discard block |
||
1817 | 1817 | } |
1818 | 1818 | |
1819 | 1819 | /** |
1820 | - * @param bool|IContextSource $context Context to use (optional) |
|
1820 | + * @param IContextSource $context Context to use (optional) |
|
1821 | 1821 | * @return bool |
1822 | 1822 | */ |
1823 | 1823 | function formatMetadata( $context = false ) { |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | * Returns the number of pages of a multipage document, or false for |
1965 | 1965 | * documents which aren't multipage documents |
1966 | 1966 | * |
1967 | - * @return bool|int |
|
1967 | + * @return string|boolean |
|
1968 | 1968 | */ |
1969 | 1969 | function pageCount() { |
1970 | 1970 | if ( !isset( $this->pageCount ) ) { |
@@ -2031,7 +2031,7 @@ discard block |
||
2031 | 2031 | /** |
2032 | 2032 | * Get the HTML text of the description page, if available |
2033 | 2033 | * |
2034 | - * @param bool|Language $lang Optional language to fetch description in |
|
2034 | + * @param Language $lang Optional language to fetch description in |
|
2035 | 2035 | * @return string |
2036 | 2036 | */ |
2037 | 2037 | function getDescriptionText( $lang = false ) { |
@@ -2103,7 +2103,7 @@ discard block |
||
2103 | 2103 | * Returns false if the file does not have a description page, or retrieving the timestamp |
2104 | 2104 | * would be expensive. |
2105 | 2105 | * @since 1.25 |
2106 | - * @return string|bool |
|
2106 | + * @return boolean |
|
2107 | 2107 | */ |
2108 | 2108 | public function getDescriptionTouched() { |
2109 | 2109 | return false; |
@@ -1356,7 +1356,7 @@ |
||
1356 | 1356 | * @since 1.18 |
1357 | 1357 | * |
1358 | 1358 | * @param string $key |
1359 | - * @param mixed $value |
|
1359 | + * @param string $value |
|
1360 | 1360 | */ |
1361 | 1361 | public function setExtraParam( $key, $value ) { |
1362 | 1362 | $this->extraParams[$key] = $value; |
@@ -1275,7 +1275,7 @@ discard block |
||
1275 | 1275 | * @param string|null $wikiId Id (as used by WikiMap) of the wiki to generate links to. |
1276 | 1276 | * For use with external changes. |
1277 | 1277 | * |
1278 | - * @return mixed|string |
|
1278 | + * @return string |
|
1279 | 1279 | */ |
1280 | 1280 | public static function formatComment( |
1281 | 1281 | $comment, $title = null, $local = false, $wikiId = null |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | * Split a link trail, return the "inside" portion and the remainder of the trail |
1804 | 1804 | * as a two-element array |
1805 | 1805 | * @param string $trail |
1806 | - * @return array |
|
1806 | + * @return string[] |
|
1807 | 1807 | */ |
1808 | 1808 | static function splitTrail( $trail ) { |
1809 | 1809 | global $wgContLang; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @param string $dstPath |
36 | 36 | * @param bool $checkDstPath |
37 | - * @return string|Callable One of client, im, custom, gd, imext or an array( object, method ) |
|
37 | + * @return string One of client, im, custom, gd, imext or an array( object, method ) |
|
38 | 38 | */ |
39 | 39 | protected function getScalerType( $dstPath, $checkDstPath = true ) { |
40 | 40 | global $wgUseImageResize, $wgUseImageMagick, $wgCustomConvertCommand; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * Get ImageMagick subsampling factors for the target JPEG pixel format. |
109 | 109 | * |
110 | 110 | * @param string $pixelFormat one of 'yuv444', 'yuv422', 'yuv420' |
111 | - * @return array of string keys |
|
111 | + * @return string[] of string keys |
|
112 | 112 | */ |
113 | 113 | protected function imageMagickSubsampling( $pixelFormat ) { |
114 | 114 | switch ( $pixelFormat ) { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * Constructor from a page id |
97 | 97 | * @param int $id Article ID to load |
98 | - * @return Article|null |
|
98 | + * @return Article |
|
99 | 99 | */ |
100 | 100 | public static function newFromID( $id ) { |
101 | 101 | $t = Title::newFromID( $id ); |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @note Code that wants to retrieve page content from the database should |
354 | 354 | * use WikiPage::getContent(). |
355 | 355 | * |
356 | - * @return Content|null|bool |
|
356 | + * @return null|Content |
|
357 | 357 | * |
358 | 358 | * @since 1.21 |
359 | 359 | */ |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | * on failure. |
442 | 442 | * |
443 | 443 | * @since 1.19 |
444 | - * @return Revision|null |
|
444 | + * @return Revision |
|
445 | 445 | */ |
446 | 446 | public function getRevisionFetched() { |
447 | 447 | $this->fetchContentObject(); |
@@ -1533,7 +1533,7 @@ discard block |
||
1533 | 1533 | * Chances are you should just be using the ParserOutput from |
1534 | 1534 | * WikitextContent::getParserOutput instead of calling this for redirects. |
1535 | 1535 | * |
1536 | - * @param Title|array $target Destination(s) to redirect |
|
1536 | + * @param Title $target Destination(s) to redirect |
|
1537 | 1537 | * @param bool $appendSubtitle [optional] |
1538 | 1538 | * @param bool $forceKnown Should the image be shown as a bluelink regardless of existence? |
1539 | 1539 | * @return string Containing HTML with redirect link |
@@ -1984,7 +1984,7 @@ discard block |
||
1984 | 1984 | * |
1985 | 1985 | * @param int|null $oldid Revision ID or null |
1986 | 1986 | * @param User $user The relevant user |
1987 | - * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found |
|
1987 | + * @return ParserOutput ParserOutput or false if the given revision ID is not found |
|
1988 | 1988 | */ |
1989 | 1989 | public function getParserOutput( $oldid = null, User $user = null ) { |
1990 | 1990 | // XXX: bypasses mParserOptions and thus setParserOptions() |
@@ -2652,7 +2652,7 @@ discard block |
||
2652 | 2652 | * @param string $reason |
2653 | 2653 | * @param int $cascade |
2654 | 2654 | * @param array $expiry |
2655 | - * @return bool |
|
2655 | + * @return Status |
|
2656 | 2656 | */ |
2657 | 2657 | public function updateRestrictions( $limit = [], $reason = '', |
2658 | 2658 | &$cascade = 0, $expiry = [] |
@@ -2709,7 +2709,7 @@ discard block |
||
2709 | 2709 | |
2710 | 2710 | /** |
2711 | 2711 | * @param bool $hasHistory |
2712 | - * @return mixed |
|
2712 | + * @return false|string |
|
2713 | 2713 | */ |
2714 | 2714 | public function generateReason( &$hasHistory ) { |
2715 | 2715 | $title = $this->mPage->getTitle(); |
@@ -2718,7 +2718,7 @@ discard block |
||
2718 | 2718 | } |
2719 | 2719 | |
2720 | 2720 | /** |
2721 | - * @return array |
|
2721 | + * @return string[] |
|
2722 | 2722 | * |
2723 | 2723 | * @deprecated since 1.24, use WikiPage::selectFields() instead |
2724 | 2724 | */ |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Fields in the oldimage table |
106 | - * @return array |
|
106 | + * @return string[] |
|
107 | 107 | */ |
108 | 108 | static function selectFields() { |
109 | 109 | return array( |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | /** |
234 | 234 | * @param string $prefix |
235 | - * @return array |
|
235 | + * @return string[] |
|
236 | 236 | */ |
237 | 237 | function getCacheFields( $prefix = 'img_' ) { |
238 | 238 | $fields = parent::getCacheFields( $prefix ); |
@@ -2183,7 +2183,7 @@ discard block |
||
2183 | 2183 | * |
2184 | 2184 | * @param string $text |
2185 | 2185 | * |
2186 | - * @return string|bool Matching string or false |
|
2186 | + * @return string|false Matching string or false |
|
2187 | 2187 | */ |
2188 | 2188 | public static function matchSpamRegex( $text ) { |
2189 | 2189 | global $wgSpamRegex; |
@@ -2197,7 +2197,7 @@ discard block |
||
2197 | 2197 | * |
2198 | 2198 | * @param string $text |
2199 | 2199 | * |
2200 | - * @return string|bool Matching string or false |
|
2200 | + * @return string|false Matching string or false |
|
2201 | 2201 | */ |
2202 | 2202 | public static function matchSummarySpamRegex( $text ) { |
2203 | 2203 | global $wgSummarySpamRegex; |
@@ -2208,7 +2208,7 @@ discard block |
||
2208 | 2208 | /** |
2209 | 2209 | * @param string $text |
2210 | 2210 | * @param array $regexes |
2211 | - * @return bool|string |
|
2211 | + * @return string|false |
|
2212 | 2212 | */ |
2213 | 2213 | protected static function matchSpamRegexInternal( $text, $regexes ) { |
2214 | 2214 | foreach ( $regexes as $regex ) { |
@@ -2448,7 +2448,7 @@ discard block |
||
2448 | 2448 | * $this->allowNonTextContent to true to allow editing of non-textual |
2449 | 2449 | * content. |
2450 | 2450 | * |
2451 | - * @param string|null|bool $text Text to unserialize |
|
2451 | + * @param false|string $text Text to unserialize |
|
2452 | 2452 | * @return Content The content object created from $text. If $text was false |
2453 | 2453 | * or null, false resp. null will be returned instead. |
2454 | 2454 | * |
@@ -3139,6 +3139,10 @@ discard block |
||
3139 | 3139 | $this->showTextbox( $this->textbox2, 'wpTextbox2', [ 'tabindex' => 6, 'readonly' ] ); |
3140 | 3140 | } |
3141 | 3141 | |
3142 | + /** |
|
3143 | + * @param string $text |
|
3144 | + * @param string $name |
|
3145 | + */ |
|
3142 | 3146 | protected function showTextbox( $text, $name, $customAttribs = [] ) { |
3143 | 3147 | global $wgOut, $wgUser; |
3144 | 3148 | |
@@ -3168,6 +3172,9 @@ discard block |
||
3168 | 3172 | $wgOut->addHTML( Html::textarea( $name, $wikitext, $attribs ) ); |
3169 | 3173 | } |
3170 | 3174 | |
3175 | + /** |
|
3176 | + * @param string $previewOutput |
|
3177 | + */ |
|
3171 | 3178 | protected function displayPreviewArea( $previewOutput, $isOnTop = false ) { |
3172 | 3179 | global $wgOut; |
3173 | 3180 | $classes = []; |
@@ -3754,7 +3761,7 @@ discard block |
||
3754 | 3761 | } |
3755 | 3762 | |
3756 | 3763 | /** |
3757 | - * @return array |
|
3764 | + * @return Title[] |
|
3758 | 3765 | */ |
3759 | 3766 | function getTemplates() { |
3760 | 3767 | if ( $this->preview || $this->section != '' ) { |
@@ -3917,7 +3924,7 @@ discard block |
||
3917 | 3924 | * @param array $checked Array of checkbox => bool, where bool indicates the checked |
3918 | 3925 | * status of the checkbox |
3919 | 3926 | * |
3920 | - * @return array |
|
3927 | + * @return string |
|
3921 | 3928 | */ |
3922 | 3929 | public function getCheckboxes( &$tabindex, $checked ) { |
3923 | 3930 | global $wgUser, $wgUseMediaWikiUIEverywhere; |
@@ -3981,7 +3988,7 @@ discard block |
||
3981 | 3988 | * |
3982 | 3989 | * @param int $tabindex Current tabindex |
3983 | 3990 | * |
3984 | - * @return array |
|
3991 | + * @return string |
|
3985 | 3992 | */ |
3986 | 3993 | public function getEditButtons( &$tabindex ) { |
3987 | 3994 | $buttons = []; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param bool $ie8Compat By default, a data URI will only be produced if it can be made short |
101 | 101 | * enough to fit in Internet Explorer 8 (and earlier) URI length limit (32,768 bytes). Pass |
102 | 102 | * `false` to remove this limitation. |
103 | - * @return string|bool Image contents encoded as a data URI or false. |
|
103 | + * @return false|string Image contents encoded as a data URI or false. |
|
104 | 104 | */ |
105 | 105 | public static function encodeImageAsDataURI( $file, $type = null, $ie8Compat = true ) { |
106 | 106 | // Fast-fail for files that definitely exceed the maximum data URI length |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @param string $contents File contents to encode. |
129 | 129 | * @param string $type File's MIME type. |
130 | 130 | * @param bool $ie8Compat See encodeImageAsDataURI(). |
131 | - * @return string|bool Image contents encoded as a data URI or false. |
|
131 | + * @return string|false Image contents encoded as a data URI or false. |
|
132 | 132 | */ |
133 | 133 | public static function encodeStringAsDataURI( $contents, $type, $ie8Compat = true ) { |
134 | 134 | // Try #1: Non-encoded data URI |