Code Duplication    Length = 16-16 lines in 2 locations

src/action/ActionHydrator.php 1 location

@@ 30-45 (lines=16) @@
27
class ActionHydrator extends GeneratedHydrator
28
{
29
    /** {@inheritdoc} */
30
    public function hydrate(array $data, $object)
31
    {
32
        $data['type']       = $this->hydrator->create($data['type'], Type::class);
33
        $data['target']     = $this->hydrator->create($data['target'], Target::class);
34
        $data['quantity']   = $this->hydrator->create($data['quantity'], Quantity::class);
35
        $data['customer']   = $this->hydrator->create($data['customer'], Customer::class);
36
        $data['time']       = $this->hydrator->create($data['time'], DateTimeImmutable::class);
37
        if (isset($data['sale'])) {
38
            $data['sale']   = $this->hydrator->create($data['sale'], Sale::class);
39
        }
40
        if (isset($data['parent'])) {
41
            $data['parent'] = $this->hydrator->create($data['parent'], Action::class);
42
        }
43
44
        return parent::hydrate($data, $object);
45
    }
46
47
    /**
48
     * {@inheritdoc}

src/bill/BillHydrator.php 1 location

@@ 39-54 (lines=16) @@
36
     * {@inheritdoc}
37
     * @param object|Plan $object
38
     */
39
    public function hydrate(array $row, $object)
40
    {
41
        $row['type']        = $this->hydrator->create($row['type'],     Type::class);
42
        $row['time']        = $this->hydrator->create($row['time'],     DateTimeImmutable::class);
43
        $row['sum']         = $this->hydrator->create($row['sum'],      Money::class);
44
        $row['quantity']    = $this->hydrator->create($row['quantity'], Quantity::class);
45
        $row['customer']    = $this->hydrator->create($row['customer'], Customer::class);
46
        if (isset($row['target'])) {
47
            $row['target']  = $this->hydrator->create($row['target'],   Target::class);
48
        }
49
        if (isset($row['plan'])) {
50
            $row['plan']    = $this->hydrator->create($row['plan'],     Plan::class);
51
        }
52
53
        return parent::hydrate($row, $object);
54
    }
55
56
    /**
57
     * {@inheritdoc}