Total Complexity | 10 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | trait FloatBase |
||
7 | { |
||
8 | use Strict; |
||
9 | |||
10 | /** |
||
11 | * @var float |
||
12 | */ |
||
13 | private $min = PHP_FLOAT_MIN; |
||
14 | |||
15 | /** |
||
16 | * @var float |
||
17 | */ |
||
18 | private $max = PHP_FLOAT_MAX; |
||
19 | |||
20 | 5 | public function between(float $min, float $max): self |
|
21 | { |
||
22 | 5 | $this->min = $min; |
|
23 | 5 | $this->max = $max; |
|
24 | |||
25 | 5 | return $this; |
|
26 | } |
||
27 | |||
28 | 12 | public function min(float $min): self |
|
29 | { |
||
30 | 12 | $this->min = $min; |
|
31 | |||
32 | 12 | return $this; |
|
33 | } |
||
34 | |||
35 | 11 | public function max(float $max): self |
|
40 | } |
||
41 | |||
42 | 28 | protected function validation($input, &$value): bool |
|
65 | } |
||
66 | } |
||
67 |