| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 9 | final class PowerTransition |
||
| 10 | { |
||
| 11 | private $level; |
||
| 12 | private $duration; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param int $level |
||
| 16 | * @param int $duration |
||
| 17 | * @throws InvalidValueException |
||
| 18 | */ |
||
| 19 | 9 | public function __construct(int $level, int $duration) |
|
| 20 | { |
||
| 21 | 9 | $this->level = validate_uint16('Power level', $level); |
|
| 22 | 7 | $this->duration = validate_uint32('Transition duration', $duration); |
|
| 23 | } |
||
| 24 | |||
| 25 | 1 | public function getLevel(): int |
|
| 26 | { |
||
| 27 | 1 | return $this->level; |
|
| 28 | } |
||
| 29 | |||
| 30 | 1 | public function getDuration(): int |
|
| 33 | } |
||
| 34 | } |
||
| 35 |