Passed
Push — master ( bef5d8...6aa175 )
by Zoilo
03:10 queued 28s
created

Machine   A

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 type() 0 3 1
A __construct() 0 3 1
A jsonSerialize() 0 4 1
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Events\Common\Cloud;
4
5
use ZoiloMora\ElasticAPM\Helper\Encoding;
6
7
final class Machine implements \JsonSerializable
8
{
9
    /**
10
     * Cloud instance/machine type
11
     *
12
     * @var string
13
     */
14
    private $type;
15
16
    /**
17
     * @param string $type
18
     */
19 2
    public function __construct($type)
20
    {
21 2
        $this->type = $type;
22 2
    }
23
24
    /**
25
     * @return string
26
     */
27 1
    public function type()
28
    {
29 1
        return $this->type;
30
    }
31
32
    /**
33
     * @return array
34
     */
35 1
    public function jsonSerialize()
36
    {
37
        return [
38 1
            'type' => Encoding::keywordField($this->type),
39 1
        ];
40
    }
41
}
42