Code Duplication    Length = 4-4 lines in 2 locations

src/Normalizer/CollectionFieldNormalizer.php 1 location

@@ 49-52 (lines=4) @@
46
        }
47
48
        $data = [];
49
        foreach ($this->accessor->getValue($object) as $i => $childObject) {
50
            $subPath = $path.'['.$i.']';
51
            $data[$i] = $normalizer->normalize($childObject, $context, $subPath);
52
        }
53
54
        return $data;
55
    }

src/Normalizer/Relation/EmbedManyFieldNormalizer.php 1 location

@@ 53-56 (lines=4) @@
50
        }
51
52
        $values = [];
53
        foreach ($childObjects as $i => $childObject) {
54
            $subPath = $path.'['.$i.']';
55
            $values[$i] = $normalizer->normalize($childObject, $context, $subPath);
56
        }
57
58
        return $values;
59
    }