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 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Label | 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 | final readonly class Label | |
| 8 | { | |
| 9 | public function __construct( | |
| 10 | public LabelId $labelId, | |
| 11 | public string $name, | |
| 12 | public ?string $color = null, | |
| 13 | public ?string $icon = null, | |
| 14 | public ?string $description = null, | |
| 15 | ) {} | |
| 16 | ||
| 17 | public function isNamed(string $name): bool | |
| 18 | { | |
| 19 | return RegistryNames::containsName($name, $this->name); | |
| 20 | } | |
| 21 | } |