Lines
100.00%
8 / 8
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| fromSection | 100.00% | 7 / 7 | 100.00% | 1 / 1 | 1 | ||
| 11 | final readonly class AppOverride | |
| 12 | { | |
| 13 | /** @param array<string, mixed> $options */ | |
| 14 | public function __construct( | |
| 15 | public AppId $id, | |
| 16 | public bool $enabled, | |
| 17 | public bool $paused, | |
| 18 | public ?int $worker, | |
| 19 | public array $options, | |
| 20 | ) {} | |
| 21 | ||
| 22 | /** | |
| 23 | * @throws ConfigurationException | |
| 24 | * @throws IdentifierException | |
| 25 | */ | |
| 26 | public static function fromSection(ConfigSection $app, string $id): self | |
| 27 | { | |
| 28 | return new self( | |
| 29 | id: new AppId($id), | |
| 30 | enabled: $app->readBool('enabled'), | |
| 31 | paused: $app->readBool('paused'), | |
| 32 | worker: $app->findInt('worker'), | |
| 33 | options: $app->readMap('options'), | |
| 34 | ); | |
| 35 | } | |
| 36 | } |