Code Duplication    Length = 5-6 lines in 3 locations

includes/api/ApiQueryDeletedrevs.php 1 location

@@ 411-416 (lines=6) @@
408
					$a['token'] = $token;
409
				}
410
				$fit = $result->addValue( [ 'query', $this->getModuleName() ], $pageID, $a );
411
			} else {
412
				$pageID = $pageMap[$row->ar_namespace][$row->ar_title];
413
				$fit = $result->addValue(
414
					[ 'query', $this->getModuleName(), $pageID, 'revisions' ],
415
					null, $rev );
416
			}
417
			if ( !$fit ) {
418
				if ( $mode == 'all' || $mode == 'revs' ) {
419
					$this->setContinueEnumParameter( 'continue',

includes/api/ApiQueryAllDeletedRevisions.php 1 location

@@ 365-370 (lines=6) @@
362
					ApiResult::setIndexedTagName( $a['revisions'], 'rev' );
363
					ApiQueryBase::addTitleInfo( $a, $title );
364
					$fit = $result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
365
				} else {
366
					$index = $pageMap[$row->ar_namespace][$row->ar_title];
367
					$fit = $result->addValue(
368
						[ 'query', $this->getModuleName(), $index, 'revisions' ],
369
						null, $rev );
370
				}
371
				if ( !$fit ) {
372
					if ( $mode == 'all' ) {
373
						$this->setContinueEnumParameter( 'continue',

includes/api/ApiQueryAllRevisions.php 1 location

@@ 216-220 (lines=5) @@
213
					ApiQueryBase::addTitleInfo( $a, $title );
214
					$fit = $this->processRow( $row, $a['revisions'][0], $hookData ) &&
215
						$result->addValue( [ 'query', $this->getModuleName() ], $index, $a );
216
				} else {
217
					$index = $pageMap[$row->rev_page];
218
					$fit = $this->processRow( $row, $rev, $hookData ) &&
219
						$result->addValue( [ 'query', $this->getModuleName(), $index, 'revisions' ], null, $rev );
220
				}
221
				if ( !$fit ) {
222
					$this->setContinueEnumParameter( 'continue', "$row->rev_timestamp|$row->rev_id" );
223
					break;