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