Code Duplication    Length = 9-12 lines in 3 locations

includes/Revision.php 2 locations

@@ 846-854 (lines=9) @@
843
	 *   to the $audience parameter
844
	 * @return int
845
	 */
846
	public function getUser( $audience = self::FOR_PUBLIC, User $user = null ) {
847
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_USER ) ) {
848
			return 0;
849
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_USER, $user ) ) {
850
			return 0;
851
		} else {
852
			return $this->mUser;
853
		}
854
	}
855
856
	/**
857
	 * Fetch revision's user id without regard for the current user's permissions
@@ 922-930 (lines=9) @@
919
	 *   to the $audience parameter
920
	 * @return string
921
	 */
922
	function getComment( $audience = self::FOR_PUBLIC, User $user = null ) {
923
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
924
			return '';
925
		} elseif ( $audience == self::FOR_THIS_USER && !$this->userCan( self::DELETED_COMMENT, $user ) ) {
926
			return '';
927
		} else {
928
			return $this->mComment;
929
		}
930
	}
931
932
	/**
933
	 * Fetch revision comment without regard for the current user's permissions

includes/filerepo/file/LocalFile.php 1 location

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