Conditions | 4 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
36 | 15 | public function __construct($size, RangeInterface $range) |
|
37 | { |
||
38 | 15 | $this->range = $range; |
|
39 | |||
40 | if ( |
||
41 | 15 | false === is_int($size) |
|
42 | 13 | || $size < $this->range->getMin() |
|
43 | 10 | || $size > $this->range->getMax() |
|
44 | 5 | ) { |
|
45 | 6 | throw new \InvalidArgumentException(sprintf( |
|
46 | 6 | 'Size must be between %s and %s.', |
|
47 | 6 | $this->range->getMin(), |
|
48 | 6 | $this->range->getMax() |
|
49 | 2 | )); |
|
50 | } |
||
51 | |||
52 | 9 | $this->size = $size; |
|
53 | 9 | } |
|
54 | |||
75 |