Completed
Push — master ( c79f7e...463ede )
by Gallice
02:34
created

Entity   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 65
ccs 16
cts 16
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A getDescription() 0 4 1
A getValues() 0 4 1
A jsonSerialize() 0 8 1
1
<?php
2
3
namespace Tgallice\Wit\Model;
4
5
class Entity implements \JsonSerializable
6
{
7
    /**
8
     * @var string
9
     */
10
    private $id;
11
12
    /**
13
     * @var array
14
     */
15
    private $values;
16
17
    /**
18
     * @var string
19
     */
20
    private $description;
21
22
    /**
23
     * @param $id
24
     * @param array $values
25
     * @param string|null $description
26
     */
27 5
    public function __construct($id, array $values = [], $description = '')
28
    {
29 5
        $this->id = $id;
30 5
        $this->values = $values;
31 5
        $this->description = $description;
32 5
    }
33
34
    /**
35
     * @return string
36
     */
37 1
    public function getId()
38
    {
39 1
        return $this->id;
40
    }
41
42
    /**
43
     * @return null|string
44
     */
45 1
    public function getDescription()
46
    {
47 1
        return $this->description;
48
    }
49
50
    /**
51
     * @return array
52
     */
53 1
    public function getValues()
54
    {
55 1
        return $this->values;
56
    }
57
58
    /**
59
     * @return array
60
     */
61 1
    public function jsonSerialize()
62
    {
63
        return [
64 1
            'id' => $this->id,
65 1
            'values' => $this->values,
66 1
            'doc' => $this->description,
67 1
        ];
68
    }
69
}
70