Code Duplication    Length = 7-7 lines in 2 locations

src/Models/MetadataTrait.php 2 locations

@@ 197-203 (lines=7) @@
194
        $resourceType = $entityTypes[$thisClass];
195
        // if $r is in $combined keys, then its in keyspaces of both $entityTypes and $resourceSets
196
        $combinedKeys = array_intersect(array_keys($entityTypes), array_keys($resourceSets));
197
        foreach ($rel['HasOne'] as $n => $r) {
198
            $r = trim($r, '\\');
199
            if (in_array($r, $combinedKeys)) {
200
                $targResourceSet = $resourceSets[$r];
201
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
202
            }
203
        }
204
        foreach ($rel['HasMany'] as $n => $r) {
205
            $r = trim($r, '\\');
206
            if (in_array($r, $combinedKeys)) {
@@ 204-210 (lines=7) @@
201
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
202
            }
203
        }
204
        foreach ($rel['HasMany'] as $n => $r) {
205
            $r = trim($r, '\\');
206
            if (in_array($r, $combinedKeys)) {
207
                $targResourceSet = $resourceSets[$r];
208
                $metadata->addResourceSetReferenceProperty($resourceType, $n, $targResourceSet);
209
            }
210
        }
211
        return $rel;
212
    }
213