Code Duplication    Length = 13-14 lines in 2 locations

src/Api/CheckingResultsSource.php 2 locations

@@ 48-61 (lines=14) @@
45
		$results = [];
46
		$metadatas = [];
47
		$statusesFlipped = array_flip( $statuses );
48
		foreach ( $entityIds as $entityId ) {
49
			$entityResults = $this->delegatingConstraintChecker->checkAgainstConstraintsOnEntityId(
50
				$entityId,
51
				$constraintIds,
52
				[ $this, 'defaultResultsPerContext' ],
53
				[ $this, 'defaultResultsPerEntity' ]
54
			);
55
			foreach ( $entityResults as $result ) {
56
				$metadatas[] = $result->getMetadata();
57
				if ( $this->statusSelected( $statusesFlipped, $result ) ) {
58
					$results[] = $result;
59
				}
60
			}
61
		}
62
		foreach ( $claimIds as $claimId ) {
63
			$claimResults = $this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
64
				$claimId,
@@ 62-74 (lines=13) @@
59
				}
60
			}
61
		}
62
		foreach ( $claimIds as $claimId ) {
63
			$claimResults = $this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
64
				$claimId,
65
				$constraintIds,
66
				[ $this, 'defaultResultsPerContext' ]
67
			);
68
			foreach ( $claimResults as $result ) {
69
				$metadatas[] = $result->getMetadata();
70
				if ( $this->statusSelected( $statusesFlipped, $result ) ) {
71
					$results[] = $result;
72
				}
73
			}
74
		}
75
		return new CachedCheckResults(
76
			$results,
77
			Metadata::merge( $metadatas )