Code Duplication    Length = 14-17 lines in 2 locations

src/Api/CachingResultsSource.php 2 locations

@@ 202-218 (lines=17) @@
199
	 * @param string[] $statuses
200
	 * @return bool
201
	 */
202
	private function canUseStoredResults(
203
		array $entityIds,
204
		array $claimIds,
205
		array $constraintIds = null,
206
		array $statuses
207
	) {
208
		if ( $claimIds !== [] ) {
209
			return false;
210
		}
211
		if ( $constraintIds !== null ) {
212
			return false;
213
		}
214
		if ( array_diff( $statuses, $this->cachedStatuses ) !== [] ) {
215
			return false;
216
		}
217
		return true;
218
	}
219
220
	/**
221
	 * Check whether a check result should be used,
@@ 276-289 (lines=14) @@
273
	 * @param string[] $statuses
274
	 * @return bool
275
	 */
276
	private function canStoreResults(
277
		array $entityIds,
278
		array $claimIds,
279
		array $constraintIds = null,
280
		array $statuses
281
	) {
282
		if ( $constraintIds !== null ) {
283
			return false;
284
		}
285
		if ( array_diff( $this->cachedStatuses, $statuses ) !== [] ) {
286
			return false;
287
		}
288
		return true;
289
	}
290
291
	/**
292
	 * Store check results for the given entity ID in the cache, if possible.