Code Duplication    Length = 6-7 lines in 2 locations

includes/api/ApiQueryContributors.php 1 location

@@ 183-189 (lines=7) @@
180
		$res = $this->select( __METHOD__ );
181
		$count = 0;
182
		foreach ( $res as $row ) {
183
			if ( ++$count > $params['limit'] ) {
184
				// We've reached the one extra which shows that
185
				// there are additional pages to be had. Stop here...
186
				$this->setContinueEnumParameter( 'continue', $row->page . '|' . $row->user );
187
188
				return;
189
			}
190
191
			$fit = $this->addPageSubItem( $row->page,
192
				[ 'userid' => (int)$row->user, 'name' => $row->username ],

includes/api/ApiQueryWatchlistRaw.php 1 location

@@ 109-114 (lines=6) @@
106
		foreach ( $items as $item ) {
107
			$ns = $item->getLinkTarget()->getNamespace();
108
			$dbKey = $item->getLinkTarget()->getDBkey();
109
			if ( ++$count > $params['limit'] ) {
110
				// We've reached the one extra which shows that there are
111
				// additional pages to be had. Stop here...
112
				$this->setContinueEnumParameter( 'continue', $ns . '|' . $dbKey );
113
				break;
114
			}
115
			$t = Title::makeTitle( $ns, $dbKey );
116
117
			if ( is_null( $resultPageSet ) ) {