Code Duplication    Length = 14-14 lines in 2 locations

Model/Job.php 1 location

@@ 495-508 (lines=14) @@
492
    /**
493
     * @param string $message a json_encoded version of the object
494
     */
495
    public function fromMessage($message)
496
    {
497
        $arr = json_decode($message, true);
498
        $this->setWorkerName($arr['worker']);
499
        $this->setArgs($arr['args']);
500
        $this->setMethod($arr['method']);
501
        $expiresAt = $arr['expiresAt'];
502
503
        if ($expiresAt) {
504
            $dateTime = new \DateTime();
505
            $dateTime->setTimestamp(intval($expiresAt));
506
            $this->setExpiresAt($dateTime);
507
        }
508
    }
509
}
510

RabbitMQ/Job.php 1 location

@@ 44-57 (lines=14) @@
41
    /**
42
     * @param string $message a json_encoded version of the object
43
     */
44
    public function fromMessage($message)
45
    {
46
        $arr = json_decode($message, true);
47
        $this->setArgs($arr['args']);
48
        $this->setId($arr['id']);
49
        $this->setMethod($arr['method']);
50
        $this->setWorkerName($arr['worker']);
51
        $expiresAt = $arr['expiresAt'];
52
        if ($expiresAt) {
53
            $dateTime = new \DateTime();
54
            $dateTime->setTimestamp(intval($expiresAt));
55
            $this->setExpiresAt($dateTime);
56
        }
57
    }
58
}
59