Code Duplication    Length = 14-15 lines in 2 locations

src/Api/CheckingResultsBuilder.php 2 locations

@@ 89-103 (lines=15) @@
86
		$response = [];
87
		$metadatas = [];
88
		$statusesFlipped = array_flip( $statuses );
89
		foreach ( $entityIds as $entityId ) {
90
			$results = $this->delegatingConstraintChecker->checkAgainstConstraintsOnEntityId(
91
				$entityId,
92
				$constraintIds,
93
				[ $this, 'defaultResultsPerContext' ],
94
				[ $this, 'defaultResultsPerEntity' ]
95
			);
96
			foreach ( $results as $result ) {
97
				$metadatas[] = $result->getMetadata();
98
				if ( $this->statusSelected( $statusesFlipped, $result ) ) {
99
					$resultArray = $this->checkResultToArray( $result );
100
					$result->getContextCursor()->storeCheckResultInArray( $resultArray, $response );
101
				}
102
			}
103
		}
104
		foreach ( $claimIds as $claimId ) {
105
			$results = $this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
106
				$claimId,
@@ 104-117 (lines=14) @@
101
				}
102
			}
103
		}
104
		foreach ( $claimIds as $claimId ) {
105
			$results = $this->delegatingConstraintChecker->checkAgainstConstraintsOnClaimId(
106
				$claimId,
107
				$constraintIds,
108
				[ $this, 'defaultResultsPerContext' ]
109
			);
110
			foreach ( $results as $result ) {
111
				$metadatas[] = $result->getMetadata();
112
				if ( $this->statusSelected( $statusesFlipped, $result ) ) {
113
					$resultArray = $this->checkResultToArray( $result );
114
					$result->getContextCursor()->storeCheckResultInArray( $resultArray, $response );
115
				}
116
			}
117
		}
118
		return new CachedCheckConstraintsResponse(
119
			$response,
120
			Metadata::merge( $metadatas )