Message::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Werkspot\MessageBus\Message;
4
5
final class Message implements MessageInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    private $destination;
11
12
    /**
13
     * @var mixed
14
     */
15
    private $payload;
16
17
    /**
18
     * @var array
19
     */
20
    private $metadata;
21
22 16
    public function __construct($payload, string $destination, array $metadata = [])
23
    {
24 16
        $this->payload = $payload;
25 16
        $this->destination = $destination;
26 16
        $this->metadata = $metadata;
27 16
    }
28
29 4
    public function getDestination(): string
30
    {
31 4
        return $this->destination;
32
    }
33
34 11
    public function getPayload()
35
    {
36 11
        return $this->payload;
37
    }
38
39 4
    public function getMetadata(): array
40
    {
41 4
        return $this->metadata;
42
    }
43
}
44