Completed
Push — master ( 8babd6...f4be45 )
by David
15s queued 11s
created

EnvVariable::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace TheAentMachine\Service\Environment;
4
5
class EnvVariable implements \JsonSerializable
6
{
7
    /** @var string */
8
    private $value;
9
    /** @var string */
10
    private $type;
11
12
    /**
13
     * EnvironmentVariable constructor.
14
     * @param string $value
15
     * @param string $type
16
     */
17
    public function __construct(string $value, string $type)
18
    {
19
        $this->value = $value;
20
        $this->type = $type;
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function getValue(): string
27
    {
28
        return $this->value;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getType(): string
35
    {
36
        return $this->type;
37
    }
38
39
    /**
40
     * Specify data which should be serialized to JSON
41
     * @link http://php.net/manual/en/jsonserializable.jsonserialize.php
42
     * @return array data which can be serialized by <b>json_encode</b>,
43
     * which is a value of any type other than a resource.
44
     * @since 5.4.0
45
     */
46
    public function jsonSerialize(): array
47
    {
48
        return array(
49
            'value' => $this->value,
50
            'type' => $this->type
51
        );
52
    }
53
}
54