| Conditions | 4 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 27 | public function __construct($min, $max) |
|
| 41 | { |
||
| 42 | 27 | $this->minValue = $min; |
|
| 43 | 27 | $this->maxValue = $max; |
|
| 44 | |||
| 45 | 27 | if (is_null($min) || is_null($max)) { |
|
| 46 | 2 | throw new ComponentException('Minimum and maximum is required'); |
|
| 47 | } |
||
| 48 | |||
| 49 | 25 | if ($min > $max) { |
|
| 50 | 1 | throw new ComponentException(sprintf('%s cannot be less than %s for validation', $min, $max)); |
|
| 51 | } |
||
| 52 | 24 | } |
|
| 53 | |||
| 77 |