Passed
Pull Request — master (#182)
by Dmitriy
03:25 queued 46s
created

Message::getHandler()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Queue\Message;
6
7
final class Message implements MessageInterface
8
{
9
    /**
10
     * @param class-string<MessageHandlerInterface> $handler Message handler class name
0 ignored issues
show
Documentation Bug introduced by
The doc comment class-string<MessageHandlerInterface> at position 0 could not be parsed: Unknown type name 'class-string' at position 0 in class-string<MessageHandlerInterface>.
Loading history...
11
     * @param mixed $data Message data, encodable by a queue adapter
12
     * @param array $metadata Message metadata, encodable by a queue adapter
13
     * @param string|null $id Message id
14
     */
15 74
    public function __construct(
16
        private string $handler,
17
        private mixed $data,
18
        private array $metadata = [],
19
    ) {
20 74
    }
21
22 22
    public function getHandler(): string
23
    {
24 22
        return $this->handler;
25
    }
26
27 37
    public function getData(): mixed
28
    {
29 37
        return $this->data;
30
    }
31
32 29
    public function getMetadata(): array
33
    {
34 29
        return $this->metadata;
35
    }
36
}
37