Code Duplication    Length = 5-5 lines in 3 locations

includes/api/ApiQueryDuplicateFiles.php 2 locations

@@ 82-86 (lines=5) @@
79
		}
80
81
		$filesToFind = array_keys( $images );
82
		if ( $params['localonly'] ) {
83
			$files = RepoGroup::singleton()->getLocalRepo()->findFiles( $filesToFind );
84
		} else {
85
			$files = RepoGroup::singleton()->findFiles( $filesToFind );
86
		}
87
88
		$fit = true;
89
		$count = 0;
@@ 101-105 (lines=5) @@
98
		// find all files with the hashes, result format is:
99
		// [ hash => [ dup1, dup2 ], hash1 => ... ]
100
		$filesToFindBySha1s = array_unique( array_values( $sha1s ) );
101
		if ( $params['localonly'] ) {
102
			$filesBySha1s = RepoGroup::singleton()->getLocalRepo()->findBySha1s( $filesToFindBySha1s );
103
		} else {
104
			$filesBySha1s = RepoGroup::singleton()->findBySha1s( $filesToFindBySha1s );
105
		}
106
107
		// iterate over $images to handle continue param correct
108
		foreach ( $images as $image => $pageId ) {

includes/api/ApiQueryImageInfo.php 1 location

@@ 90-94 (lines=5) @@
87
				];
88
			}, $titles );
89
90
			if ( $params['localonly'] ) {
91
				$images = RepoGroup::singleton()->getLocalRepo()->findFiles( $findTitles );
92
			} else {
93
				$images = RepoGroup::singleton()->findFiles( $findTitles );
94
			}
95
96
			$result = $this->getResult();
97
			foreach ( $titles as $title ) {