Code Duplication    Length = 9-10 lines in 2 locations

src/price/PriceHydrator.php 1 location

@@ 83-91 (lines=9) @@
80
     * {@inheritdoc}
81
     * @param object|Plan $object
82
     */
83
    public function extract($object)
84
    {
85
        return array_filter([
86
            'id'            => $object->getId(),
87
            'type'          => $this->hydrator->extract($object->getType()),
88
            'target'        => $this->hydrator->extract($object->getTarget()),
89
            'plan'          => $object->getPlan() ? $this->hydrator->extract($object->getPlan()) : null,
90
        ]);
91
    }
92
93
    /**
94
     * @param string $className

src/sale/SaleHydrator.php 1 location

@@ 40-49 (lines=10) @@
37
     * {@inheritdoc}
38
     * @param object|Sale $object
39
     */
40
    public function extract($object)
41
    {
42
        return array_filter([
43
            'id'        => $object->getId(),
44
            'target'    => $this->hydrator->extract($object->getTarget()),
45
            'customer'  => $this->hydrator->extract($object->getCustomer()),
46
            'plan'      => $this->hydrator->extract($object->getPlan()),
47
            'time'      => $object->getTime() ? $this->hydrator->extract($object->getTime()) : null,
48
        ]);
49
    }
50
}
51