Code Duplication    Length = 11-14 lines in 2 locations

module/Core/src/Core/Entity/Hydrator/MappingEntityHydrator.php 2 locations

@@ 44-57 (lines=14) @@
41
        return $this->map;
42
    }
43
44
    public function extract($object)
45
    {
46
47
        $data = parent::extract($object);
48
49
        foreach ($this->map as $from => $to) {
50
            if (array_key_exists($from, $data)) {
51
                $data[$to] = $this->extractValue($to, $data[$from], $object);
52
                unset($data[$from]);
53
            }
54
        }
55
56
        return $data;
57
    }
58
59
    public function hydrate(array $data, $object)
60
    {
@@ 59-69 (lines=11) @@
56
        return $data;
57
    }
58
59
    public function hydrate(array $data, $object)
60
    {
61
        foreach ($this->map as $to => $from) {
62
            if (array_key_exists($from, $data)) {
63
                $data[$to] = $this->hydrateValue($from, $data[$from], $data);
64
                unset($data[$from]);
65
            }
66
        }
67
68
        return parent::hydrate($data, $object);
69
    }
70
}