Code Duplication    Length = 7-7 lines in 2 locations

src/Models/MetadataTrait.php 2 locations

@@ 173-179 (lines=7) @@
170
        $resourceType = $entityTypes[$thisClass];
171
        // if $r is in $combined keys, then its in keyspaces of both $entityTypes and $resourceSets
172
        $combinedKeys = array_intersect(array_keys($entityTypes), array_keys($resourceSets));
173
        foreach ($rel["HasOne"] as $n => $r) {
174
            $r = trim($r, '\\');
175
            if (in_array($r, $combinedKeys)) {
176
                $targResourceSet = $resourceSets[$r];
177
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
178
            }
179
        }
180
        foreach ($rel["HasMany"] as $n => $r) {
181
            $r = trim($r, '\\');
182
            if (in_array($r, $combinedKeys)) {
@@ 180-186 (lines=7) @@
177
                $metadata->addResourceReferenceProperty($resourceType, $n, $targResourceSet);
178
            }
179
        }
180
        foreach ($rel["HasMany"] as $n => $r) {
181
            $r = trim($r, '\\');
182
            if (in_array($r, $combinedKeys)) {
183
                $targResourceSet = $resourceSets[$r];
184
                $metadata->addResourceSetReferenceProperty($resourceType, $n, $targResourceSet);
185
            }
186
        }
187
        return $rel;
188
    }
189