Test Failed
Push — master ( ab7fb6...b7905c )
by Hirofumi
02:11
created

AbandonedJobMessage::queue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Shippinno\Job\Domain\Model;
4
5
use DateTimeImmutable;
6
7
class AbandonedJobMessage
8
{
9
    /**
10
     * @var int|null
11
     */
12
    protected $id;
13
14
    /**
15
     * @var string
16
     */
17
    private $queue;
18
19
    /**
20
     * @var string
21
     */
22
    private $message;
23
24
    /**
25
     * @var string
26
     */
27
    private $reason;
28
29
    /**
30
     * @var DateTimeImmutable
31
     */
32
    private $abandonedAt;
33
34
    /**
35
     * @param string $queue
36
     * @param string $message
37
     * @param string $reason
38
     */
39
    public function __construct(string $queue, string $message, string $reason)
40
    {
41
        $this->queue = $queue;
42
        $this->message = $message;
43
        $this->reason = $reason;
44
        $this->abandonedAt = new DateTimeImmutable;
45
    }
46
47
    /**
48
     * @return int|null
49
     */
50
    public function id(): ?int
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function queue(): string
59
    {
60
        return $this->queue;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function message(): string
67
    {
68
        return $this->message;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function reason(): string
75
    {
76
        return $this->reason;
77
    }
78
79
    /**
80
     * @return DateTimeImmutable
81
     */
82
    public function abandonedAt(): DateTimeImmutable
83
    {
84
        return $this->abandonedAt;
85
    }
86
}
87