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 | ||
| 9 | final readonly class HttpConfig | |
| 10 | { | |
| 11 | public function __construct( | |
| 12 | public ?HttpListenAddress $listen, | |
| 13 | public HttpAdminConfig $admin, | |
| 14 | ) {} | |
| 15 | ||
| 16 | /** @throws ConfigurationException */ | |
| 17 | public static function fromSection(ConfigSection $http): self | |
| 18 | { | |
| 19 | return new self( | |
| 20 | listen: $http->findSwitchableValue('listen', HttpListenAddress::parse(...)), | |
| 21 | admin: HttpAdminConfig::fromSection($http->readSection('admin')), | |
| 22 | ); | |
| 23 | } | |
| 24 | } |