aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUmherirrender <umherirrender_de.wp@web.de>2022-07-31 02:02:18 +0200
committerUmherirrender <umherirrender_de.wp@web.de>2022-11-03 18:55:47 +0100
commit1b342a889388da44c084809e65854f307a009ba9 (patch)
tree4a9f766a6fa70cd155f6586b1d6546d52002289a
parent5b703126e52c417d870f81d935bfa1d452d559da (diff)
downloadmediawikicore-1b342a889388da44c084809e65854f307a009ba9.tar.gz
mediawikicore-1b342a889388da44c084809e65854f307a009ba9.zip
Various doc fixes about false and null on method arguments/return types
Doc-only changes Change-Id: Ice974b3ba41708859dfe646e94b31c5ebbf26410
-rw-r--r--includes/EditPage.php16
-rw-r--r--includes/ResourceLoader/Context.php2
-rw-r--r--includes/Revision/ArchivedRevisionLookup.php2
-rw-r--r--includes/Revision/RevisionLookup.php4
-rw-r--r--includes/Revision/RevisionRenderer.php4
-rw-r--r--includes/Revision/RevisionStore.php4
-rw-r--r--includes/Title.php2
-rw-r--r--includes/WikiMap.php4
-rw-r--r--includes/actions/Action.php2
-rw-r--r--includes/actions/ActionFactory.php4
-rw-r--r--includes/actions/RawAction.php2
-rw-r--r--includes/actions/WatchAction.php2
-rw-r--r--includes/actions/pagers/HistoryPager.php2
-rw-r--r--includes/changetags/ChangeTags.php6
-rw-r--r--includes/content/AbstractContent.php4
-rw-r--r--includes/content/Content.php8
-rw-r--r--includes/content/ContentHandler.php4
-rw-r--r--includes/content/Hook/ConvertContentHook.php2
-rw-r--r--includes/content/TextContent.php4
-rw-r--r--includes/content/TextContentHandler.php2
-rw-r--r--includes/content/WikitextContent.php4
-rw-r--r--includes/filerepo/ForeignAPIRepo.php10
-rw-r--r--includes/filerepo/LocalRepo.php2
-rw-r--r--includes/filerepo/file/File.php68
-rw-r--r--includes/filerepo/file/ForeignAPIFile.php12
-rw-r--r--includes/filerepo/file/ForeignDBFile.php2
-rw-r--r--includes/filerepo/file/LocalFile.php30
-rw-r--r--includes/filerepo/file/OldLocalFile.php4
-rw-r--r--includes/filerepo/file/UnregisteredLocalFile.php16
-rw-r--r--includes/jobqueue/JobQueue.php8
-rw-r--r--includes/jobqueue/JobQueueDB.php8
-rw-r--r--includes/jobqueue/JobQueueGroup.php2
-rw-r--r--includes/jobqueue/JobQueueMemory.php2
-rw-r--r--includes/jobqueue/JobQueueRedis.php8
-rw-r--r--includes/jobqueue/jobs/DoubleRedirectJob.php4
-rw-r--r--includes/language/dependency/DependencyWrapper.php2
-rw-r--r--includes/language/dependency/FileDependency.php2
-rw-r--r--includes/page/Article.php4
-rw-r--r--includes/page/Hook/RevisionFromEditCompleteHook.php2
-rw-r--r--includes/page/PageArchive.php2
-rw-r--r--includes/page/PageIdentityValue.php4
-rw-r--r--includes/page/PageReferenceValue.php4
-rw-r--r--includes/page/PageStoreRecord.php4
-rw-r--r--includes/page/WikiPage.php20
-rw-r--r--includes/parser/PPDStackElement_Hash.php2
-rw-r--r--includes/parser/PPFrame.php6
-rw-r--r--includes/parser/PPNode.php2
-rw-r--r--includes/parser/Parser.php30
-rw-r--r--includes/parser/ParserOptions.php4
-rw-r--r--includes/parser/ParserOutput.php2
-rw-r--r--includes/parser/Preprocessor_Hash.php2
-rw-r--r--includes/parser/RevisionOutputCache.php2
-rw-r--r--includes/parser/Sanitizer.php2
-rw-r--r--includes/upload/UploadBase.php10
-rw-r--r--includes/upload/UploadFromChunks.php4
-rw-r--r--includes/upload/UploadFromStash.php4
-rw-r--r--includes/user/ActorStoreFactory.php4
-rw-r--r--includes/user/User.php18
-rw-r--r--includes/user/UserArrayFromResult.php2
-rw-r--r--includes/user/UserEditTracker.php2
-rw-r--r--includes/user/UserFactory.php2
-rw-r--r--includes/user/UserGroupManager.php4
-rw-r--r--includes/user/UserGroupManagerFactory.php2
-rw-r--r--includes/user/UserGroupMembership.php2
-rw-r--r--includes/user/UserIdentityValue.php2
-rw-r--r--maintenance/namespaceDupes.php2
-rw-r--r--tests/phpunit/includes/Revision/MutableRevisionRecordTest.php2
-rw-r--r--tests/phpunit/includes/Revision/RevisionArchiveRecordTest.php4
-rw-r--r--tests/phpunit/includes/Revision/RevisionStoreRecordTest.php4
-rw-r--r--tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php2
-rw-r--r--tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php6
71 files changed, 216 insertions, 216 deletions
diff --git a/includes/EditPage.php b/includes/EditPage.php
index ce6703c3a7b7..8fbb902234b0 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -225,7 +225,7 @@ class EditPage implements IEditObject {
private $mParserOutput;
/**
- * @var RevisionRecord|bool|null
+ * @var RevisionRecord|false|null
*
* A RevisionRecord corresponding to $this->editRevId or $this->edittime
*/
@@ -369,7 +369,7 @@ class EditPage implements IEditObject {
/** @var bool */
private $edit;
- /** @var bool|int */
+ /** @var int|false */
private $contentLength = false;
/**
@@ -1888,7 +1888,7 @@ class EditPage implements IEditObject {
/**
* Attempt submission
- * @param array|bool &$resultDetails See docs for $result in internalAttemptSave @phan-output-reference
+ * @param array|false &$resultDetails See docs for $result in internalAttemptSave @phan-output-reference
* @throws UserBlockedError|ReadOnlyError|ThrottledError|PermissionsError
* @return Status
*/
@@ -1923,7 +1923,7 @@ class EditPage implements IEditObject {
* Handle status, such as after attempt save
*
* @param Status $status
- * @param array|bool $resultDetails
+ * @param array|false $resultDetails
*
* @throws ErrorPageError
* @return bool False, if output is done, true if rest of the form should be displayed
@@ -3074,7 +3074,7 @@ class EditPage implements IEditObject {
* $this->allowNonTextContent to true to allow editing of non-textual
* content.
*
- * @param Content|null|bool|string $content
+ * @param Content|null|false|string $content
* @return string|false|null The editable text form of the content.
*
* @throws MWException If $content is not an instance of TextContent and
@@ -3100,8 +3100,8 @@ class EditPage implements IEditObject {
* $this->allowNonTextContent to true to allow editing of non-textual
* content.
*
- * @param string|null|bool $text Text to unserialize
- * @return Content|bool|null The content object created from $text. If $text was false
+ * @param string|null|false $text Text to unserialize
+ * @return Content|false|null The content object created from $text. If $text was false
* or null, then false or null will be returned instead.
*
* @throws MWException If unserializing the text results in a Content
@@ -4839,7 +4839,7 @@ class EditPage implements IEditObject {
/**
* Show "your edit contains spam" page with your diff and text
*
- * @param string|array|bool $match Text (or array of texts) which triggered one or more filters
+ * @param string|array|false $match Text (or array of texts) which triggered one or more filters
*/
public function spamPageWithContent( $match = false ) {
$this->textbox2 = $this->textbox1;
diff --git a/includes/ResourceLoader/Context.php b/includes/ResourceLoader/Context.php
index 392c3bf68a1d..59f76d515402 100644
--- a/includes/ResourceLoader/Context.php
+++ b/includes/ResourceLoader/Context.php
@@ -369,7 +369,7 @@ class Context implements MessageLocalizer {
* If this is a request for an image, get the Image object.
*
* @since 1.25
- * @return Image|bool false if a valid object cannot be created
+ * @return Image|false false if a valid object cannot be created
*/
public function getImageObj() {
if ( $this->imageObj === null ) {
diff --git a/includes/Revision/ArchivedRevisionLookup.php b/includes/Revision/ArchivedRevisionLookup.php
index d36176a215fd..de726a753610 100644
--- a/includes/Revision/ArchivedRevisionLookup.php
+++ b/includes/Revision/ArchivedRevisionLookup.php
@@ -53,7 +53,7 @@ class ArchivedRevisionLookup {
* various archive table fields.
*
* @param PageIdentity $page
- * @return IResultWrapper|bool
+ * @return IResultWrapper
*/
public function listRevisions( PageIdentity $page ) {
$queryInfo = $this->revisionStore->getArchiveQueryInfo();
diff --git a/includes/Revision/RevisionLookup.php b/includes/Revision/RevisionLookup.php
index 5193d8a6cb49..714212d52a90 100644
--- a/includes/Revision/RevisionLookup.php
+++ b/includes/Revision/RevisionLookup.php
@@ -136,7 +136,7 @@ interface RevisionLookup extends IDBAccessObject {
*
* @param int $id
* @param int $flags
- * @return string|bool False if not found
+ * @return string|false False if not found
* @since 1.34 (present earlier in RevisionStore)
*/
public function getTimestampFromId( $id, $flags = 0 );
@@ -152,7 +152,7 @@ interface RevisionLookup extends IDBAccessObject {
* @param PageIdentity $page the associated page
* @param int $revId current revision of this page
*
- * @return RevisionRecord|bool Returns false if missing
+ * @return RevisionRecord|false Returns false if missing
*/
public function getKnownCurrentRevision( PageIdentity $page, $revId = 0 );
diff --git a/includes/Revision/RevisionRenderer.php b/includes/Revision/RevisionRenderer.php
index 372faaa3c3d7..e3677b3e9617 100644
--- a/includes/Revision/RevisionRenderer.php
+++ b/includes/Revision/RevisionRenderer.php
@@ -56,14 +56,14 @@ class RevisionRenderer {
/** @var ContentRenderer */
private $contentRenderer;
- /** @var string|bool */
+ /** @var string|false */
private $dbDomain;
/**
* @param ILoadBalancer $loadBalancer
* @param SlotRoleRegistry $roleRegistry
* @param ContentRenderer $contentRenderer
- * @param bool|string $dbDomain DB domain of the relevant wiki or false for the current one
+ * @param string|false $dbDomain DB domain of the relevant wiki or false for the current one
*/
public function __construct(
ILoadBalancer $loadBalancer,
diff --git a/includes/Revision/RevisionStore.php b/includes/Revision/RevisionStore.php
index 3bfa3dcf6d74..db5ee7288cac 100644
--- a/includes/Revision/RevisionStore.php
+++ b/includes/Revision/RevisionStore.php
@@ -2799,7 +2799,7 @@ class RevisionStore
*
* @param int $id
* @param int $flags
- * @return string|bool False if not found
+ * @return string|false False if not found
*/
public function getTimestampFromId( $id, $flags = 0 ) {
if ( $id instanceof Title ) {
@@ -2923,7 +2923,7 @@ class RevisionStore
* @param PageIdentity $page the associated page
* @param int $revId current revision of this page. Defaults to $title->getLatestRevID().
*
- * @return RevisionRecord|bool Returns false if missing
+ * @return RevisionRecord|false Returns false if missing
*/
public function getKnownCurrentRevision( PageIdentity $page, $revId = 0 ) {
$db = $this->getDBConnectionRef( DB_REPLICA );
diff --git a/includes/Title.php b/includes/Title.php
index c89a9de320db..4e97d82a09a2 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -4128,7 +4128,7 @@ class Title implements LinkTarget, PageIdentity, IDBAccessObject {
* At the moment, this method always returns false. But this may change in the future.
*
* @since 1.36
- * @return bool false
+ * @return string|false Always self::LOCAL
*/
public function getWikiId() {
return self::LOCAL;
diff --git a/includes/WikiMap.php b/includes/WikiMap.php
index 1aef308af3b1..fd82c12e7456 100644
--- a/includes/WikiMap.php
+++ b/includes/WikiMap.php
@@ -166,7 +166,7 @@ class WikiMap {
* @param string $page Page name (must be normalised before calling this function!)
* @param string|null $fragmentId
*
- * @return string|bool URL or false if the wiki was not found
+ * @return string|false URL or false if the wiki was not found
*/
public static function getForeignURL( $wikiID, $page, $fragmentId = null ) {
$wiki = self::getWiki( $wikiID );
@@ -218,7 +218,7 @@ class WikiMap {
/**
* @param string $url
- * @return bool|string Wiki ID or false
+ * @return string|false Wiki ID or false
* @since 1.30
*/
public static function getWikiFromUrl( $url ) {
diff --git a/includes/actions/Action.php b/includes/actions/Action.php
index 148a9c7cfe52..ad3fd1ab7763 100644
--- a/includes/actions/Action.php
+++ b/includes/actions/Action.php
@@ -80,7 +80,7 @@ abstract class Action implements MessageLocalizer {
* @param string $action
* @param Article $article
* @param IContextSource|null $context Falls back to article's context
- * @return Action|bool|null False if the action is disabled, null
+ * @return Action|false|null False if the action is disabled, null
* if it is not recognised
*/
final public static function factory(
diff --git a/includes/actions/ActionFactory.php b/includes/actions/ActionFactory.php
index 6ff285a79d48..3e8ee753b3f3 100644
--- a/includes/actions/ActionFactory.php
+++ b/includes/actions/ActionFactory.php
@@ -219,7 +219,7 @@ class ActionFactory {
/**
* @param string $actionName should already be in all lowercase
- * @return string|callable|bool|Action|array|null The spec for the action, in any valid form,
+ * @return string|callable|false|Action|array|null The spec for the action, in any valid form,
* based on $this->actionsConfig, or if not included there, CORE_ACTIONS, or null if the
* action does not exist.
*/
@@ -243,7 +243,7 @@ class ActionFactory {
* @param string $actionName
* @param Article $article
* @param IContextSource $context
- * @return Action|bool|null False if the action is disabled, null if not recognized
+ * @return Action|false|null False if the action is disabled, null if not recognized
*/
public function getAction(
string $actionName,
diff --git a/includes/actions/RawAction.php b/includes/actions/RawAction.php
index d5e8eeee0687..a75a4605e8aa 100644
--- a/includes/actions/RawAction.php
+++ b/includes/actions/RawAction.php
@@ -223,7 +223,7 @@ class RawAction extends FormlessAction {
* Get the text that should be returned, or false if the page or revision
* was not found.
*
- * @return string|bool
+ * @return string|false
*/
public function getRawText() {
$text = false;
diff --git a/includes/actions/WatchAction.php b/includes/actions/WatchAction.php
index e3e624027d5b..2de7b005872d 100644
--- a/includes/actions/WatchAction.php
+++ b/includes/actions/WatchAction.php
@@ -138,7 +138,7 @@ class WatchAction extends FormAction {
* @todo Move this somewhere better when it's being used in more than just this action.
*
* @param MessageLocalizer $msgLocalizer
- * @param WatchedItem|bool $watchedItem
+ * @param WatchedItem|false $watchedItem
*
* @return mixed[] With keys `options` (string[]) and `default` (string).
*/
diff --git a/includes/actions/pagers/HistoryPager.php b/includes/actions/pagers/HistoryPager.php
index fbf28be1d0e9..0ec26db1e649 100644
--- a/includes/actions/pagers/HistoryPager.php
+++ b/includes/actions/pagers/HistoryPager.php
@@ -324,7 +324,7 @@ class HistoryPager extends ReverseChronologicalPager {
* @todo document some more, and maybe clean up the code (some params redundant?)
*
* @param stdClass $row The database row corresponding to the previous line.
- * @param bool|string $notificationtimestamp
+ * @param string|false $notificationtimestamp
* @param int $resultOffset The offset into the current result set
* @return string HTML output for the row
*/
diff --git a/includes/changetags/ChangeTags.php b/includes/changetags/ChangeTags.php
index 11a04ca8e56d..0d5017500a4b 100644
--- a/includes/changetags/ChangeTags.php
+++ b/includes/changetags/ChangeTags.php
@@ -248,7 +248,7 @@ class ChangeTags {
* @since 1.34
* @param string $tag
* @param MessageLocalizer $context
- * @return Message|bool Tag description, or false if tag is to be hidden.
+ * @return Message|false Tag description, or false if tag is to be hidden.
*/
public static function tagShortDescriptionMessage( $tag, MessageLocalizer $context ) {
$msg = $context->msg( "tag-$tag" );
@@ -277,7 +277,7 @@ class ChangeTags {
*
* @param string $tag
* @param MessageLocalizer $context
- * @return string|bool Tag description or false if tag is to be hidden.
+ * @return string|false Tag description or false if tag is to be hidden.
* @since 1.25 Returns false if tag is to be hidden.
*/
public static function tagDescription( $tag, MessageLocalizer $context ) {
@@ -294,7 +294,7 @@ class ChangeTags {
*
* @param string $tag
* @param MessageLocalizer $context
- * @return Message|bool Message object of the tag long description or false if
+ * @return Message|false Message object of the tag long description or false if
* there is no description.
*/
public static function tagLongDescriptionMessage( $tag, MessageLocalizer $context ) {
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
*
diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php
index cae759f8ea0a..3b35dce68a80 100644
--- a/includes/filerepo/ForeignAPIRepo.php
+++ b/includes/filerepo/ForeignAPIRepo.php
@@ -125,7 +125,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
* files. Well, we don't.
*
* @param PageIdentity|LinkTarget|string $title
- * @param string|bool $time
+ * @param string|false $time
* @return File|false
*/
public function newFile( $title, $time = false ) {
@@ -231,7 +231,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
/**
* @param array $data
- * @return bool|array
+ * @return array|false
*/
public function getImageInfo( $data ) {
if ( $data && isset( $data['query']['pages'] ) ) {
@@ -310,7 +310,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
* @param int $height
* @param string $otherParams
* @param string|null $lang Language code for language of error
- * @return bool|MediaTransformError
+ * @return MediaTransformError|false
* @since 1.22
*/
public function getThumbError(
@@ -353,7 +353,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
* @param int $height
* @param string $params Other rendering parameters (page number, etc)
* from handler's makeParamString.
- * @return bool|string
+ * @return string|false
*/
public function getThumbUrlFromCache( $name, $width, $height, $params = "" ) {
// We can't check the local cache using FileRepo functions because
@@ -466,7 +466,7 @@ class ForeignAPIRepo extends FileRepo implements IForeignRepoWithMWApi {
/**
* Get the local directory corresponding to one of the basic zones
* @param string $zone
- * @return bool|null|string
+ * @return null|string|false
*/
public function getZonePath( $zone ) {
$supported = [ 'public', 'thumb' ];
diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php
index 391e3d3ab4d7..430558669060 100644
--- a/includes/filerepo/LocalRepo.php
+++ b/includes/filerepo/LocalRepo.php
@@ -232,7 +232,7 @@ class LocalRepo extends FileRepo {
* Checks if there is a redirect named as $title
*
* @param PageIdentity|LinkTarget $title Title of file
- * @return bool|Title
+ * @return Title|false
*/
public function checkRedirect( $title ) {
$title = File::normalizeTitle( $title, 'exception' );
diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php
index 793b8967de44..513a934151ef 100644
--- a/includes/filerepo/file/File.php
+++ b/includes/filerepo/file/File.php
@@ -110,10 +110,10 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* The following member variables are not lazy-initialised
*/
- /** @var FileRepo|LocalRepo|ForeignAPIRepo|bool */
+ /** @var FileRepo|LocalRepo|ForeignAPIRepo|false */
public $repo;
- /** @var Title|string|bool */
+ /** @var Title|string|false */
protected $title;
/** @var string Text of last error */
@@ -125,7 +125,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
/** @var Title */
protected $redirectedTitle;
- /** @var FSFile|bool False if undefined */
+ /** @var FSFile|false False if undefined */
protected $fsFile;
/** @var MediaHandler */
@@ -182,8 +182,8 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Most subclasses will want to call assertRepoDefined() here.
*
* @stable to call
- * @param Title|string|bool $title
- * @param FileRepo|bool $repo
+ * @param Title|string|false $title
+ * @param FileRepo|false $repo
*/
public function __construct( $title, $repo ) {
// Some subclasses do not use $title, but set name/title some other way
@@ -199,7 +199,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* valid Title object with namespace NS_FILE or null
*
* @param PageIdentity|LinkTarget|string $title
- * @param string|bool $exception Use 'exception' to throw an error on bad titles
+ * @param string|false $exception Use 'exception' to throw an error on bad titles
* @throws MWException
* @return Title|null
*/
@@ -456,7 +456,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* returns false.
*
* @stable to override
- * @return string|bool ForeignAPIFile::getPath can return false
+ * @return string|false ForeignAPIFile::getPath can return false
*/
public function getPath() {
if ( !isset( $this->path ) ) {
@@ -472,7 +472,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Returns false on failure. Callers must not alter the file.
* Temporary files are cleared automatically.
*
- * @return string|bool False on failure
+ * @return string|false False on failure
*/
public function getLocalRefPath() {
$this->assertRepoDefined();
@@ -503,7 +503,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
*
* @stable to override
* @param int $page
- * @return int|bool
+ * @return int|false
*/
public function getWidth( $page = 1 ) {
return false;
@@ -518,7 +518,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
*
* @stable to override
* @param int $page
- * @return bool|int False on failure
+ * @return int|false False on failure
*/
public function getHeight( $page = 1 ) {
return false;
@@ -531,7 +531,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
*
* @param int $desiredWidth
* @param int $page
- * @return bool|int
+ * @return int|false
*/
public function getThumbnailBucket( $desiredWidth, $page = 1 ) {
$thumbnailBuckets = MediaWikiServices::getInstance()
@@ -1049,7 +1049,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
*
* @param array $handlerParams
*
- * @return ThumbnailImage|MediaTransformOutput|bool False on failure
+ * @return ThumbnailImage|MediaTransformOutput|false False on failure
*/
public function getUnscaledThumb( $handlerParams = [] ) {
$hp =& $handlerParams;
@@ -1172,7 +1172,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* @param array $params An associative array of handler-specific parameters.
* Typical keys are width, height and page.
* @param int $flags A bitfield, may contain self::RENDER_NOW to force rendering
- * @return ThumbnailImage|MediaTransformOutput|bool False on failure
+ * @return ThumbnailImage|MediaTransformOutput|false False on failure
*/
public function transform( $params, $flags = 0 ) {
$thumbnailEpoch = MediaWikiServices::getInstance()->getMainConfig()
@@ -1275,7 +1275,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* @param TempFSFile $tmpFile Temporary file where the rendered thumbnail will be saved
* @param array $transformParams
* @param int $flags
- * @return bool|MediaTransformOutput
+ * @return MediaTransformOutput|false
*/
public function generateAndSaveThumb( $tmpFile, $transformParams, $flags ) {
$ignoreImageErrors = MediaWikiServices::getInstance()->getMainConfig()
@@ -1538,7 +1538,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
/**
* Get a MediaHandler instance for this file
*
- * @return MediaHandler|bool Registered MediaHandler for file's MIME type
+ * @return MediaHandler|false Registered MediaHandler for file's MIME type
* or false if none found
*/
public function getHandler() {
@@ -1709,7 +1709,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the path of an archived file relative to the public zone root
* @stable to override
*
- * @param bool|string $suffix If not false, the name of an archived thumbnail file
+ * @param string|false $suffix If not false, the name of an archived thumbnail file
*
* @return string
*/
@@ -1729,7 +1729,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* thumbnail directory or a particular file if $suffix is specified
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getThumbRel( $suffix = false ) {
@@ -1757,7 +1757,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* or a specific thumb if the $suffix is given.
*
* @param string $archiveName The timestamped name of an archived image
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
private function getArchiveThumbRel( $archiveName, $suffix = false ) {
@@ -1772,7 +1772,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
/**
* Get the path of the archived file.
*
- * @param bool|string $suffix If not false, the name of an archived file.
+ * @param string|false $suffix If not false, the name of an archived file.
* @return string
*/
public function getArchivePath( $suffix = false ) {
@@ -1785,7 +1785,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified
*
* @param string $archiveName The timestamped name of an archived image
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getArchiveThumbPath( $archiveName, $suffix = false ) {
@@ -1799,7 +1799,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the path of the thumbnail directory, or a particular file if $suffix is specified
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getThumbPath( $suffix = false ) {
@@ -1811,7 +1811,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
/**
* Get the path of the transcoded directory, or a particular file if $suffix is specified
*
- * @param bool|string $suffix If not false, the name of a media file
+ * @param string|false $suffix If not false, the name of a media file
* @return string
*/
public function getTranscodedPath( $suffix = false ) {
@@ -1824,7 +1824,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the URL of the archive directory, or a particular file if $suffix is specified
* @stable to override
*
- * @param bool|string $suffix If not false, the name of an archived file
+ * @param string|false $suffix If not false, the name of an archived file
* @return string
*/
public function getArchiveUrl( $suffix = false ) {
@@ -1845,7 +1845,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* @stable to override
*
* @param string $archiveName The timestamped name of an archived image
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getArchiveThumbUrl( $archiveName, $suffix = false ) {
@@ -1864,7 +1864,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the URL of the zone directory, or a particular file if $suffix is specified
*
* @param string $zone Name of requested zone
- * @param bool|string $suffix If not false, the name of a file in zone
+ * @param string|false $suffix If not false, the name of a file in zone
* @return string Path
*/
private function getZoneUrl( $zone, $suffix = false ) {
@@ -1882,7 +1882,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the URL of the thumbnail directory, or a particular file if $suffix is specified
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string Path
*/
public function getThumbUrl( $suffix = false ) {
@@ -1908,7 +1908,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
/**
* Get the URL of the transcoded directory, or a particular file if $suffix is specified
*
- * @param bool|string $suffix If not false, the name of a media file
+ * @param string|false $suffix If not false, the name of a media file
* @return string Path
*/
public function getTranscodedUrl( $suffix = false ) {
@@ -1919,7 +1919,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the public zone virtual URL for a current version source file
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getVirtualUrl( $suffix = false ) {
@@ -1936,7 +1936,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the public zone virtual URL for an archived version source file
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getArchiveVirtualUrl( $suffix = false ) {
@@ -1955,7 +1955,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the virtual URL for a thumbnail file or directory
* @stable to override
*
- * @param bool|string $suffix If not false, the name of a thumbnail file
+ * @param string|false $suffix If not false, the name of a thumbnail file
* @return string
*/
public function getThumbVirtualUrl( $suffix = false ) {
@@ -2045,7 +2045,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Returns the repository
* @stable to override
*
- * @return FileRepo|bool
+ * @return FileRepo|false
*/
public function getRepo() {
return $this->repo;
@@ -2206,7 +2206,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* unknown or not applicable.
*
* @stable to override
- * @return string|bool
+ * @return string|false
*/
public function getDescriptionUrl() {
if ( $this->repo ) {
@@ -2302,7 +2302,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* Get the 14-character timestamp of the file upload
*
* @stable to override
- * @return string|bool TS_MW timestamp or false on failure
+ * @return string|false TS_MW timestamp or false on failure
*/
public function getTimestamp() {
$this->assertRepoDefined();
@@ -2316,7 +2316,7 @@ abstract class File implements IDBAccessObject, MediaHandlerState {
* would be expensive.
* @since 1.25
* @stable to override
- * @return string|bool
+ * @return string|false
*/
public function getDescriptionTouched() {
return false;
diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php
index aa5d42f1e25c..3bfbf5f0290d 100644
--- a/includes/filerepo/file/ForeignAPIFile.php
+++ b/includes/filerepo/file/ForeignAPIFile.php
@@ -37,7 +37,7 @@ class ForeignAPIFile extends File {
protected $repoClass = ForeignAPIRepo::class;
/**
- * @param Title|string|bool $title
+ * @param Title|string|false $title
* @param ForeignApiRepo $repo
* @param array $info
* @param bool $exists
@@ -95,7 +95,7 @@ class ForeignAPIFile extends File {
}
/**
- * @return ForeignAPIRepo|bool
+ * @return ForeignAPIRepo|false
*/
public function getRepo() {
return $this->repo;
@@ -120,7 +120,7 @@ class ForeignAPIFile extends File {
/**
* @param array $params
* @param int $flags
- * @return bool|MediaTransformOutput
+ * @return MediaTransformOutput|false
*/
public function transform( $params, $flags = 0 ) {
if ( !$this->canRender() ) {
@@ -245,7 +245,7 @@ class ForeignAPIFile extends File {
}
/**
- * @return bool|int|null
+ * @return int|null|false
*/
public function getSize() {
return isset( $this->mInfo['size'] ) ? intval( $this->mInfo['size'] ) : null;
@@ -305,7 +305,7 @@ class ForeignAPIFile extends File {
}
/**
- * @return bool|string
+ * @return string|false
*/
public function getTimestamp() {
return wfTimestamp( TS_MW,
@@ -340,7 +340,7 @@ class ForeignAPIFile extends File {
}
/**
- * @return bool|string
+ * @return string|false
*/
public function getDescriptionUrl() {
return $this->mInfo['descriptionurl'] ?? false;
diff --git a/includes/filerepo/file/ForeignDBFile.php b/includes/filerepo/file/ForeignDBFile.php
index f2afeac02be6..c8a2d690cc41 100644
--- a/includes/filerepo/file/ForeignDBFile.php
+++ b/includes/filerepo/file/ForeignDBFile.php
@@ -30,7 +30,7 @@ use Wikimedia\Rdbms\DBUnexpectedError;
class ForeignDBFile extends LocalFile {
/**
- * @return ForeignDBRepo|bool
+ * @return ForeignDBRepo|false
*/
public function getRepo() {
return $this->repo;
diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php
index c67f8639c35a..9d067eb15c67 100644
--- a/includes/filerepo/file/LocalFile.php
+++ b/includes/filerepo/file/LocalFile.php
@@ -227,8 +227,8 @@ class LocalFile extends File {
*
* @param string $sha1 Base-36 SHA-1
* @param LocalRepo $repo
- * @param string|bool $timestamp MW_timestamp (optional)
- * @return bool|LocalFile
+ * @param string|false $timestamp MW_timestamp (optional)
+ * @return static|false
*/
public static function newFromKey( $sha1, $repo, $timestamp = false ) {
$dbr = $repo->getReplicaDB();
@@ -325,7 +325,7 @@ class LocalFile extends File {
}
/**
- * @return LocalRepo|bool
+ * @return LocalRepo|false
*/
public function getRepo() {
return $this->repo;
@@ -335,7 +335,7 @@ class LocalFile extends File {
* Get the memcached key for the main data for this file, or false if
* there is no access to the shared cache.
* @stable to override
- * @return string|bool
+ * @return string|false
*/
protected function getCacheKey() {
return $this->repo->getSharedCacheKey( 'file', sha1( $this->getName() ) );
@@ -560,7 +560,7 @@ class LocalFile extends File {
/**
* @param IDatabase $dbr
* @param string $fname
- * @return string[]|bool
+ * @return string[]|false
*/
private function loadExtraFieldsWithTimestamp( $dbr, $fname ) {
$fieldMap = false;
@@ -1304,7 +1304,7 @@ class LocalFile extends File {
/**
* Get all thumbnail names previously generated for this file
* @stable to override
- * @param string|bool $archiveName Name of an archive file, default false
+ * @param string|false $archiveName Name of an archive file, default false
* @return array First element is the base dir, then files in that base dir.
*/
protected function getThumbnails( $archiveName = false ) {
@@ -1575,7 +1575,7 @@ class LocalFile extends File {
* 1 query for old versions, return first one
* 2, ... return next old version from above query
* @stable to override
- * @return stdClass|bool
+ * @return stdClass|false
*/
public function nextHistoryLine() {
if ( !$this->exists() ) {
@@ -1651,11 +1651,11 @@ class LocalFile extends File {
* @param string $comment Upload description
* @param string $pageText Text to use for the new description page,
* if a new description page is created
- * @param int|bool $flags Flags for publish()
- * @param array|bool $props File properties, if known. This can be used to
+ * @param int $flags Flags for publish()
+ * @param array|false $props File properties, if known. This can be used to
* reduce the upload time when uploading virtual URLs for which the file
* info is already known
- * @param string|bool $timestamp Timestamp for img_timestamp, or false to use the
+ * @param string|false $timestamp Timestamp for img_timestamp, or false to use the
* current time. Can be in any format accepted by ConvertibleTimestamp.
* @param Authority|null $uploader object or null to use the context authority
* @param string[] $tags Change tags to add to the log entry and page revision.
@@ -1761,8 +1761,8 @@ class LocalFile extends File {
* @param string $comment
* @param string $pageText
* @param Authority $performer
- * @param bool|array $props
- * @param string|bool $timestamp Can be in any format accepted by ConvertibleTimestamp
+ * @param array|false $props
+ * @param string|false $timestamp Can be in any format accepted by ConvertibleTimestamp
* @param string[] $tags
* @param bool $createNullRevision Set to false to avoid creation of a null revision on file
* upload, see T193621
@@ -2427,7 +2427,7 @@ class LocalFile extends File {
/**
* Get the URL of the file description page.
* @stable to override
- * @return string|bool
+ * @return string|false
*/
public function getDescriptionUrl() {
if ( !$this->title ) {
@@ -2513,7 +2513,7 @@ class LocalFile extends File {
/**
* @stable to override
- * @return bool|string TS_MW timestamp, a string with 14 digits
+ * @return string|false TS_MW timestamp, a string with 14 digits
*/
public function getTimestamp() {
$this->load();
@@ -2523,7 +2523,7 @@ class LocalFile extends File {
/**
* @stable to override
- * @return bool|string
+ * @return string|false
*/
public function getDescriptionTouched() {
if ( !$this->exists() ) {
diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php
index abf9e99f4ee1..cbb5aa719baa 100644
--- a/includes/filerepo/file/OldLocalFile.php
+++ b/includes/filerepo/file/OldLocalFile.php
@@ -90,9 +90,9 @@ class OldLocalFile extends LocalFile {
*
* @param string $sha1 Base-36 SHA-1
* @param LocalRepo $repo
- * @param string|bool $timestamp MW_timestamp (optional)
+ * @param string|false $timestamp MW_timestamp (optional)
*
- * @return bool|OldLocalFile
+ * @return static|false
*/
public static function newFromKey( $sha1, $repo, $timestamp = false ) {
$dbr = $repo->getReplicaDB();
diff --git a/includes/filerepo/file/UnregisteredLocalFile.php b/includes/filerepo/file/UnregisteredLocalFile.php
index 4a104d01d16a..4c91bdbfed06 100644
--- a/includes/filerepo/file/UnregisteredLocalFile.php
+++ b/includes/filerepo/file/UnregisteredLocalFile.php
@@ -41,7 +41,7 @@ class UnregisteredLocalFile extends File {
/** @var string */
protected $path;
- /** @var bool|string */
+ /** @var string|false */
protected $mime;
/** @var array[]|bool[] Dimension data */
@@ -76,10 +76,10 @@ class UnregisteredLocalFile extends File {
* A FileRepo object is not required here, unlike most other File classes.
*
* @throws MWException
- * @param Title|bool $title
- * @param FileRepo|bool $repo
- * @param string|bool $path
- * @param string|bool $mime
+ * @param Title|false $title
+ * @param FileRepo|false $repo
+ * @param string|false $path
+ * @param string|false $mime
*/
public function __construct( $title = false, $repo = false, $path = false, $mime = false ) {
if ( !( $title && $repo ) && !$path ) {
@@ -109,7 +109,7 @@ class UnregisteredLocalFile extends File {
/**
* @param int $page
- * @return array|bool
+ * @return array|false
*/
private function cachePageDimensions( $page = 1 ) {
$page = (int)$page;
@@ -156,7 +156,7 @@ class UnregisteredLocalFile extends File {
}
/**
- * @return bool|string
+ * @return string|false
*/
public function getMimeType() {
if ( !isset( $this->mime ) ) {
@@ -202,7 +202,7 @@ class UnregisteredLocalFile extends File {
}
/**
- * @return bool|string
+ * @return string|false
*/
public function getURL() {
if ( $this->repo ) {
diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php
index 50bcfb63d7ff..bc5d99b413ce 100644
--- a/includes/jobqueue/JobQueue.php
+++ b/includes/jobqueue/JobQueue.php
@@ -44,7 +44,7 @@ abstract class JobQueue {
protected $claimTTL;
/** @var int Maximum number of times to try a job */
protected $maxTries;
- /** @var string|bool Read only rationale (or false if r/w) */
+ /** @var string|false Read only rationale (or false if r/w) */
protected $readOnlyReason;
/** @var StatsdDataFactoryInterface */
protected $stats;
@@ -211,7 +211,7 @@ abstract class JobQueue {
}
/**
- * @return string|bool Read-only rational or false if r/w
+ * @return string|false Read-only rational or false if r/w
* @since 1.27
*/
public function getReadOnlyReason() {
@@ -395,7 +395,7 @@ abstract class JobQueue {
* Outside callers should use JobQueueGroup::pop() instead of this function.
*
* @throws JobQueueError
- * @return RunnableJob|bool Returns false if there are no jobs
+ * @return RunnableJob|false Returns false if there are no jobs
*/
final public function pop() {
$this->assertNotReadOnly();
@@ -419,7 +419,7 @@ abstract class JobQueue {
/**
* @see JobQueue::pop()
- * @return RunnableJob|bool
+ * @return RunnableJob|false
*/
abstract protected function doPop();
diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php
index 902d4b4a3c5c..12fc10ba51ba 100644
--- a/includes/jobqueue/JobQueueDB.php
+++ b/includes/jobqueue/JobQueueDB.php
@@ -288,7 +288,7 @@ class JobQueueDB extends JobQueue {
/**
* @see JobQueue::doPop()
- * @return RunnableJob|bool
+ * @return RunnableJob|false
*/
protected function doPop() {
$dbw = $this->getPrimaryDB();
@@ -336,7 +336,7 @@ class JobQueueDB extends JobQueue {
* @param string $uuid 32 char hex string
* @param int $rand Random unsigned integer (31 bits)
* @param bool $gte Search for job_random >= $random (otherwise job_random <= $random)
- * @return stdClass|bool Row|false
+ * @return stdClass|false Row|false
*/
protected function claimRandom( $uuid, $rand, $gte ) {
$dbw = $this->getPrimaryDB();
@@ -414,7 +414,7 @@ class JobQueueDB extends JobQueue {
* Reserve a row with a single UPDATE without holding row locks over RTTs...
*
* @param string $uuid 32 char hex string
- * @return stdClass|bool Row|false
+ * @return stdClass|false Row|false
*/
protected function claimOldest( $uuid ) {
$dbw = $this->getPrimaryDB();
@@ -877,7 +877,7 @@ class JobQueueDB extends JobQueue {
}
/**
- * @param array|bool $params
+ * @param array|false $params
* @return string
*/
protected static function makeBlob( $params ) {
diff --git a/includes/jobqueue/JobQueueGroup.php b/includes/jobqueue/JobQueueGroup.php
index 076a6d5f0557..af7e0dde6e1f 100644
--- a/includes/jobqueue/JobQueueGroup.php
+++ b/includes/jobqueue/JobQueueGroup.php
@@ -223,7 +223,7 @@ class JobQueueGroup {
* @param int|string $qtype JobQueueGroup::TYPE_* constant or job type string
* @param int $flags Bitfield of JobQueueGroup::USE_* constants
* @param array $ignored List of job types to ignore
- * @return RunnableJob|bool Returns false on failure
+ * @return RunnableJob|false Returns false on failure
*/
public function pop( $qtype = self::TYPE_DEFAULT, $flags = 0, array $ignored = [] ) {
$job = false;
diff --git a/includes/jobqueue/JobQueueMemory.php b/includes/jobqueue/JobQueueMemory.php
index e6f18c3d9aed..ddbd6d412d6c 100644
--- a/includes/jobqueue/JobQueueMemory.php
+++ b/includes/jobqueue/JobQueueMemory.php
@@ -111,7 +111,7 @@ class JobQueueMemory extends JobQueue {
/**
* @see JobQueue::doPop
*
- * @return RunnableJob|bool
+ * @return RunnableJob|false
*/
protected function doPop() {
if ( $this->doGetSize() == 0 ) {
diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php
index 1cefe35f9e3e..b8fc37a736bb 100644
--- a/includes/jobqueue/JobQueueRedis.php
+++ b/includes/jobqueue/JobQueueRedis.php
@@ -309,7 +309,7 @@ LUA;
/**
* @see JobQueue::doPop()
- * @return RunnableJob|bool
+ * @return RunnableJob|false
* @throws JobQueueError
*/
protected function doPop() {
@@ -628,7 +628,7 @@ LUA;
*
* @param string $uid
* @param RedisConnRef|Redis $conn
- * @return RunnableJob|bool Returns false if the job does not exist
+ * @return RunnableJob|false Returns false if the job does not exist
* @throws JobQueueError
* @throws UnexpectedValueException
*/
@@ -703,7 +703,7 @@ LUA;
/**
* @param array $fields
- * @return RunnableJob|bool
+ * @return RunnableJob|false
*/
protected function getJobFromFields( array $fields ) {
$params = $fields['params'];
@@ -737,7 +737,7 @@ LUA;
/**
* @param string $blob
- * @return array|bool Unserialized version of $blob or false
+ * @return array|false Unserialized version of $blob or false
*/
protected function unserialize( $blob ) {
$fields = unserialize( $blob );
diff --git a/includes/jobqueue/jobs/DoubleRedirectJob.php b/includes/jobqueue/jobs/DoubleRedirectJob.php
index 4f52f5e891ef..0f0a028263e1 100644
--- a/includes/jobqueue/jobs/DoubleRedirectJob.php
+++ b/includes/jobqueue/jobs/DoubleRedirectJob.php
@@ -203,7 +203,7 @@ class DoubleRedirectJob extends Job {
*
* @param LinkTarget $title
*
- * @return Title|bool The final Title after following all redirects, or false if
+ * @return Title|false The final Title after following all redirects, or false if
* the page is not a redirect or the redirect loops.
*/
public static function getFinalDestination( $title ) {
@@ -259,7 +259,7 @@ class DoubleRedirectJob extends Job {
* False will be returned if the user name specified in the
* 'double-redirect-fixer' message is invalid.
*
- * @return User|bool
+ * @return User|false
*/
private function getUser() {
if ( !self::$user ) {
diff --git a/includes/language/dependency/DependencyWrapper.php b/includes/language/dependency/DependencyWrapper.php
index a7220dbd0b25..45b1ffc3382c 100644
--- a/includes/language/dependency/DependencyWrapper.php
+++ b/includes/language/dependency/DependencyWrapper.php
@@ -99,7 +99,7 @@ class DependencyWrapper {
* @param BagOStuff $cache
* @param string $key The cache key
* @param int $expiry The expiry timestamp or interval in seconds
- * @param bool|callable $callback The callback for generating the value, or false
+ * @param callable|false $callback The callback for generating the value, or false
* @param array $callbackParams The function parameters for the callback
* @param array $deps The dependencies to store on a cache miss. Note: these
* are not the dependencies used on a cache hit! Cache hits use the stored
diff --git a/includes/language/dependency/FileDependency.php b/includes/language/dependency/FileDependency.php
index 997ab58dd4e8..579bae207fd3 100644
--- a/includes/language/dependency/FileDependency.php
+++ b/includes/language/dependency/FileDependency.php
@@ -36,7 +36,7 @@ class FileDependency extends CacheDependency {
* @stable to call
*
* @param string $filename The name of the file, preferably fully qualified
- * @param null|bool|int $timestamp The unix last modified timestamp, or false if the
+ * @param null|false|int $timestamp The unix last modified timestamp, or false if the
* file does not exist. If omitted, the timestamp will be loaded from
* the file.
*
diff --git a/includes/page/Article.php b/includes/page/Article.php
index d658d342b3a7..a8aa4d897215 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -68,7 +68,7 @@ class Article implements Page {
/** @var Title|null Title from which we were redirected here, if any. */
public $mRedirectedFrom = null;
- /** @var string|bool URL to redirect to or false if none */
+ /** @var string|false URL to redirect to or false if none */
public $mRedirectUrl = false;
/**
@@ -1942,7 +1942,7 @@ class Article implements Page {
*
* @param int|null $oldid Revision ID or null
* @param UserIdentity|null $user The relevant user
- * @return ParserOutput|bool ParserOutput or false if the given revision ID is not found
+ * @return ParserOutput|false ParserOutput or false if the given revision ID is not found
*/
public function getParserOutput( $oldid = null, UserIdentity $user = null ) {
if ( $user === null ) {
diff --git a/includes/page/Hook/RevisionFromEditCompleteHook.php b/includes/page/Hook/RevisionFromEditCompleteHook.php
index c2a7db5e5f76..96e9e0fcadd2 100644
--- a/includes/page/Hook/RevisionFromEditCompleteHook.php
+++ b/includes/page/Hook/RevisionFromEditCompleteHook.php
@@ -22,7 +22,7 @@ interface RevisionFromEditCompleteHook {
*
* @param WikiPage $wikiPage WikiPage edited
* @param RevisionRecord $rev New revision
- * @param int|bool $originalRevId If the edit restores or repeats an earlier revision (such as a
+ * @param int|false $originalRevId If the edit restores or repeats an earlier revision (such as a
* rollback or a null revision), the ID of that earlier revision. False otherwise.
* (Used to be called $baseID.)
* @param UserIdentity $user Editing user
diff --git a/includes/page/PageArchive.php b/includes/page/PageArchive.php
index 5f8278de8e52..7ba0e20216e0 100644
--- a/includes/page/PageArchive.php
+++ b/includes/page/PageArchive.php
@@ -274,7 +274,7 @@ class PageArchive {
* @param bool $unsuppress
* @param string|string[]|null $tags Change tags to add to log entry
* ($user should be able to add the specified tags before this is called)
- * @return array|bool [ number of file revisions restored, number of image revisions
+ * @return array|false [ number of file revisions restored, number of image revisions
* restored, log message ] on success, false on failure.
*/
public function undeleteAsUser(
diff --git a/includes/page/PageIdentityValue.php b/includes/page/PageIdentityValue.php
index 656afce9b51f..d098a58d4ecf 100644
--- a/includes/page/PageIdentityValue.php
+++ b/includes/page/PageIdentityValue.php
@@ -53,7 +53,7 @@ class PageIdentityValue extends PageReferenceValue implements ProperPageIdentity
* @param int $pageId The ID of this page, or 0 if the page does not exist.
* @param int $namespace A valid namespace ID. Validation is the caller's responsibility!
* @param string $dbKey A valid DB key. Validation is the caller's responsibility!
- * @param string|bool $wikiId The Id of the wiki this page belongs to,
+ * @param string|false $wikiId The Id of the wiki this page belongs to,
* or self::LOCAL for the local wiki.
*
* @return PageIdentityValue|null
@@ -70,7 +70,7 @@ class PageIdentityValue extends PageReferenceValue implements ProperPageIdentity
* @param int $pageId The ID of this page, or 0 if the page does not exist.
* @param int $namespace A valid namespace ID. Validation is the caller's responsibility!
* @param string $dbKey A valid DB key. Validation is the caller's responsibility!
- * @param string|bool $wikiId The Id of the wiki this page belongs to,
+ * @param string|false $wikiId The Id of the wiki this page belongs to,
* or self::LOCAL for the local wiki.
*/
public function __construct( int $pageId, int $namespace, string $dbKey, $wikiId ) {
diff --git a/includes/page/PageReferenceValue.php b/includes/page/PageReferenceValue.php
index a242c0da3507..52e9016b6085 100644
--- a/includes/page/PageReferenceValue.php
+++ b/includes/page/PageReferenceValue.php
@@ -51,13 +51,13 @@ class PageReferenceValue implements PageReference {
/** @var string */
private $dbKey;
- /** @var bool|string */
+ /** @var string|false */
private $wikiId;
/**
* @param int $namespace A valid namespace ID. Validation is the caller's responsibility!
* @param string $dbKey A valid DB key. Validation is the caller's responsibility!
- * @param string|bool $wikiId The Id of the wiki this page belongs to,
+ * @param string|false $wikiId The Id of the wiki this page belongs to,
* or self::LOCAL for the local wiki.
*/
public function __construct( int $namespace, string $dbKey, $wikiId ) {
diff --git a/includes/page/PageStoreRecord.php b/includes/page/PageStoreRecord.php
index a264613bdf3e..3e8652b6de14 100644
--- a/includes/page/PageStoreRecord.php
+++ b/includes/page/PageStoreRecord.php
@@ -60,7 +60,7 @@ class PageStoreRecord extends PageIdentityValue implements ExistingPageRecord {
* The $row object must provide all fields listed in PageStoreRecord::REQUIRED_FIELDS.
*
* @param stdClass $row A row from the page table
- * @param string|bool $wikiId The Id of the wiki this page belongs to,
+ * @param string|false $wikiId The Id of the wiki this page belongs to,
* or self::LOCAL for the local wiki.
*/
public function __construct( stdClass $row, $wikiId ) {
@@ -96,7 +96,7 @@ class PageStoreRecord extends PageIdentityValue implements ExistingPageRecord {
/**
* The ID of the page'S latest revision.
*
- * @param bool $wikiId
+ * @param string|false $wikiId
*
* @return int
*/
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index c11e10b71290..86213ab5e078 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -520,7 +520,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* Load the object from a database row
*
* @since 1.20
- * @param stdClass|bool $data DB row containing fields returned by getQueryInfo() or false
+ * @param stdClass|false $data DB row containing fields returned by getQueryInfo() or false
* @param string|int $from One of the following:
* - "fromdb" or WikiPage::READ_NORMAL if the data comes from a replica DB
* - "fromdbmaster" or WikiPage::READ_LATEST if the data comes from the primary DB
@@ -735,7 +735,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
/**
* Get the page_latest field
- * @param bool $wikiId
+ * @param string|false $wikiId
* @return int The rev_id of current revision
*/
public function getLatest( $wikiId = self::LOCAL ) {
@@ -951,7 +951,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* Determine whether a page would be suitable for being counted as an
* article in the site_stats table based on the title & its content
*
- * @param PreparedEdit|PreparedUpdate|bool $editInfo (false):
+ * @param PreparedEdit|PreparedUpdate|false $editInfo (false):
* An object returned by prepareTextForEdit() or getCurrentUpdate() respectively;
* If false is given, the current database state will be used.
*
@@ -1151,7 +1151,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* objects for same-wiki, non-special redirects and URLs for everything
* else.
* @param Title $rt Redirect target
- * @return bool|Title|string False, Title object of local target, or string with URL
+ * @return Title|string|false False, Title object of local target, or string with URL
*/
public function getRedirectURL( $rt ) {
if ( !$rt ) {
@@ -1266,7 +1266,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* @param null|int $oldid Revision ID to get the text from, passing null or 0 will
* get the current revision (default value)
* @param bool $noCache Do not read from or write to caches.
- * @return bool|ParserOutput ParserOutput or false if the revision was not found or is not public
+ * @return ParserOutput|false ParserOutput or false if the revision was not found or is not public
*/
public function getParserOutput(
?ParserOptions $parserOptions = null, $oldid = null, $noCache = false
@@ -1376,7 +1376,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* @param IDatabase $dbw
* @param int|null $pageId Custom page ID that will be used for the insert statement
*
- * @return bool|int The newly created page_id key; false if the row was not
+ * @return int|false The newly created page_id key; false if the row was not
* inserted, e.g. because the title already existed or because the specified
* page ID is already in use.
*/
@@ -1574,7 +1574,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
}
/**
- * @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 $sectionContent New content of the section.
@@ -1614,7 +1614,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
}
/**
- * @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 $sectionContent New content of the section.
@@ -1822,7 +1822,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* error will be returned. These two conditions are also possible with
* auto-detection due to MediaWiki's performance-optimised locking strategy.
*
- * @param bool|int $originalRevId: The ID of an original revision that the edit
+ * @param int|false $originalRevId: The ID of an original revision that the edit
* restores or repeats. The new revision is expected to have the exact same content as
* the given original revision. This is used with rollbacks and with dummy "null" revisions
* which are created to record things like page moves.
@@ -3001,7 +3001,7 @@ class WikiPage implements Page, IDBAccessObject, PageRecord {
* Auto-generates a deletion reason
*
* @param bool &$hasHistory Whether the page has a history
- * @return string|bool String containing deletion reason or empty string, or boolean false
+ * @return string|false String containing deletion reason or empty string, or boolean false
* if no revision occurred
*/
public function getAutoDeleteReason( &$hasHistory = false ) {
diff --git a/includes/parser/PPDStackElement_Hash.php b/includes/parser/PPDStackElement_Hash.php
index 8f7b0037c310..b758b2bdc452 100644
--- a/includes/parser/PPDStackElement_Hash.php
+++ b/includes/parser/PPDStackElement_Hash.php
@@ -108,7 +108,7 @@ class PPDStackElement_Hash {
/**
* Get the accumulator that would result if the close is not found.
*
- * @param int|bool $openingCount
+ * @param int|false $openingCount
* @return array
*/
public function breakSyntax( $openingCount = false ) {
diff --git a/includes/parser/PPFrame.php b/includes/parser/PPFrame.php
index 692e60773d51..f7fdf96d84a2 100644
--- a/includes/parser/PPFrame.php
+++ b/includes/parser/PPFrame.php
@@ -40,8 +40,8 @@ interface PPFrame {
/**
* Create a child frame
*
- * @param array|bool $args
- * @param bool|Title $title
+ * @param array|false $args
+ * @param Title|false $title
* @param int $indexOffset A number subtracted from the index attributes of the arguments
*
* @return PPFrame
@@ -129,7 +129,7 @@ interface PPFrame {
/**
* Get an argument to this frame by name
* @param int|string $name
- * @return string|bool
+ * @return string|false
*/
public function getArgument( $name );
diff --git a/includes/parser/PPNode.php b/includes/parser/PPNode.php
index 4561657e2faf..40801ee5d405 100644
--- a/includes/parser/PPNode.php
+++ b/includes/parser/PPNode.php
@@ -69,7 +69,7 @@ interface PPNode {
/**
* Returns an item of an array-type node
* @param int $i
- * @return bool|PPNode
+ * @return PPNode|false
*/
public function item( $i );
diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 75540c60f521..1b0110d1ef67 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -863,7 +863,7 @@ class Parser {
*
* @param string $text Text extension wants to have parsed
* @param-taint $text escapes_htmlnoent
- * @param bool|PPFrame $frame The frame to use for expanding any template variables
+ * @param PPFrame|false $frame The frame to use for expanding any template variables
* @return string UNSAFE half-parsed HTML
* @return-taint escaped
* @since 1.8
@@ -888,7 +888,7 @@ class Parser {
*
* @param string $text Text extension wants to have parsed
* @param-taint $text escapes_htmlnoent
- * @param bool|PPFrame $frame The frame to use for expanding any template variables
+ * @param PPFrame|false $frame The frame to use for expanding any template variables
* @return string Fully parsed HTML
* @return-taint escaped
*/
@@ -932,7 +932,7 @@ class Parser {
* @param ?PageReference $page
* @param ParserOptions $options
* @param int|null $revid
- * @param bool|PPFrame $frame
+ * @param PPFrame|false $frame
* @return mixed|string
* @since 1.8
*/
@@ -959,7 +959,7 @@ class Parser {
* hook.
*
* @param string $text Text to be expanded
- * @param bool|PPFrame $frame The frame to use for expanding any template variables
+ * @param PPFrame|false $frame The frame to use for expanding any template variables
* @return string
* @since 1.19
*/
@@ -1572,7 +1572,7 @@ class Parser {
* @param string $text The text to parse
* @param-taint $text escapes_html
* @param bool $isMain Whether this is being called from the main parse() function
- * @param PPFrame|bool $frame A pre-processor frame
+ * @param PPFrame|false $frame A pre-processor frame
*
* @return string
*/
@@ -2242,7 +2242,7 @@ class Parser {
*
* @since 1.21
* @internal
- * @param string|bool $url Optional URL, to extract the domain from for rel =>
+ * @param string|false $url Optional URL, to extract the domain from for rel =>
* nofollow if appropriate
* @param LinkTarget|null $title Optional LinkTarget, for wgNoFollowNsExceptions lookups
* @return string|null Rel attribute for $url
@@ -2825,7 +2825,7 @@ class Parser {
* Return value of a magic variable (like PAGENAME)
*
* @param string $index Magic variable identifier as mapped in MagicWordFactory::$mVariableIDs
- * @param bool|PPFrame $frame
+ * @param PPFrame|false $frame
*
* @return string
*/
@@ -3562,7 +3562,7 @@ class Parser {
* @since 1.34
* @param LinkTarget $link
* @param Parser|null $parser
- * @return RevisionRecord|bool False if missing
+ * @return RevisionRecord|false False if missing
*/
public static function statelessFetchRevisionRecord( LinkTarget $link, $parser = null ) {
if ( $link instanceof PageIdentity ) {
@@ -3625,7 +3625,7 @@ class Parser {
* Can be overridden via ParserOptions::setTemplateCallback().
*
* @param LinkTarget $page
- * @param bool|Parser $parser
+ * @param Parser|false $parser
*
* @return array
* @since 1.12
@@ -3804,7 +3804,7 @@ class Parser {
*
* @param LinkTarget $link
* @param array $options Array of options to RepoGroup::findFile
- * @return File|bool
+ * @return File|false
*/
protected function fetchFileNoRegister( LinkTarget $link, array $options = [] ) {
if ( isset( $options['broken'] ) ) {
@@ -4757,7 +4757,7 @@ class Parser {
* Check that the user's signature contains no bad XML
*
* @param string $text
- * @return string|bool An expanded string, or false if invalid.
+ * @return string|false An expanded string, or false if invalid.
* @since 1.6
*/
public function validateSig( $text ) {
@@ -5331,7 +5331,7 @@ class Parser {
*
* @param LinkTarget $link
* @param string $options
- * @param LinkHolderArray|bool $holders
+ * @param LinkHolderArray|false $holders
* @return string HTML
* @since 1.5
*/
@@ -5638,7 +5638,7 @@ class Parser {
/**
* @param string $caption
- * @param LinkHolderArray|bool $holders
+ * @param LinkHolderArray|false $holders
* @return mixed|string
*/
private function stripAltText( $caption, $holders ) {
@@ -5699,7 +5699,7 @@ class Parser {
* values, so they can be safely tested and escaped.
*
* @param string &$text
- * @param bool|PPFrame $frame
+ * @param PPFrame|false $frame
* @return string
* @deprecated since 1.35, internal callback should not have been public
*/
@@ -6167,7 +6167,7 @@ class Parser {
* Accessor for the 'defaultsort' page property.
* Unlike getDefaultSort(), will return false if none is set
*
- * @return string|bool
+ * @return string|false
* @since 1.14
* @deprecated since 1.38, use
* $parser->getOutput()->getPageProperty('defaultsort') ?? false
diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php
index 8420a3466080..440b64c22167 100644
--- a/includes/parser/ParserOptions.php
+++ b/includes/parser/ParserOptions.php
@@ -821,7 +821,7 @@ class ParserOptions {
/**
* Class to use to wrap output from Parser::parse()
* @since 1.30
- * @return string|bool
+ * @return string|false
*/
public function getWrapOutputClass() {
return $this->getOption( 'wrapclass' );
@@ -832,7 +832,7 @@ class ParserOptions {
* @since 1.30
* @param string $className Class name to use for wrapping.
* Passing false to indicate "no wrapping" was deprecated in MediaWiki 1.31.
- * @return string|bool Current value
+ * @return string|false Current value
*/
public function setWrapOutputClass( $className ) {
if ( $className === true ) { // DWIM, they probably want the default class name
diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php
index d26a1a4a8169..093d0186814a 100644
--- a/includes/parser/ParserOutput.php
+++ b/includes/parser/ParserOutput.php
@@ -1159,7 +1159,7 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
* If $tag is set, the section with that tag will only be included once
* in a given page.
* @param string $section
- * @param string|bool $tag
+ * @param string|false $tag
*/
public function addHeadItem( $section, $tag = false ): void {
if ( $tag !== false ) {
diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php
index 36d59f1adf1e..0e530644bfd3 100644
--- a/includes/parser/Preprocessor_Hash.php
+++ b/includes/parser/Preprocessor_Hash.php
@@ -44,7 +44,7 @@ class Preprocessor_Hash extends Preprocessor {
/** Cache format version */
protected const CACHE_VERSION = 3;
- /** @var int|bool Min wikitext size for which to cache DOM tree */
+ /** @var int|false Min wikitext size for which to cache DOM tree */
protected $cacheThreshold;
/**
diff --git a/includes/parser/RevisionOutputCache.php b/includes/parser/RevisionOutputCache.php
index cbd2a19d3d55..53ad9d2afa2a 100644
--- a/includes/parser/RevisionOutputCache.php
+++ b/includes/parser/RevisionOutputCache.php
@@ -179,7 +179,7 @@ class RevisionOutputCache {
* @param RevisionRecord $revision
* @param ParserOptions $parserOptions
*
- * @return ParserOutput|bool False on failure
+ * @return ParserOutput|false False on failure
*/
public function get( RevisionRecord $revision, ParserOptions $parserOptions ) {
if ( $this->cacheExpiry <= 0 ) {
diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php
index d780f010f0fc..b832b884f689 100644
--- a/includes/parser/Sanitizer.php
+++ b/includes/parser/Sanitizer.php
@@ -936,7 +936,7 @@ class Sanitizer {
* @param string $id String to escape
* @param int $mode One of ID_* constants, specifying whether the primary or fallback encoding
* should be used.
- * @return string|bool Escaped ID or false if fallback encoding is requested but it's not
+ * @return string|false Escaped ID or false if fallback encoding is requested but it's not
* configured.
*
* @since 1.30
diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index 3c77e9896292..911f0dddfe7f 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -61,7 +61,7 @@ abstract class UploadBase {
protected $mRemoveTempFile;
/** @var string|null */
protected $mSourceType;
- /** @var Title|bool|null */
+ /** @var Title|false|null */
protected $mTitle = false;
/** @var int */
protected $mTitleError = 0;
@@ -331,7 +331,7 @@ abstract class UploadBase {
/**
* @param string $srcPath The source path
- * @return string|bool The real path if it was a virtual URL Returns false on failure
+ * @return string|false The real path if it was a virtual URL Returns false on failure
*/
public function getRealPath( $srcPath ) {
$repo = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo();
@@ -2029,7 +2029,7 @@ abstract class UploadBase {
* - The file looks like a thumbnail and the original exists
*
* @param File $file The File object to check
- * @return array|bool False if the file does not exist, else an array
+ * @return array|false False if the file does not exist, else an array
*/
public static function getExistsWarning( $file ) {
if ( $file->exists() ) {
@@ -2246,7 +2246,7 @@ abstract class UploadBase {
*
* @param UserIdentity $user
* @param string $statusKey
- * @return Status[]|bool
+ * @return Status[]|false
*/
public static function getSessionStatus( UserIdentity $user, $statusKey ) {
$store = self::getUploadSessionStore();
@@ -2264,7 +2264,7 @@ abstract class UploadBase {
*
* @param UserIdentity $user
* @param string $statusKey
- * @param array|bool $value
+ * @param array|false $value
* @return void
*/
public static function setSessionStatus( UserIdentity $user, $statusKey, $value ) {
diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php
index dc8340eacf8b..a483508db95b 100644
--- a/includes/upload/UploadFromChunks.php
+++ b/includes/upload/UploadFromChunks.php
@@ -50,8 +50,8 @@ class UploadFromChunks extends UploadFromFile {
* Setup local pointers to stash, repo and user (similar to UploadFromStash)
*
* @param User $user
- * @param UploadStash|bool $stash Default: false
- * @param FileRepo|bool $repo Default: false
+ * @param UploadStash|false $stash Default: false
+ * @param FileRepo|false $repo Default: false
*/
public function __construct( User $user, $stash = false, $repo = false ) {
$this->user = $user;
diff --git a/includes/upload/UploadFromStash.php b/includes/upload/UploadFromStash.php
index 56ee1fff284b..91f6f00f09fe 100644
--- a/includes/upload/UploadFromStash.php
+++ b/includes/upload/UploadFromStash.php
@@ -44,8 +44,8 @@ class UploadFromStash extends UploadBase {
/**
* @param UserIdentity|null $user Default: null Sometimes this won't exist, as when running from cron.
- * @param UploadStash|bool $stash Default: false
- * @param FileRepo|bool $repo Default: false
+ * @param UploadStash|false $stash Default: false
+ * @param FileRepo|false $repo Default: false
*/
public function __construct( UserIdentity $user = null, $stash = false, $repo = false ) {
if ( $repo ) {
diff --git a/includes/user/ActorStoreFactory.php b/includes/user/ActorStoreFactory.php
index 926f4ec34f45..6ad40a5d0220 100644
--- a/includes/user/ActorStoreFactory.php
+++ b/includes/user/ActorStoreFactory.php
@@ -112,7 +112,7 @@ class ActorStoreFactory {
}
/**
- * @param bool $wikiId
+ * @param string|false $wikiId
* @return UserIdentityLookup
*/
public function getUserIdentityLookup(
@@ -134,7 +134,7 @@ class ActorStoreFactory {
* for the given $wikiId.
*
* @param string $table
- * @param bool $wikiId
+ * @param string|false $wikiId
* @return ILoadBalancer
*/
private function getLoadBalancerForTable(
diff --git a/includes/user/User.php b/includes/user/User.php
index 62d6763f49c3..2ade201a7afc 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -222,7 +222,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
/** @var AbstractBlock|null */
private $mBlock;
- /** @var AbstractBlock|bool */
+ /** @var AbstractBlock|false */
private $mBlockedFromCreateAccount = false;
/** @var int User::READ_* constant bitfield used to load data */
@@ -579,7 +579,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* - 'creatable' Valid for batch processes, login and account creation,
* except that true is accepted as an alias for 'valid', for BC.
*
- * @return User|bool User object, or false if the username is invalid
+ * @return User|false User object, or false if the username is invalid
* (e.g. if it contains illegal characters or is an IP address). If the
* username is not present in the database, the result will be a user object
* with a name, zero user ID and default settings.
@@ -687,7 +687,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* @param int|null $userId User ID, if known
* @param string|null $userName User name, if known
* @param int|null $actorId Actor ID, if known
- * @param bool|string $dbDomain remote wiki to which the User/Actor ID applies, or false if none
+ * @param string|false $dbDomain remote wiki to which the User/Actor ID applies, or false if none
* @return User
*/
public static function newFromAnyId( $userId, $userName, $actorId, $dbDomain = false ) {
@@ -1038,7 +1038,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* @note This no longer clears uncached lazy-initialised properties;
* the constructor does that instead.
*
- * @param string|bool $name
+ * @param string|false $name
* @param int|null $actorId
*/
public function loadDefaults( $name = false, $actorId = null ) {
@@ -1965,7 +1965,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* Set the random token (used for persistent authentication)
* Called from loadDefaults() among other places.
*
- * @param string|bool $token If specified, set the token to this value
+ * @param string|false $token If specified, set the token to this value
*/
public function setToken( $token = false ) {
$this->load();
@@ -2123,7 +2123,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* resetting it if it's empty (and saving changes).
*
* @param string $oname The option name to retrieve the token from
- * @return string|bool User's current value for the option, or false if this option is disabled.
+ * @return string|false User's current value for the option, or false if this option is disabled.
* @see resetTokenFromOption()
* @see getOption()
* @deprecated since 1.26 Applications should use the OAuth extension
@@ -2155,7 +2155,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
* *Does not* save user's preferences (similarly to UserOptionsManager::setOption()).
*
* @param string $oname The option name to reset the token in
- * @return string|bool New token value, or false if this option is disabled.
+ * @return string|false New token value, or false if this option is disabled.
* @see getTokenFromOption()
* @see UserOptionsManager::setOption
*/
@@ -2844,7 +2844,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
/**
* Get whether the user is explicitly blocked from account creation.
* @deprecated since 1.37. Instead use Authority::authorize* for createaccount permission.
- * @return bool|AbstractBlock
+ * @return AbstractBlock|false
*/
public function isBlockedFromCreateAccount() {
$this->getBlockedStatus();
@@ -3244,7 +3244,7 @@ class User implements Authority, UserIdentity, UserEmailContact {
/**
* Get the timestamp of account creation.
*
- * @return string|bool|null Timestamp of account creation, false for
+ * @return string|false|null Timestamp of account creation, false for
* non-existent/anonymous user accounts, or null if existing account
* but information is not in database.
*/
diff --git a/includes/user/UserArrayFromResult.php b/includes/user/UserArrayFromResult.php
index c8e9d68de37c..aa02210a88cd 100644
--- a/includes/user/UserArrayFromResult.php
+++ b/includes/user/UserArrayFromResult.php
@@ -42,7 +42,7 @@ class UserArrayFromResult extends UserArray implements Countable {
}
/**
- * @param bool|stdClass $row
+ * @param stdClass|false $row
* @return void
*/
protected function setCurrent( $row ) {
diff --git a/includes/user/UserEditTracker.php b/includes/user/UserEditTracker.php
index 0ee16775fe68..0771e4350672 100644
--- a/includes/user/UserEditTracker.php
+++ b/includes/user/UserEditTracker.php
@@ -33,7 +33,7 @@ class UserEditTracker {
private $jobQueueGroup;
/**
- * @var array
+ * @var int[]
*
* Mapping of user id to edit count for caching
* To avoid using non-sequential numerical keys, keys are in the form: `u⧼user id⧽`
diff --git a/includes/user/UserFactory.php b/includes/user/UserFactory.php
index 4d3ae9dca049..18a305dd16fa 100644
--- a/includes/user/UserFactory.php
+++ b/includes/user/UserFactory.php
@@ -198,7 +198,7 @@ class UserFactory implements IDBAccessObject, UserRigorOptions {
* @param ?int $userId
* @param ?string $userName
* @param ?int $actorId
- * @param bool|string $dbDomain
+ * @param string|false $dbDomain
* @return User
* @throws InvalidArgumentException if none of userId, userName, and actorId are specified
*/
diff --git a/includes/user/UserGroupManager.php b/includes/user/UserGroupManager.php
index a50c57843cf0..04281c72fa10 100644
--- a/includes/user/UserGroupManager.php
+++ b/includes/user/UserGroupManager.php
@@ -163,7 +163,7 @@ class UserGroupManager implements IDBAccessObject {
* @param LoggerInterface $logger
* @param TempUserConfig $tempUserConfig
* @param callable[] $clearCacheCallbacks
- * @param string|bool $dbDomain
+ * @param string|false $dbDomain
*/
public function __construct(
ServiceOptions $options,
@@ -959,7 +959,7 @@ class UserGroupManager implements IDBAccessObject {
* Purge expired memberships from the user_groups table
* @internal
* @note this could be slow and is intended for use in a background job
- * @return int|bool false if purging wasn't attempted (e.g. because of
+ * @return int|false false if purging wasn't attempted (e.g. because of
* readonly), the number of rows purged (might be 0) otherwise
*/
public function purgeExpired() {
diff --git a/includes/user/UserGroupManagerFactory.php b/includes/user/UserGroupManagerFactory.php
index 8976275e10c9..b0949a053a7e 100644
--- a/includes/user/UserGroupManagerFactory.php
+++ b/includes/user/UserGroupManagerFactory.php
@@ -103,7 +103,7 @@ class UserGroupManagerFactory {
}
/**
- * @param string|bool $dbDomain
+ * @param string|false $dbDomain
* @return UserGroupManager
*/
public function getUserGroupManager( $dbDomain = false ): UserGroupManager {
diff --git a/includes/user/UserGroupMembership.php b/includes/user/UserGroupMembership.php
index 57e25f9dbb2d..668880c75032 100644
--- a/includes/user/UserGroupMembership.php
+++ b/includes/user/UserGroupMembership.php
@@ -188,7 +188,7 @@ class UserGroupMembership {
* of the group appears in the UI, it can link to this page.
*
* @param string $group Internal group name
- * @return Title|bool Title of the page if it exists, false otherwise
+ * @return Title|false Title of the page if it exists, false otherwise
*/
public static function getGroupPage( $group ) {
$msg = wfMessage( "grouppage-$group" )->inContentLanguage();
diff --git a/includes/user/UserIdentityValue.php b/includes/user/UserIdentityValue.php
index 445dd5fa57ad..396ab430a1f7 100644
--- a/includes/user/UserIdentityValue.php
+++ b/includes/user/UserIdentityValue.php
@@ -45,7 +45,7 @@ class UserIdentityValue implements UserIdentity {
*/
private $name;
- /** @var bool|string */
+ /** @var string|false */
private $wikiId;
/**
diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php
index 54e929bf8219..ad8b60ba0094 100644
--- a/maintenance/namespaceDupes.php
+++ b/maintenance/namespaceDupes.php
@@ -598,7 +598,7 @@ class NamespaceDupes extends Maintenance {
* @param int $ns The destination namespace ID
* @param string $dbk The source DB key (i.e. page_title)
* @param array $options Associative array of validated command-line options
- * @return Title|bool
+ * @return Title|false
*/
private function getAlternateTitle( $ns, $dbk, $options ) {
$prefix = $options['add-prefix'];
diff --git a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php
index 635e2f6afb1d..2bf1c741303a 100644
--- a/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php
+++ b/tests/phpunit/includes/Revision/MutableRevisionRecordTest.php
@@ -38,7 +38,7 @@ class MutableRevisionRecordTest extends MediaWikiIntegrationTestCase {
* @dataProvider provideConstructor
*
* @param PageIdentity $page
- * @param bool $wikiId
+ * @param string|false $wikiId
* @param string|null $expectedException
*/
public function testConstructorAndGetters(
diff --git a/tests/phpunit/includes/Revision/RevisionArchiveRecordTest.php b/tests/phpunit/includes/Revision/RevisionArchiveRecordTest.php
index 1508647b0d8d..df91c73a9129 100644
--- a/tests/phpunit/includes/Revision/RevisionArchiveRecordTest.php
+++ b/tests/phpunit/includes/Revision/RevisionArchiveRecordTest.php
@@ -128,7 +128,7 @@ class RevisionArchiveRecordTest extends MediaWikiIntegrationTestCase {
* @param CommentStoreComment $comment
* @param stdClass $row
* @param RevisionSlots $slots
- * @param bool $wikiId
+ * @param string|false $wikiId
* @param string|null $expectedException
*/
public function testConstructorAndGetters(
@@ -259,7 +259,7 @@ class RevisionArchiveRecordTest extends MediaWikiIntegrationTestCase {
* @param CommentStoreComment $comment
* @param stdClass $row
* @param RevisionSlots $slots
- * @param bool $wikiId
+ * @param string|false $wikiId
* @param string|null $expectedException
*/
public function testConstructorFailure(
diff --git a/tests/phpunit/includes/Revision/RevisionStoreRecordTest.php b/tests/phpunit/includes/Revision/RevisionStoreRecordTest.php
index f2005bee5568..5f635f93f14f 100644
--- a/tests/phpunit/includes/Revision/RevisionStoreRecordTest.php
+++ b/tests/phpunit/includes/Revision/RevisionStoreRecordTest.php
@@ -140,7 +140,7 @@ class RevisionStoreRecordTest extends MediaWikiIntegrationTestCase {
* @param CommentStoreComment $comment
* @param stdClass $row
* @param RevisionSlots $slots
- * @param bool $wikiId
+ * @param string|false $wikiId
* @param string|null $expectedException
*/
public function testConstructorAndGetters(
@@ -267,7 +267,7 @@ class RevisionStoreRecordTest extends MediaWikiIntegrationTestCase {
* @param CommentStoreComment $comment
* @param stdClass $row
* @param RevisionSlots $slots
- * @param bool $wikiId
+ * @param string|false $wikiId
*/
public function testConstructorFailure(
PageIdentity $page,
diff --git a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
index 6344d7d5715d..e70bb0adfb12 100644
--- a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
+++ b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php
@@ -448,7 +448,7 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiIntegrati
/**
* @dataProvider provideProviderChangeAuthenticationData
- * @param callable|bool $usernameTransform
+ * @param callable|false $usernameTransform
* @param string $type
* @param bool $loginOnly
* @param bool $changed
diff --git a/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php b/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
index b418d0dd41ad..bdd598d273d5 100644
--- a/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
+++ b/tests/phpunit/unit/includes/dao/WikiAwareEntityTraitTest.php
@@ -16,18 +16,18 @@ use Wikimedia\TestingAccessWrapper;
class WikiAwareEntityTraitTest extends MediaWikiUnitTestCase {
/**
- * @param string|bool $wikiId
+ * @param string|false $wikiId
* @return WikiAwareEntity
*/
public function getEntityInstance( $wikiId ) {
$entity = new class( $wikiId ) implements WikiAwareEntity {
use WikiAwareEntityTrait;
- /** @var string|bool */
+ /** @var string|false */
private $wikiId;
/**
- * @param string|bool $wikiId
+ * @param string|false $wikiId
*/
public function __construct( $wikiId ) {
$this->wikiId = $wikiId;