Code Duplication    Length = 9-12 lines in 3 locations

includes/filerepo/file/LocalFile.php 1 location

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

includes/Revision.php 2 locations

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