Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class State { |
||
11 | public const DISABLED = 0; |
||
12 | public const VERIFYING = 1; |
||
13 | public const ENABLED = 2; |
||
14 | |||
15 | 3 | private function __construct( |
|
16 | private int $state, |
||
17 | ) { |
||
18 | 3 | } |
|
19 | |||
20 | 1 | public static function disabled(): State { |
|
21 | 1 | return new self(self::DISABLED); |
|
22 | } |
||
23 | |||
24 | 1 | public static function verifying(): State { |
|
25 | 1 | return new self(self::VERIFYING); |
|
26 | } |
||
27 | |||
28 | 1 | public static function enabled(): State { |
|
29 | 1 | return new self(self::ENABLED); |
|
30 | } |
||
31 | |||
32 | 3 | public function isDisabled(): bool { |
|
33 | 3 | return $this->state === self::DISABLED; |
|
34 | } |
||
35 | |||
36 | 3 | public function isVerifying(): bool { |
|
37 | 3 | return $this->state === self::VERIFYING; |
|
38 | } |
||
39 | |||
40 | 3 | public function isEnabled(): bool { |
|
42 | } |
||
43 | } |
||
44 |