Total Complexity | 4 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class Ratio |
||
13 | { |
||
14 | /** @var int */ |
||
15 | protected $value; |
||
16 | |||
17 | 15 | public function __construct($value) |
|
18 | { |
||
19 | 15 | if ($value < 1 || PHP_INT_MAX < $value) { |
|
20 | 3 | throw new InvalidArgumentException('Ratio value must be in range of 1 and PHP_INT_MAX'); |
|
21 | } |
||
22 | |||
23 | 12 | $this->value = $value; |
|
24 | 12 | } |
|
25 | |||
26 | /** |
||
27 | * Получение значения |
||
28 | * |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 10 | public function getInt(): int |
|
34 | } |
||
35 | } |
||
36 |