Lines
100.00%
5 / 5
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% | 4 / 4 | 100.00% | 1 / 1 | 1 | ||
| 10 | final readonly class HttpAdminConfig | |
| 11 | { | |
| 12 | public function __construct( | |
| 13 | public ?HttpListenAddress $listen, | |
| 14 | #[SensitiveParameter] | |
| 15 | public ?string $token, | |
| 16 | ) {} | |
| 17 | ||
| 18 | /** @throws ConfigurationException */ | |
| 19 | public static function fromSection(#[SensitiveParameter] ConfigSection $admin): self | |
| 20 | { | |
| 21 | return new self( | |
| 22 | listen: $admin->findSwitchableValue('listen', HttpListenAddress::parse(...)), | |
| 23 | token: $admin->findSwitchableValue('token', strval(...)), | |
| 24 | ); | |
| 25 | } | |
| 26 | } |