Code Duplication    Length = 7-8 lines in 4 locations

includes/page/WikiPage.php 4 locations

@@ 680-686 (lines=7) @@
677
	 *
678
	 * @since 1.21
679
	 */
680
	public function getContent( $audience = Revision::FOR_PUBLIC, User $user = null ) {
681
		$this->loadLastEdit();
682
		if ( $this->mLastRevision ) {
683
			return $this->mLastRevision->getContent( $audience, $user );
684
		}
685
		return null;
686
	}
687
688
	/**
689
	 * Get the text of the current revision. No side-effects...
@@ 740-747 (lines=8) @@
737
	 *   to the $audience parameter
738
	 * @return int User ID for the user that made the last article revision
739
	 */
740
	public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
741
		$this->loadLastEdit();
742
		if ( $this->mLastRevision ) {
743
			return $this->mLastRevision->getUser( $audience, $user );
744
		} else {
745
			return -1;
746
		}
747
	}
748
749
	/**
750
	 * Get the User object of the user who created the page
@@ 778-785 (lines=8) @@
775
	 *   to the $audience parameter
776
	 * @return string Username of the user that made the last article revision
777
	 */
778
	public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
779
		$this->loadLastEdit();
780
		if ( $this->mLastRevision ) {
781
			return $this->mLastRevision->getUserText( $audience, $user );
782
		} else {
783
			return '';
784
		}
785
	}
786
787
	/**
788
	 * @param int $audience One of:
@@ 796-803 (lines=8) @@
793
	 *   to the $audience parameter
794
	 * @return string Comment stored for the last article revision
795
	 */
796
	public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
797
		$this->loadLastEdit();
798
		if ( $this->mLastRevision ) {
799
			return $this->mLastRevision->getComment( $audience, $user );
800
		} else {
801
			return '';
802
		}
803
	}
804
805
	/**
806
	 * Returns true if last revision was marked as "minor edit"