Lines
100.00%
2 / 2
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| AppIdCollection | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| containsId | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| toStrings | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Contracts\App\Collection; | |
| 6 | ||
| 7 | use Stewart\Contracts\App\AppId; | |
| 8 | use Stewart\Contracts\Collection\ListCollection; | |
| 9 | ||
| 10 | /** | |
| 11 | * @internal | |
| 12 | * @extends ListCollection<AppId> | |
| 13 | */ | |
| 14 | final readonly class AppIdCollection extends ListCollection | |
| 15 | { | |
| 16 | public function containsId(AppId $appId): bool | |
| 17 | { | |
| 18 | return $this->containsWhere(static fn(AppId $candidate): bool => $candidate->equals($appId)); | |
| 19 | } | |
| 20 | ||
| 21 | /** @return list<string> */ | |
| 22 | public function toStrings(): array | |
| 23 | { | |
| 24 | return $this->mapToList(static fn(AppId $appId): string => $appId->value); | |
| 25 | } | |
| 26 | } |