| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function __construct($min, $max) |
||
| 35 | { |
||
| 36 | if ( |
||
| 37 | 15 | 2 !== count(array_filter([$min, $max], function ($value) { |
|
| 38 | 15 | return true === is_int($value); |
|
| 39 | 15 | })) |
|
| 40 | 5 | ) { |
|
| 41 | 6 | throw new \InvalidArgumentException( |
|
| 42 | 4 | 'All parameters at Size object must be integers.' |
|
| 43 | 2 | ); |
|
| 44 | } |
||
| 45 | |||
| 46 | 9 | if ($min > $max) { |
|
| 47 | 3 | throw new \InvalidArgumentException( |
|
| 48 | 2 | 'Min value must be greater than ma value.' |
|
| 49 | 1 | ); |
|
| 50 | } |
||
| 51 | |||
| 52 | 6 | $this->min = $min; |
|
| 53 | 6 | $this->max = $max; |
|
| 54 | 6 | } |
|
| 55 | |||
| 76 |