Code Duplication    Length = 9-9 lines in 2 locations

includes/api/ApiSetNotificationTimestamp.php 2 locations

@@ 77-85 (lines=9) @@
74
				$this->dieUsage( 'torevid may only be used with a single page', 'multpages' );
75
			}
76
			$title = reset( $pageSet->getGoodTitles() );
77
			if ( $title ) {
78
				$timestamp = Revision::getTimestampFromId(
79
					$title, $params['torevid'], Revision::READ_LATEST );
80
				if ( $timestamp ) {
81
					$timestamp = $dbw->timestamp( $timestamp );
82
				} else {
83
					$timestamp = null;
84
				}
85
			}
86
		} elseif ( isset( $params['newerthanrevid'] ) ) {
87
			if ( $params['entirewatchlist'] || $pageSet->getGoodTitleCount() > 1 ) {
88
				$this->dieUsage( 'newerthanrevid may only be used with a single page', 'multpages' );
@@ 91-99 (lines=9) @@
88
				$this->dieUsage( 'newerthanrevid may only be used with a single page', 'multpages' );
89
			}
90
			$title = reset( $pageSet->getGoodTitles() );
91
			if ( $title ) {
92
				$revid = $title->getNextRevisionID(
93
					$params['newerthanrevid'], Title::GAID_FOR_UPDATE );
94
				if ( $revid ) {
95
					$timestamp = $dbw->timestamp( Revision::getTimestampFromId( $title, $revid ) );
96
				} else {
97
					$timestamp = null;
98
				}
99
			}
100
		}
101
102
		$watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();