Lines
100.00%
6 / 6
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| DomainAttributesConfig | 100.00% | 6 / 6 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| fromSection | 100.00% | 5 / 5 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Config; | |
| 6 | ||
| 7 | use Stewart\Runtime\Exception\ConfigurationException; | |
| 8 | ||
| 9 | final readonly class DomainAttributesConfig | |
| 10 | { | |
| 11 | /** | |
| 12 | * @param list<string> $include | |
| 13 | * @param list<string> $exclude | |
| 14 | */ | |
| 15 | public function __construct( | |
| 16 | public string $domain, | |
| 17 | public array $include, | |
| 18 | public array $exclude, | |
| 19 | ) {} | |
| 20 | ||
| 21 | /** @throws ConfigurationException */ | |
| 22 | public static function fromSection(ConfigSection $attributes, string $domain): self | |
| 23 | { | |
| 24 | return new self( | |
| 25 | domain: $domain, | |
| 26 | include: $attributes->readStringList('include'), | |
| 27 | exclude: $attributes->readStringList('exclude'), | |
| 28 | ); | |
| 29 | } | |
| 30 | } |