Total Complexity | 6 |
Total Lines | 88 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Message implements \JsonSerializable |
||
12 | { |
||
13 | /** |
||
14 | * Name of the message queue where the message is received. |
||
15 | * |
||
16 | * @var Queue |
||
17 | */ |
||
18 | private $queue; |
||
19 | |||
20 | /** |
||
21 | * @var Age|null |
||
22 | */ |
||
23 | private $age; |
||
24 | |||
25 | /** |
||
26 | * messsage body, similar to an http request body |
||
27 | * |
||
28 | * @var string|null |
||
29 | */ |
||
30 | private $body; |
||
31 | |||
32 | /** |
||
33 | * messsage headers, similar to http request headers |
||
34 | * |
||
35 | * @var array|null |
||
36 | */ |
||
37 | private $headers; |
||
38 | |||
39 | /** |
||
40 | * @param Queue $queue |
||
41 | * @param Age|null $age |
||
42 | * @param string|null $body |
||
43 | * @param array|null $headers |
||
44 | */ |
||
45 | 2 | public function __construct( |
|
46 | Queue $queue, |
||
47 | Age $age = null, |
||
48 | $body = null, |
||
49 | array $headers = null |
||
50 | ) { |
||
51 | 2 | $this->queue = $queue; |
|
52 | 2 | $this->age = $age; |
|
53 | 2 | $this->body = $body; |
|
54 | 2 | $this->headers = $headers; |
|
55 | 2 | } |
|
56 | |||
57 | /** |
||
58 | * @return Queue |
||
59 | */ |
||
60 | 1 | public function queue() |
|
61 | { |
||
62 | 1 | return $this->queue; |
|
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return Age|null |
||
67 | */ |
||
68 | 1 | public function age() |
|
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return string|null |
||
75 | */ |
||
76 | 1 | public function body() |
|
77 | { |
||
78 | 1 | return $this->body; |
|
79 | } |
||
80 | |||
81 | /** |
||
82 | * @return array|null |
||
83 | */ |
||
84 | 1 | public function headers() |
|
87 | } |
||
88 | |||
89 | /** |
||
90 | * @return array |
||
91 | */ |
||
92 | 1 | public function jsonSerialize() |
|
99 | 1 | ]; |
|
100 | } |
||
101 | } |
||
102 |