| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 9 | final class State |
||
| 10 | { |
||
| 11 | private $color; |
||
| 12 | private $power; |
||
| 13 | private $label; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param HsbkColor $color |
||
| 17 | * @param int $power |
||
| 18 | * @param Label $label |
||
| 19 | * @throws InvalidValueException |
||
| 20 | */ |
||
| 21 | 10 | public function __construct(HsbkColor $color, int $power, Label $label) |
|
| 22 | { |
||
| 23 | 10 | $this->color = $color; |
|
| 24 | 10 | $this->power = validate_uint16('Power level', $power); |
|
| 25 | 8 | $this->label = $label; |
|
| 26 | } |
||
| 27 | |||
| 28 | 3 | public function getColor(): HsbkColor |
|
| 29 | { |
||
| 30 | 3 | return $this->color; |
|
| 31 | } |
||
| 32 | |||
| 33 | 3 | public function getPower(): int |
|
| 36 | } |
||
| 37 | |||
| 38 | 3 | public function getLabel(): Label |
|
| 43 |