Lines
0.00%
0 / 2
Functions and Methods
0.00%
0 / 2
Classes and Traits
0.00%
0 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| DomainAttributesConfigCollection | 0.00% | 0 / 2 | 0.00% | 0 / 2 | 6 | 0.00% | 0 / 1 | |||
| keyedByDomain | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| find | 0.00% | 0 / 1 | 0.00% | 0 / 1 | 2 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Runtime\Config\Collection; | |
| 6 | ||
| 7 | use Stewart\Contracts\Collection\KeyedCollection; | |
| 8 | use Stewart\Runtime\Config\DomainAttributesConfig; | |
| 9 | ||
| 10 | /** @extends KeyedCollection<string, DomainAttributesConfig> */ | |
| 11 | final readonly class DomainAttributesConfigCollection extends KeyedCollection | |
| 12 | { | |
| 13 | /** @param iterable<DomainAttributesConfig> $domains */ | |
| 14 | public static function keyedByDomain(iterable $domains): self | |
| 15 | { | |
| 16 | return self::keyedBy($domains, static fn(DomainAttributesConfig $domain): string => $domain->domain); | |
| 17 | } | |
| 18 | ||
| 19 | public function find(string $domain): ?DomainAttributesConfig | |
| 20 | { | |
| 21 | return $this->elementAt($domain); | |
| 22 | } | |
| 23 | } |