Total Complexity | 5 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | final class Usage |
||
9 | { |
||
10 | private float $value; |
||
11 | |||
12 | 18 | public function __construct(float $value) |
|
13 | { |
||
14 | 18 | if ($value < 0 || $value > 100) { |
|
15 | 6 | throw new OutOfBoundsPercentage((string) $value); |
|
16 | } |
||
17 | |||
18 | 12 | $this->value = $value; |
|
19 | 12 | } |
|
20 | |||
21 | 6 | public function toFloat(): float |
|
24 | } |
||
25 | |||
26 | 3 | public function toString(): string |
|
31 |