UnRequeueableMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 40
ccs 0
cts 17
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessage() 0 3 1
A __construct() 0 5 1
A getId() 0 3 1
A getReason() 0 3 1
1
<?php
2
3
namespace Werkspot\MessageQueue\Message;
4
5
use Ramsey\Uuid\Uuid;
6
7
class UnRequeueableMessage implements UnRequeueableMessageInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $id;
13
14
    /**
15
     * @var mixed
16
     */
17
    private $message;
18
19
    /**
20
     * @var string
21
     */
22
    private $reason;
23
24
    public function __construct($message, string $reason = '')
25
    {
26
        $this->id = Uuid::uuid4()->toString();
27
        $this->message = $message;
28
        $this->reason = $reason;
29
    }
30
31
    public function getId(): string
32
    {
33
        return $this->id;
34
    }
35
36
    /**
37
     * @return mixed
38
     */
39
    public function getMessage()
40
    {
41
        return $this->message;
42
    }
43
44
    public function getReason(): string
45
    {
46
        return $this->reason;
47
    }
48
}
49