@@ -423,7 +423,7 @@ |
||
423 | 423 | * Returns a sentence describing the log action. Usually |
424 | 424 | * a Message object is returned, but old style log types |
425 | 425 | * and entries might return pre-escaped HTML string. |
426 | - * @return Message|string Pre-escaped HTML |
|
426 | + * @return string Pre-escaped HTML |
|
427 | 427 | */ |
428 | 428 | protected function getActionMessage() { |
429 | 429 | $message = $this->msg( $this->getMessageKey() ); |
@@ -371,6 +371,9 @@ |
||
371 | 371 | return 'djvuxml'; |
372 | 372 | } |
373 | 373 | |
374 | + /** |
|
375 | + * @param File $image |
|
376 | + */ |
|
374 | 377 | function isMetadataValid( $image, $metadata ) { |
375 | 378 | return !empty( $metadata ) && $metadata != serialize( [] ); |
376 | 379 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * |
197 | 197 | * @note This method is currently unused. |
198 | 198 | * @param File $image |
199 | - * @return string |
|
199 | + * @return boolean |
|
200 | 200 | */ |
201 | 201 | function getMetadataType( $image ) { |
202 | 202 | return false; |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | * @param string $ext Extension of original file |
309 | 309 | * @param string $mime MIME type of original file |
310 | 310 | * @param array $params Handler specific rendering parameters |
311 | - * @return array Thumbnail extension and MIME type |
|
311 | + * @return string[] Thumbnail extension and MIME type |
|
312 | 312 | */ |
313 | 313 | function getThumbType( $ext, $mime, $params = null ) { |
314 | 314 | $magic = MimeMagic::singleton(); |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | * @param int $boxWidth Width of the thumbnail box. |
649 | 649 | * @param int $boxHeight Height of the thumbnail box. |
650 | 650 | * @param int $maxHeight Maximum height expected for the thumbnail. |
651 | - * @return int |
|
651 | + * @return double |
|
652 | 652 | */ |
653 | 653 | public static function fitBoxWidth( $boxWidth, $boxHeight, $maxHeight ) { |
654 | 654 | $idealWidth = $boxWidth * $maxHeight / $boxHeight; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * Get the final extension of the thumbnail. |
82 | 82 | * Returns false for scripted transformations. |
83 | - * @return string|bool |
|
83 | + * @return string|false |
|
84 | 84 | */ |
85 | 85 | public function getExtension() { |
86 | 86 | return $this->path ? FileBackend::extensionFromPath( $this->path ) : false; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * |
215 | 215 | * @deprecated since 1.26, use streamFileWithStatus |
216 | 216 | * @param array $headers Additional HTTP headers to send on success |
217 | - * @return bool Success |
|
217 | + * @return boolean|null Success |
|
218 | 218 | */ |
219 | 219 | public function streamFile( $headers = [] ) { |
220 | 220 | $this->streamFileWithStatus( $headers )->isOK(); |
@@ -445,6 +445,9 @@ discard block |
||
445 | 445 | /** @var string Plain text formatted version of the error */ |
446 | 446 | private $textMsg; |
447 | 447 | |
448 | + /** |
|
449 | + * @param string $msg |
|
450 | + */ |
|
448 | 451 | function __construct( $msg, $width, $height /*, ... */ ) { |
449 | 452 | $args = array_slice( func_get_args(), 3 ); |
450 | 453 | $htmlArgs = array_map( 'htmlspecialchars', $args ); |
@@ -979,7 +979,7 @@ discard block |
||
979 | 979 | /** |
980 | 980 | * Replace the subtitle with $str |
981 | 981 | * |
982 | - * @param string|Message $str New value of the subtitle. String should be safe HTML. |
|
982 | + * @param string $str New value of the subtitle. String should be safe HTML. |
|
983 | 983 | */ |
984 | 984 | public function setSubtitle( $str ) { |
985 | 985 | $this->clearSubtitle(); |
@@ -1597,7 +1597,7 @@ discard block |
||
1597 | 1597 | /** |
1598 | 1598 | * Set the displayed file version |
1599 | 1599 | * |
1600 | - * @param File|bool $file |
|
1600 | + * @param File $file |
|
1601 | 1601 | * @return mixed Previous value |
1602 | 1602 | */ |
1603 | 1603 | public function setFileVersion( $file ) { |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | /** |
1944 | 1944 | * Get the list of cookies that will influence on the cache |
1945 | 1945 | * |
1946 | - * @return array |
|
1946 | + * @return string[] |
|
1947 | 1947 | */ |
1948 | 1948 | function getCacheVaryCookies() { |
1949 | 1949 | static $cookies; |
@@ -2322,7 +2322,7 @@ discard block |
||
2322 | 2322 | * indexing, clear the current text and redirect, set the page's title |
2323 | 2323 | * and optionally an custom HTML title (content of the "<title>" tag). |
2324 | 2324 | * |
2325 | - * @param string|Message $pageTitle Will be passed directly to setPageTitle() |
|
2325 | + * @param Message $pageTitle Will be passed directly to setPageTitle() |
|
2326 | 2326 | * @param string|Message $htmlTitle Will be passed directly to setHTMLTitle(); |
2327 | 2327 | * optional, if not passed the "<title>" attribute will be |
2328 | 2328 | * based on $pageTitle |
@@ -2348,8 +2348,8 @@ discard block |
||
2348 | 2348 | * showErrorPage( 'titlemsg', $messageObject ); |
2349 | 2349 | * showErrorPage( $titleMessageObject, $messageObject ); |
2350 | 2350 | * |
2351 | - * @param string|Message $title Message key (string) for page title, or a Message object |
|
2352 | - * @param string|Message $msg Message key (string) for page text, or a Message object |
|
2351 | + * @param string $title Message key (string) for page title, or a Message object |
|
2352 | + * @param string $msg Message key (string) for page text, or a Message object |
|
2353 | 2353 | * @param array $params Message parameters; ignored if $msg is a Message object |
2354 | 2354 | */ |
2355 | 2355 | public function showErrorPage( $title, $msg, $params = [] ) { |
@@ -2545,6 +2545,9 @@ discard block |
||
2545 | 2545 | } |
2546 | 2546 | } |
2547 | 2547 | |
2548 | + /** |
|
2549 | + * @param string $message |
|
2550 | + */ |
|
2548 | 2551 | public function showFatalError( $message ) { |
2549 | 2552 | $this->prepareErrorPage( $this->msg( 'internalerror' ) ); |
2550 | 2553 | |
@@ -2563,6 +2566,9 @@ discard block |
||
2563 | 2566 | $this->showFatalError( $this->msg( 'filerenameerror', $old, $new )->text() ); |
2564 | 2567 | } |
2565 | 2568 | |
2569 | + /** |
|
2570 | + * @param string $name |
|
2571 | + */ |
|
2566 | 2572 | public function showFileDeleteError( $name ) { |
2567 | 2573 | $this->showFatalError( $this->msg( 'filedeleteerror', $name )->text() ); |
2568 | 2574 | } |
@@ -2589,7 +2595,7 @@ discard block |
||
2589 | 2595 | * Add a "return to" link pointing to a specified title, |
2590 | 2596 | * or the title indicated in the request, or else the main page |
2591 | 2597 | * |
2592 | - * @param mixed $unused |
|
2598 | + * @param null|boolean $unused |
|
2593 | 2599 | * @param Title|string $returnto Title or String to return to |
2594 | 2600 | * @param string $returntoquery Query string for the return to link |
2595 | 2601 | */ |
@@ -3844,7 +3850,7 @@ discard block |
||
3844 | 3850 | * Caller is responsible for ensuring the file exists. Emits a PHP warning otherwise. |
3845 | 3851 | * |
3846 | 3852 | * @since 1.27 |
3847 | - * @param string $remotePath URL path prefix that points to $localPath |
|
3853 | + * @param string $remotePathPrefix URL path prefix that points to $localPath |
|
3848 | 3854 | * @param string $localPath File directory exposed at $remotePath |
3849 | 3855 | * @param string $file Path to target file relative to $localPath |
3850 | 3856 | * @return string URL |
@@ -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 | */ |
@@ -1529,7 +1529,7 @@ discard block |
||
1529 | 1529 | * Chances are you should just be using the ParserOutput from |
1530 | 1530 | * WikitextContent::getParserOutput instead of calling this for redirects. |
1531 | 1531 | * |
1532 | - * @param Title|array $target Destination(s) to redirect |
|
1532 | + * @param Title $target Destination(s) to redirect |
|
1533 | 1533 | * @param bool $appendSubtitle [optional] |
1534 | 1534 | * @param bool $forceKnown Should the image be shown as a bluelink regardless of existence? |
1535 | 1535 | * @return string Containing HTML with redirect link |
@@ -2648,7 +2648,7 @@ discard block |
||
2648 | 2648 | * @param string $reason |
2649 | 2649 | * @param int $cascade |
2650 | 2650 | * @param array $expiry |
2651 | - * @return bool |
|
2651 | + * @return Status |
|
2652 | 2652 | */ |
2653 | 2653 | public function updateRestrictions( $limit = [], $reason = '', |
2654 | 2654 | &$cascade = 0, $expiry = [] |
@@ -2705,7 +2705,7 @@ discard block |
||
2705 | 2705 | |
2706 | 2706 | /** |
2707 | 2707 | * @param bool $hasHistory |
2708 | - * @return mixed |
|
2708 | + * @return false|string |
|
2709 | 2709 | */ |
2710 | 2710 | public function generateReason( &$hasHistory ) { |
2711 | 2711 | $title = $this->mPage->getTitle(); |
@@ -2714,7 +2714,7 @@ discard block |
||
2714 | 2714 | } |
2715 | 2715 | |
2716 | 2716 | /** |
2717 | - * @return array |
|
2717 | + * @return string[] |
|
2718 | 2718 | * |
2719 | 2719 | * @deprecated since 1.24, use WikiPage::selectFields() instead |
2720 | 2720 | */ |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * |
268 | 268 | * @todo FIXME: Bad interface, see note on MediaHandler::formatMetadata(). |
269 | 269 | * |
270 | - * @param array $metadata The array containing the Exif data |
|
270 | + * @param boolean $metadata The array containing the Exif data |
|
271 | 271 | * @return string The metadata table. This is treated as Wikitext (!) |
272 | 272 | */ |
273 | 273 | protected function makeMetadataTable( $metadata ) { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * |
297 | 297 | * Omit noarticletext if sharedupload; text will be fetched from the |
298 | 298 | * shared upload server if possible. |
299 | - * @return string |
|
299 | + * @return null|Content |
|
300 | 300 | */ |
301 | 301 | public function getContentObject() { |
302 | 302 | $this->loadFile(); |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | * Make the text under the image to say what size preview |
638 | 638 | * |
639 | 639 | * @param $params array parameters for thumbnail |
640 | - * @param $sizeLinkBigImagePreview HTML for the current size |
|
640 | + * @param string $sizeLinkBigImagePreview HTML for the current size |
|
641 | 641 | * @return string HTML output |
642 | 642 | */ |
643 | 643 | private function getThumbPrevText( $params, $sizeLinkBigImagePreview ) { |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * Return the list of revision fields that should be selected to create |
258 | 258 | * a new page. |
259 | 259 | * |
260 | - * @return array |
|
260 | + * @return string[] |
|
261 | 261 | */ |
262 | 262 | public static function selectFields() { |
263 | 263 | global $wgContentHandlerUseDB, $wgPageLanguageUseDB; |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | * @param IDatabase $dbw |
1143 | 1143 | * @param int|null $pageId Custom page ID that will be used for the insert statement |
1144 | 1144 | * |
1145 | - * @return bool|int The newly created page_id key; false if the title already existed |
|
1145 | + * @return integer The newly created page_id key; false if the title already existed |
|
1146 | 1146 | */ |
1147 | 1147 | public function insertOn( $dbw, $pageId = null ) { |
1148 | 1148 | $pageIdForInsert = $pageId ?: $dbw->nextSequenceValue( 'page_page_id_seq' ); |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | * error will be returned. These two conditions are also possible with |
1488 | 1488 | * auto-detection due to MediaWiki's performance-optimised locking strategy. |
1489 | 1489 | * |
1490 | - * @param bool|int $baseRevId The revision ID this edit was based off, if any. |
|
1490 | + * @param boolean $baseRevId The revision ID this edit was based off, if any. |
|
1491 | 1491 | * This is not the parent revision ID, rather the revision ID for older |
1492 | 1492 | * content used as the source for a rollback, for example. |
1493 | 1493 | * @param User $user The user doing the edit |
@@ -3360,7 +3360,7 @@ discard block |
||
3360 | 3360 | * Returns a list of categories this page is a member of. |
3361 | 3361 | * Results will include hidden categories |
3362 | 3362 | * |
3363 | - * @return TitleArray |
|
3363 | + * @return TitleArrayFromResult|null |
|
3364 | 3364 | */ |
3365 | 3365 | public function getCategories() { |
3366 | 3366 | $id = $this->getId(); |
@@ -3435,7 +3435,7 @@ discard block |
||
3435 | 3435 | * Auto-generates a deletion reason |
3436 | 3436 | * |
3437 | 3437 | * @param bool &$hasHistory Whether the page has a history |
3438 | - * @return string|bool String containing deletion reason or empty string, or boolean false |
|
3438 | + * @return false|string String containing deletion reason or empty string, or boolean false |
|
3439 | 3439 | * if no revision occurred |
3440 | 3440 | */ |
3441 | 3441 | public function getAutoDeleteReason( &$hasHistory ) { |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | * @since 1.25 |
616 | 616 | * |
617 | 617 | * @param string $text Text extension wants to have parsed |
618 | - * @param bool|PPFrame $frame The frame to use for expanding any template variables |
|
618 | + * @param PPFrame $frame The frame to use for expanding any template variables |
|
619 | 619 | * @return string Fully parsed HTML |
620 | 620 | */ |
621 | 621 | public function recursiveTagParseFully( $text, $frame = false ) { |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @param ParserOptions $options |
634 | 634 | * @param int|null $revid |
635 | 635 | * @param bool|PPFrame $frame |
636 | - * @return mixed|string |
|
636 | + * @return string |
|
637 | 637 | */ |
638 | 638 | public function preprocess( $text, Title $title = null, |
639 | 639 | ParserOptions $options, $revid = null, $frame = false |
@@ -1969,6 +1969,10 @@ discard block |
||
1969 | 1969 | return $ret; |
1970 | 1970 | } |
1971 | 1971 | |
1972 | + /** |
|
1973 | + * @param string $component |
|
1974 | + * @param string $unsafe |
|
1975 | + */ |
|
1972 | 1976 | private static function normalizeUrlComponent( $component, $unsafe ) { |
1973 | 1977 | $callback = function ( $matches ) use ( $unsafe ) { |
1974 | 1978 | $char = urldecode( $matches[0] ); |
@@ -2420,6 +2424,7 @@ discard block |
||
2420 | 2424 | * |
2421 | 2425 | * @param string $target The source of the link |
2422 | 2426 | * @param string &$text The link text, modified as necessary |
2427 | + * @param string $text |
|
2423 | 2428 | * @return string The full name of the link |
2424 | 2429 | * @private |
2425 | 2430 | */ |
@@ -2445,7 +2450,7 @@ discard block |
||
2445 | 2450 | * @private |
2446 | 2451 | * |
2447 | 2452 | * @param int $index |
2448 | - * @param bool|PPFrame $frame |
|
2453 | + * @param PPFrame $frame |
|
2449 | 2454 | * |
2450 | 2455 | * @throws MWException |
2451 | 2456 | * @return string |
@@ -2842,7 +2847,7 @@ discard block |
||
2842 | 2847 | * |
2843 | 2848 | * @param string $s |
2844 | 2849 | * |
2845 | - * @return array |
|
2850 | + * @return string[] |
|
2846 | 2851 | */ |
2847 | 2852 | public static function splitWhitespace( $s ) { |
2848 | 2853 | $ltrimmed = ltrim( $s ); |
@@ -2950,7 +2955,7 @@ discard block |
||
2950 | 2955 | * 'expansion-depth-exceeded' (corresponding messages: |
2951 | 2956 | * 'expansion-depth-exceeded-warning', |
2952 | 2957 | * 'expansion-depth-exceeded-category') |
2953 | - * @param string|int|null $current Current value |
|
2958 | + * @param integer $current Current value |
|
2954 | 2959 | * @param string|int|null $max Maximum allowed, when an explicit limit has been |
2955 | 2960 | * exceeded, provide the values (optional) |
2956 | 2961 | */ |
@@ -3954,7 +3959,7 @@ discard block |
||
3954 | 3959 | * @param string $text |
3955 | 3960 | * @param string $origText Original, untouched wikitext |
3956 | 3961 | * @param bool $isMain |
3957 | - * @return mixed|string |
|
3962 | + * @return string |
|
3958 | 3963 | * @private |
3959 | 3964 | */ |
3960 | 3965 | public function formatHeadings( $text, $origText, $isMain = true ) { |
@@ -4525,7 +4530,7 @@ discard block |
||
4525 | 4530 | * Check that the user's signature contains no bad XML |
4526 | 4531 | * |
4527 | 4532 | * @param string $text |
4528 | - * @return string|bool An expanded string, or false if invalid. |
|
4533 | + * @return string|false An expanded string, or false if invalid. |
|
4529 | 4534 | */ |
4530 | 4535 | public function validateSig( $text ) { |
4531 | 4536 | return Xml::isWellFormedXmlFragment( $text ) ? $text : false; |
@@ -5067,7 +5072,7 @@ discard block |
||
5067 | 5072 | * |
5068 | 5073 | * @param Title $title |
5069 | 5074 | * @param string $options |
5070 | - * @param LinkHolderArray|bool $holders |
|
5075 | + * @param LinkHolderArray $holders |
|
5071 | 5076 | * @return string HTML |
5072 | 5077 | */ |
5073 | 5078 | public function makeImage( $title, $options, $holders = false ) { |
@@ -5283,7 +5288,7 @@ discard block |
||
5283 | 5288 | /** |
5284 | 5289 | * @param string $caption |
5285 | 5290 | * @param LinkHolderArray|bool $holders |
5286 | - * @return mixed|string |
|
5291 | + * @return string |
|
5287 | 5292 | */ |
5288 | 5293 | protected function stripAltText( $caption, $holders ) { |
5289 | 5294 | # Strip bad stuff out of the title (tooltip). We can't just use |
@@ -5686,7 +5691,7 @@ discard block |
||
5686 | 5691 | * Accessor for $mDefaultSort |
5687 | 5692 | * Unlike getDefaultSort(), will return false if none is set |
5688 | 5693 | * |
5689 | - * @return string|bool |
|
5694 | + * @return false|string |
|
5690 | 5695 | */ |
5691 | 5696 | public function getCustomDefaultSort() { |
5692 | 5697 | return $this->mDefaultSort; |