Completed
Pull Request — 0.4 (#35)
by jean
10:46
created

Message::getBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Darkilliant\MqProcessBundle\Message;
6
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
    public function __construct($body = null, array $properties = [], $id = null)
49
    {
50
        $this->body = $body;
51
        $this->properties = $properties;
52
        $this->id = $id;
53
    }
54
55
    public function getBody()
56
    {
57
        return $this->body;
58
    }
59
60
    public function getProperties()
61
    {
62
        return $this->properties;
63
    }
64
65
    public function getId()
66
    {
67
        return $this->id;
68
    }
69
}
70