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

@@ 1845-1856 (lines=12) @@
1842
	 * @param User $user
1843
	 * @return string
1844
	 */
1845
	function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
1846
		$this->load();
1847
		if ( $audience == self::FOR_PUBLIC && $this->isDeleted( self::DELETED_COMMENT ) ) {
1848
			return '';
1849
		} elseif ( $audience == self::FOR_THIS_USER
1850
			&& !$this->userCan( self::DELETED_COMMENT, $user )
1851
		) {
1852
			return '';
1853
		} else {
1854
			return $this->description;
1855
		}
1856
	}
1857
1858
	/**
1859
	 * @return bool|string