Code Duplication    Length = 9-12 lines in 3 locations

includes/filerepo/file/LocalFile.php 1 location

@@ 1886-1897 (lines=12) @@
1883
	 * @param User $user
1884
	 * @return string
1885
	 */
1886
	function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
1887
		$this->load();
1888
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
1889
			return '';
1890
		} elseif ( $audience == self::FOR_THIS_USER
1891
			&& !$this->userCan( self::DELETED_COMMENT, $user )
1892
		) {
1893
			return '';
1894
		} else {
1895
			return $this->description;
1896
		}
1897
	}
1898
1899
	/**
1900
	 * @return bool|string

includes/Revision.php 2 locations

@@ 864-872 (lines=9) @@
861
	 *   to the $audience parameter
862
	 * @return int
863
	 */
864
	public function getUser( $audience = self::FOR_PUBLIC, User $user = null ) {
865
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
866
			return 0;
867
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
868
			return 0;
869
		} else {
870
			return $this->mUser;
871
		}
872
	}
873
874
	/**
875
	 * Fetch revision's user id without regard for the current user's permissions
@@ 942-950 (lines=9) @@
939
	 *   to the $audience parameter
940
	 * @return string
941
	 */
942
	function getComment( $audience = self::FOR_PUBLIC, User $user = null ) {
943
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
944
			return '';
945
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $user ) ) {
946
			return '';
947
		} else {
948
			return $this->mComment;
949
		}
950
	}
951
952
	/**
953
	 * Fetch revision comment without regard for the current user's permissions