Code Duplication    Length = 17-17 lines in 2 locations

includes/Title.php 2 locations

@@ 3920-3936 (lines=17) @@
3917
	 * @param int $flags Title::GAID_FOR_UPDATE
3918
	 * @return int|bool Old revision ID, or false if none exists
3919
	 */
3920
	public function getPreviousRevisionID( $revId, $flags = 0 ) {
3921
		$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
3922
		$revId = $db->selectField( 'revision', 'rev_id',
3923
			[
3924
				'rev_page' => $this->getArticleID( $flags ),
3925
				'rev_id < ' . intval( $revId )
3926
			],
3927
			__METHOD__,
3928
			[ 'ORDER BY' => 'rev_id DESC' ]
3929
		);
3930
3931
		if ( $revId === false ) {
3932
			return false;
3933
		} else {
3934
			return intval( $revId );
3935
		}
3936
	}
3937
3938
	/**
3939
	 * Get the revision ID of the next revision
@@ 3945-3961 (lines=17) @@
3942
	 * @param int $flags Title::GAID_FOR_UPDATE
3943
	 * @return int|bool Next revision ID, or false if none exists
3944
	 */
3945
	public function getNextRevisionID( $revId, $flags = 0 ) {
3946
		$db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
3947
		$revId = $db->selectField( 'revision', 'rev_id',
3948
			[
3949
				'rev_page' => $this->getArticleID( $flags ),
3950
				'rev_id > ' . intval( $revId )
3951
			],
3952
			__METHOD__,
3953
			[ 'ORDER BY' => 'rev_id' ]
3954
		);
3955
3956
		if ( $revId === false ) {
3957
			return false;
3958
		} else {
3959
			return intval( $revId );
3960
		}
3961
	}
3962
3963
	/**
3964
	 * Get the first revision of the page