Total Complexity | 4 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class Message |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $body; |
||
13 | |||
14 | /** |
||
15 | * Properties are similar to headers when using an \AMQPEnvelope object. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $properties; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $id; |
||
25 | |||
26 | /** |
||
27 | * __construct. |
||
28 | * |
||
29 | * In AMQP 0.9.1, a message contains properties. One of this properties is |
||
30 | * "headers". |
||
31 | * In AMQP 1.0, a message contains both properties and headers. |
||
32 | * |
||
33 | * For example, RabbitMQ implement AMQP 0.9.1. |
||
34 | * The "getHeaders" method of "\AMQPEnvelope" object actually return |
||
35 | * message properties AND headers at the same level. |
||
36 | * But if you want to have additional informations, you have to put it in |
||
37 | * the "headers" property. All unknown properties will be deleted by the |
||
38 | * broker. |
||
39 | * |
||
40 | * More information on AMQP version: |
||
41 | * |
||
42 | * @see: http://www.amqp.org/resources/download |
||
43 | * |
||
44 | * @param mixed $body |
||
45 | * @param array $properties |
||
46 | * @param mixed $id |
||
47 | */ |
||
48 | 12 | public function __construct($body = null, array $properties = [], $id = null) |
|
49 | { |
||
50 | 12 | $this->body = $body; |
|
51 | 12 | $this->properties = $properties; |
|
52 | 12 | $this->id = $id; |
|
53 | 12 | } |
|
54 | |||
55 | 5 | public function getBody() |
|
56 | { |
||
57 | 5 | return $this->body; |
|
58 | } |
||
59 | |||
60 | 2 | public function getProperties() |
|
63 | } |
||
64 | |||
65 | 4 | public function getId() |
|
70 |