From 0df357b9137ac96ebb6d59bccb99ba9c4680bf46 Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Sun, 8 Apr 2018 11:32:20 +0200 Subject: [PATCH] Fix (MediaWiki)Site::normalizePageName return type I checked all callers of these methods and almost all of them expect the method to return false. It looks like this return type was known at some point, but got lost. Let's add it back. Bug: T191634 Change-Id: I43484835b8f26e07ada6a2b1452a99ccc6d9b438 --- includes/site/MediaWikiPageNameNormalizer.php | 4 ++-- includes/site/MediaWikiSite.php | 4 ++-- includes/site/Site.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/site/MediaWikiPageNameNormalizer.php b/includes/site/MediaWikiPageNameNormalizer.php index c4e490a4c7..3e073f0882 100644 --- a/includes/site/MediaWikiPageNameNormalizer.php +++ b/includes/site/MediaWikiPageNameNormalizer.php @@ -53,7 +53,7 @@ class MediaWikiPageNameNormalizer { /** * Returns the normalized form of the given page title, using the * normalization rules of the given site. If the given title is a redirect, - * the redirect weill be resolved and the redirect target is returned. + * the redirect will be resolved and the redirect target is returned. * * @note This actually makes an API request to the remote site, so beware * that this function is slow and depends on an external service. @@ -65,7 +65,7 @@ class MediaWikiPageNameNormalizer { * @param string $pageName * @param string $apiUrl * - * @return string + * @return string|false * @throws \MWException */ public function normalizePageName( $pageName, $apiUrl ) { diff --git a/includes/site/MediaWikiSite.php b/includes/site/MediaWikiSite.php index f31a77d3a4..0ff7e8bad4 100644 --- a/includes/site/MediaWikiSite.php +++ b/includes/site/MediaWikiSite.php @@ -64,7 +64,7 @@ class MediaWikiSite extends Site { /** * Returns the normalized form of the given page title, using the * normalization rules of the given site. If the given title is a redirect, - * the redirect weill be resolved and the redirect target is returned. + * the redirect will be resolved and the redirect target is returned. * * @note This actually makes an API request to the remote site, so beware * that this function is slow and depends on an external service. @@ -79,7 +79,7 @@ class MediaWikiSite extends Site { * * @param string $pageName * - * @return string + * @return string|false * @throws MWException */ public function normalizePageName( $pageName ) { diff --git a/includes/site/Site.php b/includes/site/Site.php index a6e63391da..55aad77831 100644 --- a/includes/site/Site.php +++ b/includes/site/Site.php @@ -391,7 +391,7 @@ class Site implements Serializable { * * @param string $pageName * - * @return string + * @return string|false */ public function normalizePageName( $pageName ) { return $pageName; -- 2.20.1