Merge "Fix documentation for Revision::getComment and WikiPage::getComment"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 16 Feb 2019 10:59:48 +0000 (10:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 16 Feb 2019 10:59:48 +0000 (10:59 +0000)
includes/Revision.php
includes/page/WikiPage.php

index aaf1069..f2ca79a 100644 (file)
@@ -832,17 +832,15 @@ class Revision implements IDBAccessObject {
        }
 
        /**
-        * Fetch revision comment if it's available to the specified audience.
-        * If the specified audience does not have access to the comment, an
-        * empty string will be returned.
-        *
         * @param int $audience One of:
         *   Revision::FOR_PUBLIC       to be displayed to all users
         *   Revision::FOR_THIS_USER    to be displayed to the given user
         *   Revision::RAW              get the text regardless of permissions
         * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
         *   to the $audience parameter
-        * @return string
+        *
+        * @return string|null Returns null if the specified audience does not have access to the
+        *  comment.
         */
        function getComment( $audience = self::FOR_PUBLIC, User $user = null ) {
                global $wgUser;
index 072c3c6..df9259b 100644 (file)
@@ -895,7 +895,8 @@ class WikiPage implements Page, IDBAccessObject {
         *   Revision::RAW              get the text regardless of permissions
         * @param User|null $user User object to check for, only if FOR_THIS_USER is passed
         *   to the $audience parameter
-        * @return string Comment stored for the last article revision
+        * @return string|null Comment stored for the last article revision, or null if the specified
+        *  audience does not have access to the comment.
         */
        public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
                $this->loadLastEdit();