Add null to @return tags if a method can return null
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Mon, 5 Oct 2015 15:53:13 +0000 (17:53 +0200)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Mon, 5 Oct 2015 15:53:13 +0000 (17:53 +0200)
Change-Id: I420998351663d92c4a101f61842e40591eebcd5f

includes/Title.php
includes/User.php
includes/api/ApiModuleManager.php
includes/cache/MessageBlobStore.php
includes/filerepo/file/File.php
includes/page/WikiPage.php
includes/search/SearchResult.php
includes/search/SearchResultSet.php
includes/upload/UploadStash.php
includes/utils/IP.php

index eac712b..9e78e10 100644 (file)
@@ -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 ) ) {
index 4822f53..e523b68 100644 (file)
@@ -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();
index ba6c144..7c0a430 100644 (file)
@@ -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] ) ) {
index 19349b2..63d8c7e 100644 (file)
@@ -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 ) {
index cde5e6a..fc9870a 100644 (file)
@@ -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() ) {
index d3978ea..409e7ea 100644 (file)
@@ -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
         */
index d384ae9..7bfcd45 100644 (file)
@@ -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;
index 8d18b0e..6178756 100644 (file)
@@ -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;
index 1f796a4..b9a1bbf 100644 (file)
@@ -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 );
index 666660a..9f52249 100644 (file)
@@ -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)