Total Complexity | 5 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class EnvVariable implements \JsonSerializable |
||
6 | { |
||
7 | /** @var string */ |
||
8 | private $value; |
||
9 | /** @var string */ |
||
10 | private $type; |
||
11 | /** @var null|string */ |
||
12 | private $comment; |
||
13 | |||
14 | /** |
||
15 | * EnvironmentVariable constructor. |
||
16 | * @param string $value |
||
17 | * @param string $type |
||
18 | * @param null|string $comment |
||
19 | */ |
||
20 | public function __construct(string $value, string $type, ?string $comment) |
||
21 | { |
||
22 | $this->value = $value; |
||
23 | $this->type = $type; |
||
24 | $this->comment = $comment; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return string |
||
29 | */ |
||
30 | public function getValue(): string |
||
31 | { |
||
32 | return $this->value; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getType(): string |
||
39 | { |
||
40 | return $this->type; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return null|string |
||
45 | */ |
||
46 | public function getComment(): ?string |
||
47 | { |
||
48 | return $this->comment; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Specify data which should be serialized to JSON |
||
53 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
54 | * @return array data which can be serialized by <b>json_encode</b>, |
||
55 | * which is a value of any type other than a resource. |
||
56 | * @since 5.4.0 |
||
57 | */ |
||
58 | public function jsonSerialize(): array |
||
64 | ]); |
||
65 | } |
||
66 | } |
||
67 |