Completed
Push — master ( a1f77e...f1bc3f )
by Matthew
04:51
created

Job::getDeliveryTag()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Dtc\QueueBundle\RabbitMQ;
4
5
class Job extends \Dtc\QueueBundle\Model\MessageableJob
6
{
7
    protected $deliveryTag;
8
9
    /**
10
     * @return string
11
     */
12 2
    public function getDeliveryTag()
13
    {
14 2
        return $this->deliveryTag;
15
    }
16
17
    /**
18
     * @param mixed $deliveryTag
19
     */
20 6
    public function setDeliveryTag($deliveryTag)
21
    {
22 6
        $this->deliveryTag = $deliveryTag;
23 6
    }
24
25
    /**
26
     * @return string A json_encoded version of a queueable version of the object
27
     */
28 6
    public function toMessage()
29
    {
30 6
        $arr = $this->toMessageArray();
31 6
        $arr['id'] = $this->getId();
32
33 6
        return json_encode($arr);
34
    }
35
36
    /**
37
     * @param string $message a json_encoded version of the object
38
     */
39 6
    public function fromMessage($message)
40
    {
41 6
        $arr = json_decode($message, true);
42 6
        if (is_array($arr)) {
43 6
            $this->fromMessageArray($arr);
44 6
            if (isset($arr['id'])) {
45 6
                $this->setId($arr['id']);
46
            }
47
        }
48 6
    }
49
}
50