Total Complexity | 6 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class SendableRange |
||
8 | { |
||
9 | 6 | private function __construct( |
|
10 | private int $min, |
||
11 | private int $max, |
||
12 | ) { |
||
13 | 6 | } |
|
14 | |||
15 | 6 | public static function withMinMax(int $min, int $max): self |
|
16 | { |
||
17 | 6 | return new self($min, $max); |
|
18 | } |
||
19 | |||
20 | 3 | public function contains(int $amount): bool |
|
21 | { |
||
22 | 3 | return $amount >= $this->min |
|
23 | 3 | && $amount <= $this->max; |
|
24 | } |
||
25 | |||
26 | 3 | public function min(): int |
|
27 | { |
||
28 | 3 | return $this->min; |
|
29 | } |
||
30 | |||
31 | 3 | public function max(): int |
|
34 | } |
||
35 | } |
||
36 |