Queue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 32
ccs 7
cts 7
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A name() 0 3 1
A jsonSerialize() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Events\Common\Message;
4
5
use ZoiloMora\ElasticAPM\Helper\Encoding;
6
7
/**
8
 * Queue
9
 */
10
final class Queue implements \JsonSerializable
11
{
12
    /**
13
     * Name of the message queue where the message is received.
14
     *
15
     * @var string|null
16
     */
17
    private $name;
18
19
    /**
20
     * @param string|null $name
21
     */
22 3
    public function __construct($name = null)
23
    {
24 3
        $this->name = $name;
25 3
    }
26
27
    /**
28
     * @return string|null
29
     */
30 1
    public function name()
31
    {
32 1
        return $this->name;
33
    }
34
35
    /**
36
     * @return array
37
     */
38 1
    public function jsonSerialize()
39
    {
40
        return [
41 1
            'name' => Encoding::keywordField($this->name),
42 1
        ];
43
    }
44
}
45