Lines
100.00%
8 / 8
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ContainerProfile | 100.00% | 8 / 8 | 100.00% | 2 / 2 | 8 | 100.00% | 1 / 1 | |||
| configFiles | 100.00% | 4 / 4 | 100.00% | 1 / 1 | 4 | |||||
| optionalPackages | 100.00% | 4 / 4 | 100.00% | 1 / 1 | 4 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Kernel; | |
| 6 | ||
| 7 | enum ContainerProfile: string | |
| 8 | { | |
| 9 | case Console = 'console'; | |
| 10 | case Broker = 'broker'; | |
| 11 | case Worker = 'worker'; | |
| 12 | ||
| 13 | /** @return list<string> */ | |
| 14 | public function configFiles(): array | |
| 15 | { | |
| 16 | return match ($this) { | |
| 17 | self::Console => ['control.php', 'console.php'], | |
| 18 | self::Broker => ['common.php', 'control.php', 'broker.php'], | |
| 19 | self::Worker => ['common.php', 'worker.php'], | |
| 20 | }; | |
| 21 | } | |
| 22 | ||
| 23 | /** @return list<string> */ | |
| 24 | public function optionalPackages(): array | |
| 25 | { | |
| 26 | return match ($this) { | |
| 27 | self::Console => ['stewart-php/codegen'], | |
| 28 | self::Broker => ['stewart-php/store-redis', 'stewart-php/mqtt'], | |
| 29 | self::Worker => ['stewart-php/store-redis'], | |
| 30 | }; | |
| 31 | } | |
| 32 | } |