Code Duplication    Length = 7-8 lines in 4 locations

includes/page/WikiPage.php 4 locations

@@ 664-670 (lines=7) @@
661
	 *
662
	 * @since 1.21
663
	 */
664
	public function getContent( $audience = Revision::FOR_PUBLIC, User $user = null ) {
665
		$this->loadLastEdit();
666
		if ( $this->mLastRevision ) {
667
			return $this->mLastRevision->getContent( $audience, $user );
668
		}
669
		return null;
670
	}
671
672
	/**
673
	 * Get the text of the current revision. No side-effects...
@@ 724-731 (lines=8) @@
721
	 *   to the $audience parameter
722
	 * @return int User ID for the user that made the last article revision
723
	 */
724
	public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) {
725
		$this->loadLastEdit();
726
		if ( $this->mLastRevision ) {
727
			return $this->mLastRevision->getUser( $audience, $user );
728
		} else {
729
			return -1;
730
		}
731
	}
732
733
	/**
734
	 * Get the User object of the user who created the page
@@ 762-769 (lines=8) @@
759
	 *   to the $audience parameter
760
	 * @return string Username of the user that made the last article revision
761
	 */
762
	public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) {
763
		$this->loadLastEdit();
764
		if ( $this->mLastRevision ) {
765
			return $this->mLastRevision->getUserText( $audience, $user );
766
		} else {
767
			return '';
768
		}
769
	}
770
771
	/**
772
	 * @param int $audience One of:
@@ 780-787 (lines=8) @@
777
	 *   to the $audience parameter
778
	 * @return string Comment stored for the last article revision
779
	 */
780
	public function getComment( $audience = Revision::FOR_PUBLIC, User $user = null ) {
781
		$this->loadLastEdit();
782
		if ( $this->mLastRevision ) {
783
			return $this->mLastRevision->getComment( $audience, $user );
784
		} else {
785
			return '';
786
		}
787
	}
788
789
	/**
790
	 * Returns true if last revision was marked as "minor edit"