| Total Complexity | 3 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | final class ThemeName |
||
| 9 | { |
||
| 10 | /** @var string[] */ |
||
| 11 | private const VALID_NAMES = ['phuml', 'php', 'classic']; |
||
| 12 | |||
| 13 | private readonly string $name; |
||
| 14 | |||
| 15 | 34 | public function __construct(string $name) |
|
| 16 | { |
||
| 17 | 34 | if (! \in_array($name, self::VALID_NAMES, true)) { |
|
| 18 | 1 | throw UnknownTheme::named($name, self::VALID_NAMES); |
|
| 19 | } |
||
| 20 | 33 | $this->name = $name; |
|
|
|
|||
| 21 | } |
||
| 22 | |||
| 23 | 32 | public function name(): string |
|
| 26 | } |
||
| 27 | } |
||
| 28 |