Code Duplication    Length = 7-7 lines in 2 locations

src/Models/MetadataTrait.php 2 locations

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