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

Entity::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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