Code Duplication    Length = 7-7 lines in 2 locations

src/Models/MetadataTrait.php 2 locations

@@ 212-218 (lines=7) @@
209
        $resourceType = $entityTypes[$thisClass];
210
        // if $r is in $combined keys, then its in keyspaces of both $entityTypes and $resourceSets
211
        $combinedKeys = array_intersect(array_keys($entityTypes), array_keys($resourceSets));
212
        foreach ($rel['HasOne'] as $n => $r) {
213
            $r = trim($r, '\\');
214
            if (in_array($r, $combinedKeys)) {
215
                $targResourceSet = $resourceSets[$r];
216
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
217
            }
218
        }
219
        foreach ($rel['HasMany'] as $n => $r) {
220
            $r = trim($r, '\\');
221
            if (in_array($r, $combinedKeys)) {
@@ 219-225 (lines=7) @@
216
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
217
            }
218
        }
219
        foreach ($rel['HasMany'] as $n => $r) {
220
            $r = trim($r, '\\');
221
            if (in_array($r, $combinedKeys)) {
222
                $targResourceSet = $resourceSets[$r];
223
                $metadata->addResourceSetReferenceProperty($resourceType, $n, $targResourceSet);
224
            }
225
        }
226
        return $rel;
227
    }
228