Code Duplication    Length = 9-12 lines in 3 locations

includes/Revision.php 2 locations

@@ 829-837 (lines=9) @@
826
	 *   to the $audience parameter
827
	 * @return int
828
	 */
829
	public function getUser( $audience = self::FOR_PUBLIC, User $user = null ) {
830
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
831
			return 0;
832
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
833
			return 0;
834
		} else {
835
			return $this->mUser;
836
		}
837
	}
838
839
	/**
840
	 * Fetch revision's user id without regard for the current user's permissions
@@ 905-913 (lines=9) @@
902
	 *   to the $audience parameter
903
	 * @return string
904
	 */
905
	function getComment( $audience = self::FOR_PUBLIC, User $user = null ) {
906
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
907
			return '';
908
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $user ) ) {
909
			return '';
910
		} else {
911
			return $this->mComment;
912
		}
913
	}
914
915
	/**
916
	 * Fetch revision comment without regard for the current user's permissions

includes/filerepo/file/LocalFile.php 1 location

@@ 1828-1839 (lines=12) @@
1825
	 * @param User $user
1826
	 * @return string
1827
	 */
1828
	function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
1829
		$this->load();
1830
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
1831
			return '';
1832
		} elseif ( $audience == self::FOR_THIS_USER
1833
			&& !$this->userCan( self::DELETED_COMMENT, $user )
1834
		) {
1835
			return '';
1836
		} else {
1837
			return $this->description;
1838
		}
1839
	}
1840
1841
	/**
1842
	 * @return bool|string