Code Duplication    Length = 8-8 lines in 2 locations

includes/filerepo/FileRepo.php 1 location

@@ 510-517 (lines=8) @@
507
			$file = $this->findFile( $title, $options );
508
			if ( $file ) {
509
				$searchName = File::normalizeTitle( $title )->getDBkey(); // must be valid
510
				if ( $flags & self::NAME_AND_TIME_ONLY ) {
511
					$result[$searchName] = [
512
						'title' => $file->getTitle()->getDBkey(),
513
						'timestamp' => $file->getTimestamp()
514
					];
515
				} else {
516
					$result[$searchName] = $file;
517
				}
518
			}
519
		}
520

includes/filerepo/LocalRepo.php 1 location

@@ 352-359 (lines=8) @@
349
				$file = $this->newFile( $redir );
350
				if ( $file && $fileMatchesSearch( $file, $search ) ) {
351
					$file->redirectedFrom( $title->getDBkey() );
352
					if ( $flags & FileRepo::NAME_AND_TIME_ONLY ) {
353
						$finalFiles[$dbKey] = [
354
							'title' => $file->getTitle()->getDBkey(),
355
							'timestamp' => $file->getTimestamp()
356
						];
357
					} else {
358
						$finalFiles[$dbKey] = $file;
359
					}
360
				}
361
			}
362
		}