Total Complexity | 7 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class EnumValue implements EnumValueInterface |
||
10 | { |
||
11 | private readonly string $description; |
||
12 | private readonly string $deprecationReason; |
||
13 | |||
14 | 2 | public function __construct( |
|
15 | private readonly string $name, |
||
16 | private readonly mixed $value, |
||
17 | ?string $description = null, |
||
18 | ?string $deprecationReason = null, |
||
19 | ) { |
||
20 | 2 | if (null !== $description) { |
|
21 | 1 | $this->description = $description; |
|
|
|||
22 | } |
||
23 | |||
24 | 2 | if (null !== $deprecationReason) { |
|
25 | 1 | $this->deprecationReason = $deprecationReason; |
|
26 | } |
||
27 | } |
||
28 | |||
29 | |||
30 | 2 | public function getName(): string |
|
33 | } |
||
34 | |||
35 | 2 | public function getDescription(): ?string |
|
39 | } |
||
40 | |||
41 | 2 | public function getDeprecationReason(): ?string |
|
42 | { |
||
43 | /** @psalm-suppress RedundantPropertyInitializationCheck */ |
||
44 | 2 | return $this->deprecationReason ?? null; |
|
45 | } |
||
46 | |||
47 | 2 | public function getValue(): mixed |
|
50 | } |
||
51 | } |
||
52 |