Lines 66.66% 2 / 3
Methods 66.66% 2 / 3
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 __construct 100.00% 1 / 1 100.00% 1 / 1 1
 listLabelIds 0.00% 0 / 1 0.00% 0 / 1 2
 isNamed 100.00% 1 / 1 100.00% 1 / 1 1
10final readonly class Area
11{
12    /**
13     * @param list<string> $aliases
14     * @param list<LabelId> $labelIds
15     */
16    public function __construct(
17        public AreaId $areaId,
18        public string $name,
19        public ?FloorId $floorId = null,
20        #[ListOf('string')]
21        public array $aliases = [],
22        #[ListOf(LabelId::class)]
23        public array $labelIds = [],
24        public ?string $icon = null,
25    ) {}
26
27    public function listLabelIds(): LabelIdCollection
28    {
29        return LabelIdCollection::fromList($this->labelIds);
30    }
31
32    public function isNamed(string $name): bool
33    {
34        return RegistryNames::containsName($name, $this->name, ...$this->aliases);
35    }
36}