From 1b342a889388da44c084809e65854f307a009ba9 Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Sun, 31 Jul 2022 02:02:18 +0200 Subject: Various doc fixes about false and null on method arguments/return types Doc-only changes Change-Id: Ice974b3ba41708859dfe646e94b31c5ebbf26410 --- includes/content/AbstractContent.php | 4 ++-- includes/content/Content.php | 8 ++++---- includes/content/ContentHandler.php | 4 ++-- includes/content/Hook/ConvertContentHook.php | 2 +- includes/content/TextContent.php | 4 ++-- includes/content/TextContentHandler.php | 2 +- includes/content/WikitextContent.php | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'includes/content') diff --git a/includes/content/AbstractContent.php b/includes/content/AbstractContent.php index 66cadc887aab..129eea841a9b 100644 --- a/includes/content/AbstractContent.php +++ b/includes/content/AbstractContent.php @@ -385,7 +385,7 @@ abstract class AbstractContent implements Content { * @stable to override * @since 1.21 * - * @param string|int|null|bool $sectionId + * @param string|int|null|false $sectionId * @param Content $with * @param string $sectionTitle * @return null @@ -516,7 +516,7 @@ abstract class AbstractContent implements Content { * @param string $toModel * @param string $lossy * - * @return Content|bool + * @return Content|false * * @see Content::convert() */ diff --git a/includes/content/Content.php b/includes/content/Content.php index f0fadfc871f0..b85184538b90 100644 --- a/includes/content/Content.php +++ b/includes/content/Content.php @@ -48,7 +48,7 @@ interface Content { /** * @since 1.21 * - * @return string|bool The wikitext to include when another page includes this + * @return string|false The wikitext to include when another page includes this * content, or false if the content is not includable in a wikitext page. * * @todo Allow native handling, bypassing wikitext representation, like @@ -331,7 +331,7 @@ interface Content { * (e.g. 0, 1 or 'T-1'). The ID "0" retrieves the section before the first heading, "1" the * text between the first heading (included) and the second heading (excluded), etc. * - * @return Content|bool|null The section, or false if no such section + * @return Content|false|null The section, or false if no such section * exist, or null if sections are not supported. */ public function getSection( $sectionId ); @@ -342,7 +342,7 @@ interface Content { * * @since 1.21 * - * @param string|int|null|bool $sectionId Section identifier as a number or string + * @param string|int|null|false $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page * or 'new' for a new section. * @param Content $with New content of the section @@ -444,7 +444,7 @@ interface Content { * conversion is not allowed, full round-trip conversion is expected to work without losing * information. * - * @return Content|bool A content object with the content model $toModel, or false if + * @return Content|false A content object with the content model $toModel, or false if * that conversion is not supported. */ public function convert( $toModel, $lossy = '' ); diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 124e5b82c2ed..5c1dbd76e274 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -828,7 +828,7 @@ abstract class ContentHandler { * @param Content $myContent One of the page's conflicting contents. * @param Content $yourContent One of the page's conflicting contents. * - * @return Content|bool Always false. + * @return Content|false Always false. */ public function merge3( Content $oldContent, Content $myContent, Content $yourContent ) { return false; @@ -1046,7 +1046,7 @@ abstract class ContentHandler { * @param Title $title The page's title * @param bool &$hasHistory Whether the page has a history * - * @return mixed String containing deletion reason or empty string, or + * @return string|false String containing deletion reason or empty string, or * boolean false if no revision occurred */ public function getAutoDeleteReason( Title $title, &$hasHistory = false ) { diff --git a/includes/content/Hook/ConvertContentHook.php b/includes/content/Hook/ConvertContentHook.php index 7c5f07ef6296..65ba72c39612 100644 --- a/includes/content/Hook/ConvertContentHook.php +++ b/includes/content/Hook/ConvertContentHook.php @@ -22,7 +22,7 @@ interface ConvertContentHook { * @param Content $content Content object to be converted * @param string $toModel ID of the content model to convert to * @param bool $lossy Whether lossy conversion is allowed - * @param Content|bool &$result Output parameter, in case the handler function wants to + * @param Content|false &$result Output parameter, in case the handler function wants to * provide a converted Content object. Note that $result->getContentModel() must return * $toModel. * @return bool|void True or no return value to continue or false to abort diff --git a/includes/content/TextContent.php b/includes/content/TextContent.php index 031df7511d58..dd276fb40119 100644 --- a/includes/content/TextContent.php +++ b/includes/content/TextContent.php @@ -175,7 +175,7 @@ class TextContent extends AbstractContent { * * @note this allows any text-based content to be transcluded as if it was wikitext. * - * @return string|bool The raw text, or false if the conversion failed. + * @return string|false The raw text, or false if the conversion failed. */ public function getWikitextForTransclusion() { /** @var WikitextContent $wikitext */ @@ -251,7 +251,7 @@ class TextContent extends AbstractContent { * @param string $lossy Flag, set to "lossy" to allow lossy conversion. If lossy conversion is not * allowed, full round-trip conversion is expected to work without losing information. * - * @return Content|bool A content object with the content model $toModel, or false if that + * @return Content|false A content object with the content model $toModel, or false if that * conversion is not supported. * @throws MWUnknownContentModelException * diff --git a/includes/content/TextContentHandler.php b/includes/content/TextContentHandler.php index 6c68232b292e..875ca81834e7 100644 --- a/includes/content/TextContentHandler.php +++ b/includes/content/TextContentHandler.php @@ -68,7 +68,7 @@ class TextContentHandler extends ContentHandler { * @param Content $myContent One of the page's conflicting contents. * @param Content $yourContent One of the page's conflicting contents. * - * @return Content|bool + * @return Content|false */ public function merge3( Content $oldContent, Content $myContent, Content $yourContent ) { $this->checkModelID( $oldContent->getModel() ); diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index 79aba3df4e7a..8cc465f0934a 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -54,7 +54,7 @@ class WikitextContent extends TextContent { /** * @param string|int $sectionId * - * @return Content|bool|null + * @return Content|false|null * * @see Content::getSection() */ @@ -71,7 +71,7 @@ class WikitextContent extends TextContent { } /** - * @param string|int|null|bool $sectionId + * @param string|int|null|false $sectionId * @param Content $with * @param string $sectionTitle * -- cgit v1.2.3