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 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Floor | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| isNamed | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Contracts\Registry; | |
| 6 | ||
| 7 | use Stewart\Contracts\Wire\ListOf; | |
| 8 | ||
| 9 | final readonly class Floor | |
| 10 | { | |
| 11 | /** @param list<string> $aliases */ | |
| 12 | public function __construct( | |
| 13 | public FloorId $floorId, | |
| 14 | public string $name, | |
| 15 | public ?int $level = null, | |
| 16 | #[ListOf('string')] | |
| 17 | public array $aliases = [], | |
| 18 | public ?string $icon = null, | |
| 19 | ) {} | |
| 20 | ||
| 21 | public function isNamed(string $name): bool | |
| 22 | { | |
| 23 | return RegistryNames::containsName($name, $this->name, ...$this->aliases); | |
| 24 | } | |
| 25 | } |