Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class SimpleStatus implements DependencyStatus |
||
10 | { |
||
11 | public const KEY_INFO = 'info'; |
||
12 | |||
13 | private string $name; |
||
14 | |||
15 | private bool $healthy; |
||
16 | |||
17 | private mixed $info; |
||
18 | |||
19 | /** |
||
20 | * @param string $name |
||
21 | * @param bool $healthy |
||
22 | * @param mixed|null $info |
||
23 | */ |
||
24 | public function __construct(string $name, bool $healthy, mixed $info = null) |
||
25 | { |
||
26 | $this->name = $name; |
||
27 | $this->healthy = $healthy; |
||
28 | $this->info = $info; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @inheritDoc |
||
33 | */ |
||
34 | public function getName(): string |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function isHealthy(): bool |
||
43 | { |
||
44 | return $this->healthy; |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * @return mixed |
||
49 | */ |
||
50 | public function getInfo(): mixed |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return array{'name':string,'healthy': bool, 'info': mixed} |
||
57 | */ |
||
58 | public function jsonSerialize(): array |
||
64 | ]; |
||
65 | } |
||
66 | } |
||
67 |