Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | final class SwitchState extends AbstractState |
||
21 | { |
||
22 | |||
23 | const ENABLED = 1; |
||
24 | const DISABLED = 0; |
||
25 | |||
26 | 1 | public function enable() |
|
27 | { |
||
28 | 1 | $this->setState(static::ENABLED); |
|
29 | 1 | } |
|
30 | |||
31 | 1 | public function disable() |
|
32 | { |
||
33 | 1 | $this->setState(static::DISABLED); |
|
34 | 1 | } |
|
35 | |||
36 | 2 | public function isEnabled() |
|
37 | { |
||
38 | 2 | return $this->getState() === static::ENABLED; |
|
39 | } |
||
40 | |||
41 | 2 | public function isDisabled() |
|
42 | { |
||
43 | 2 | return $this->getState() === static::DISABLED; |
|
44 | } |
||
45 | |||
46 | 3 | public function getAllExisting(): array |
|
51 | ]; |
||
52 | } |
||
53 | |||
54 | } |
||
55 |