Avoid usage of deprecated Revision::* constants
authorDerick Alangi <alangiderick@gmail.com>
Sun, 21 Jul 2019 14:32:13 +0000 (15:32 +0100)
committerDerick Alangi <alangiderick@gmail.com>
Sun, 21 Jul 2019 16:26:48 +0000 (17:26 +0100)
Change-Id: Ibb55d5a01f997f9c79bcf2f5e09d4f02d22152d2

includes/changes/ChangesList.php
includes/diff/DifferenceEngine.php
includes/page/Article.php
includes/page/WikiPage.php

index 4e32385..0b0378c 100644 (file)
@@ -614,7 +614,7 @@ class ChangesList extends ContextSource {
         * @return string
         */
        public function insertComment( $rc ) {
-               if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) {
+               if ( $this->isDeleted( $rc, RevisionRecord::DELETED_COMMENT ) ) {
                        return ' <span class="history-deleted">' .
                                $this->msg( 'rev-deleted-comment' )->escaped() . '</span>';
                } else {
index cd51445..54cd9ca 100644 (file)
@@ -1869,13 +1869,17 @@ class DifferenceEngine extends ContextSource {
                }
 
                if ( $this->mOldRev ) {
-                       $this->mOldContent = $this->mOldRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+                       $this->mOldContent = $this->mOldRev->getContent(
+                               RevisionRecord::FOR_THIS_USER, $this->getUser()
+                       );
                        if ( $this->mOldContent === null ) {
                                return false;
                        }
                }
 
-               $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+               $this->mNewContent = $this->mNewRev->getContent(
+                       RevisionRecord::FOR_THIS_USER, $this->getUser()
+               );
                Hooks::run( 'DifferenceEngineLoadTextAfterNewContentIsLoaded', [ $this ] );
                if ( $this->mNewContent === null ) {
                        return false;
@@ -1900,7 +1904,9 @@ class DifferenceEngine extends ContextSource {
                        return false;
                }
 
-               $this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
+               $this->mNewContent = $this->mNewRev->getContent(
+                       RevisionRecord::FOR_THIS_USER, $this->getUser()
+               );
 
                Hooks::run( 'DifferenceEngineAfterLoadNewText', [ $this ] );
 
index a9ef2c1..f158e4d 100644 (file)
@@ -2414,7 +2414,7 @@ class Article implements Page {
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getComment
         */
-       public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getComment( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                return $this->mPage->getComment( $audience, $user );
        }
 
@@ -2446,7 +2446,7 @@ class Article implements Page {
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getCreator
         */
-       public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getCreator( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                return $this->mPage->getCreator( $audience, $user );
        }
 
@@ -2558,7 +2558,7 @@ class Article implements Page {
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getUser
         */
-       public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getUser( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                return $this->mPage->getUser( $audience, $user );
        }
 
@@ -2566,7 +2566,7 @@ class Article implements Page {
         * Call to WikiPage function for backwards compatibility.
         * @see WikiPage::getUserText
         */
-       public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getUserText( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                return $this->mPage->getUserText( $audience, $user );
        }
 
index adc62a1..173fdc6 100644 (file)
@@ -813,7 +813,7 @@ class WikiPage implements Page, IDBAccessObject {
         *
         * @since 1.21
         */
-       public function getContent( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getContent( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                $this->loadLastEdit();
                if ( $this->mLastRevision ) {
                        return $this->mLastRevision->getContent( $audience, $user );
@@ -851,7 +851,7 @@ class WikiPage implements Page, IDBAccessObject {
         *   to the $audience parameter
         * @return int User ID for the user that made the last article revision
         */
-       public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getUser( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                $this->loadLastEdit();
                if ( $this->mLastRevision ) {
                        return $this->mLastRevision->getUser( $audience, $user );
@@ -870,7 +870,7 @@ class WikiPage implements Page, IDBAccessObject {
         *   to the $audience parameter
         * @return User|null
         */
-       public function getCreator( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getCreator( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                $revision = $this->getOldestRevision();
                if ( $revision ) {
                        $userName = $revision->getUserText( $audience, $user );
@@ -889,7 +889,7 @@ class WikiPage implements Page, IDBAccessObject {
         *   to the $audience parameter
         * @return string Username of the user that made the last article revision
         */
-       public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
+       public function getUserText( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                $this->loadLastEdit();
                if ( $this->mLastRevision ) {
                        return $this->mLastRevision->getUserText( $audience, $user );
@@ -908,7 +908,7 @@ class WikiPage implements Page, IDBAccessObject {
         * @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 ) {
+       public function getComment( $audience = RevisionRecord::FOR_PUBLIC, User $user = null ) {
                $this->loadLastEdit();
                if ( $this->mLastRevision ) {
                        return $this->mLastRevision->getComment( $audience, $user );