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

Project   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 50
ccs 11
cts 11
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 3 1
A jsonSerialize() 0 5 1
A name() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Events\Common\Cloud;
4
5
use ZoiloMora\ElasticAPM\Helper\Encoding;
6
7
final class Project implements \JsonSerializable
8
{
9
    /**
10
     * Cloud project ID
11
     *
12
     * @var string
13
     */
14
    private $id;
15
16
    /**
17
     * Cloud project name
18
     *
19
     * @var string
20
     */
21
    private $name;
22
23
    /**
24
     * @param string $id
25
     * @param string $name
26
     */
27 2
    public function __construct($id, $name)
28
    {
29 2
        $this->id = $id;
30 2
        $this->name = $name;
31 2
    }
32
33
    /**
34
     * @return string
35
     */
36 1
    public function id()
37
    {
38 1
        return $this->id;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 1
    public function name()
45
    {
46 1
        return $this->name;
47
    }
48
49
    /**
50
     * @return array
51
     */
52 1
    public function jsonSerialize()
53
    {
54
        return [
55 1
            'id' => Encoding::keywordField($this->id),
56 1
            'name' => Encoding::keywordField($this->name),
57 1
        ];
58
    }
59
}
60