Total Complexity | 7 |
Total Lines | 92 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class HealthCheckResponseBuilder implements HealthCheckResponseBuilderInterface |
||
10 | { |
||
11 | |||
12 | /** |
||
13 | * Check name |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | private $name = ''; |
||
18 | |||
19 | /** |
||
20 | * Check state |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $state = ''; |
||
25 | |||
26 | /** |
||
27 | * Extra data |
||
28 | * |
||
29 | * @var array |
||
30 | */ |
||
31 | private $data = []; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | * |
||
36 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::name() |
||
37 | */ |
||
38 | public function name(string $name) |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | * |
||
48 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::up() |
||
49 | */ |
||
50 | public function up() |
||
51 | { |
||
52 | $this->state = HealthCheck::STATE_UP; |
||
53 | |||
54 | return $this; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | * |
||
60 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::down() |
||
61 | */ |
||
62 | public function down() |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | * |
||
72 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::state() |
||
73 | */ |
||
74 | public function state(bool $up) |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * {@inheritdoc} |
||
83 | * |
||
84 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::withData() |
||
85 | */ |
||
86 | public function withData(string $key, $value) |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | * |
||
96 | * @see \Health\Builder\HealthCheckResponseBuilderInterface::build() |
||
97 | */ |
||
98 | public function build() |
||
103 |