| Total Complexity | 8 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class GameStatus |
||
| 8 | { |
||
| 9 | const STATUS_ACTIVE = 'ACTIF'; |
||
| 10 | const STATUS_INACTIVE = 'INACTIF'; |
||
| 11 | |||
| 12 | public const VALUES = [ |
||
| 13 | self::STATUS_ACTIVE, |
||
| 14 | self::STATUS_INACTIVE, |
||
| 15 | ]; |
||
| 16 | |||
| 17 | private string $value; |
||
| 18 | |||
| 19 | public function __construct(string $value) |
||
| 20 | { |
||
| 21 | self::inArray($value); |
||
| 22 | |||
| 23 | $this->value = $value; |
||
| 24 | } |
||
| 25 | |||
| 26 | public static function inArray(string $value): void |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getValue(): string |
||
| 32 | { |
||
| 33 | return $this->value; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function getIndex(): int |
||
| 39 | } |
||
| 40 | |||
| 41 | public function __toString(): string |
||
| 42 | { |
||
| 43 | return $this->value; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function isActive(): bool |
||
| 47 | { |
||
| 48 | return self::STATUS_ACTIVE === $this->value; |
||
| 49 | } |
||
| 50 | |||
| 51 | public function isInactive(): bool |
||
| 52 | { |
||
| 53 | return self::STATUS_INACTIVE === $this->value; |
||
| 54 | } |
||
| 55 | |||
| 56 | public static function getStatusChoices(): array |
||
| 61 | ]; |
||
| 62 | } |
||
| 63 | } |