From 56d2a644f757ff82d7f4b9c7fc646cdd708ad8fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Mon, 5 Oct 2015 17:53:13 +0200 Subject: [PATCH] Add null to @return tags if a method can return null Change-Id: I420998351663d92c4a101f61842e40591eebcd5f --- includes/Title.php | 2 +- includes/User.php | 2 +- includes/api/ApiModuleManager.php | 2 +- includes/cache/MessageBlobStore.php | 2 +- includes/filerepo/file/File.php | 6 +++--- includes/page/WikiPage.php | 6 +++--- includes/search/SearchResult.php | 4 ++-- includes/search/SearchResultSet.php | 2 +- includes/upload/UploadStash.php | 2 +- includes/utils/IP.php | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index eac712bede..9e78e107e3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -530,7 +530,7 @@ class Title { * @param string $title Database key form * @param string $fragment The link fragment (after the "#") * @param string $interwiki Interwiki prefix - * @return Title The new object, or null on an error + * @return Title|null The new object, or null on an error */ public static function makeTitleSafe( $ns, $title, $fragment = '', $interwiki = '' ) { if ( !MWNamespace::exists( $ns ) ) { diff --git a/includes/User.php b/includes/User.php index 4822f537d3..e523b684b4 100644 --- a/includes/User.php +++ b/includes/User.php @@ -935,7 +935,7 @@ class User implements IDBAccessObject { * the cached User object, we assume that whatever mechanism is setting * the expiration date is also expiring the User cache. * @since 1.23 - * @return string|bool The datestamp of the expiration, or null if not set + * @return string|null The datestamp of the expiration, or null if not set */ public function getPasswordExpireDate() { $this->load(); diff --git a/includes/api/ApiModuleManager.php b/includes/api/ApiModuleManager.php index ba6c144335..7c0a4306e0 100644 --- a/includes/api/ApiModuleManager.php +++ b/includes/api/ApiModuleManager.php @@ -275,7 +275,7 @@ class ApiModuleManager extends ContextSource { /** * Returns the group name for the given module * @param string $moduleName - * @return string Group name or null if missing + * @return string|null Group name or null if missing */ public function getModuleGroup( $moduleName ) { if ( isset( $this->mModules[$moduleName] ) ) { diff --git a/includes/cache/MessageBlobStore.php b/includes/cache/MessageBlobStore.php index 19349b2d6a..63d8c7e473 100644 --- a/includes/cache/MessageBlobStore.php +++ b/includes/cache/MessageBlobStore.php @@ -167,7 +167,7 @@ class MessageBlobStore { * @param string $name Module name * @param ResourceLoaderModule $module * @param string $lang Language code - * @return string Regenerated message blob, or null if there was no blob for + * @return string|null Regenerated message blob, or null if there was no blob for * the given module/language pair. */ public function updateModule( $name, ResourceLoaderModule $module, $lang ) { diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index cde5e6afde..fc9870ac44 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -574,7 +574,7 @@ abstract class File implements IDBAccessObject { * In files that support multiple language, what is the default language * to use if none specified. * - * @return string Lang code, or null if filetype doesn't support multiple languages. + * @return string|null Lang code, or null if filetype doesn't support multiple languages. * @since 1.23 */ public function getDefaultRenderLanguage() { @@ -922,7 +922,7 @@ abstract class File implements IDBAccessObject { * * @param array $params Handler-specific parameters * @param int $flags Bitfield that supports THUMB_* constants - * @return string + * @return string|null */ public function thumbName( $params, $flags = 0 ) { $name = ( $this->repo && !( $flags & self::THUMB_FULL_NAME ) ) @@ -937,7 +937,7 @@ abstract class File implements IDBAccessObject { * * @param string $name * @param array $params Parameters which will be passed to MediaHandler::makeParamString - * @return string + * @return string|null */ public function generateThumbName( $name, $params ) { if ( !$this->getHandler() ) { diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index d3978eac7f..409e7ea079 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1421,7 +1421,7 @@ class WikiPage implements Page, IDBAccessObject { * @param string $edittime Revision timestamp or null to use the current revision. * * @throws MWException - * @return string New complete article text, or null if error. + * @return string|null New complete article text, or null if error. * * @deprecated since 1.21, use replaceSectionAtRev() instead */ @@ -1473,7 +1473,7 @@ class WikiPage implements Page, IDBAccessObject { * @param string $edittime Revision timestamp or null to use the current revision. * * @throws MWException - * @return Content New complete article content, or null if error. + * @return Content|null New complete article content, or null if error. * * @since 1.21 * @deprecated since 1.24, use replaceSectionAtRev instead @@ -1512,7 +1512,7 @@ class WikiPage implements Page, IDBAccessObject { * @param int|null $baseRevId * * @throws MWException - * @return Content New complete article content, or null if error. + * @return Content|null New complete article content, or null if error. * * @since 1.24 */ diff --git a/includes/search/SearchResult.php b/includes/search/SearchResult.php index d384ae96c8..7bfcd4546f 100644 --- a/includes/search/SearchResult.php +++ b/includes/search/SearchResult.php @@ -165,7 +165,7 @@ class SearchResult { } /** - * @return Title Title object for the redirect to this page, null if none or not supported + * @return Title|null Title object for the redirect to this page, null if none or not supported */ function getRedirectTitle() { return null; @@ -179,7 +179,7 @@ class SearchResult { } /** - * @return Title Title object (pagename+fragment) for the section, null if none or not supported + * @return Title|null Title object (pagename+fragment) for the section, null if none or not supported */ function getSectionTitle() { return null; diff --git a/includes/search/SearchResultSet.php b/includes/search/SearchResultSet.php index 8d18b0e6ed..6178756218 100644 --- a/includes/search/SearchResultSet.php +++ b/includes/search/SearchResultSet.php @@ -98,7 +98,7 @@ class SearchResultSet { } /** - * @return string Suggested query, null if none + * @return string|null Suggested query, null if none */ function getSuggestionQuery() { return null; diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 1f796a4528..b9a1bbf14f 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -625,7 +625,7 @@ class UploadStashFile extends UnregisteredLocalFile { * * @param array $params Handler-specific parameters * @param int $flags Bitfield that supports THUMB_* constants - * @return string Base name for URL, like '120px-12345.jpg', or null if there is no handler + * @return string|null Base name for URL, like '120px-12345.jpg', or null if there is no handler */ function thumbName( $params, $flags = 0 ) { return $this->generateThumbName( $this->getUrlName(), $params ); diff --git a/includes/utils/IP.php b/includes/utils/IP.php index 666660aa30..9f522495ac 100644 --- a/includes/utils/IP.php +++ b/includes/utils/IP.php @@ -659,7 +659,7 @@ class IP { * unusual representations may be added later. * * @param string $addr Something that might be an IP address - * @return string Valid dotted quad IPv4 address or null + * @return string|null Valid dotted quad IPv4 address or null */ public static function canonicalize( $addr ) { // remove zone info (bug 35738) -- 2.20.1