We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 5 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
21 | 20 | public function __construct($min = null, $max = null, $inclusive = true) |
|
22 | { |
||
23 | 20 | $this->minValue = $min; |
|
24 | 20 | $this->maxValue = $max; |
|
25 | 20 | if (!is_null($min) && !is_null($max) && $min > $max) { |
|
26 | 1 | throw new ComponentException(sprintf('%s cannot be less than %s for validation', $min, $max)); |
|
27 | } |
||
28 | |||
29 | 19 | if (!is_null($min)) { |
|
30 | 19 | $this->addRule(new Min($min, $inclusive)); |
|
31 | 19 | } |
|
32 | |||
33 | 19 | if (!is_null($max)) { |
|
34 | 19 | $this->addRule(new Max($max, $inclusive)); |
|
35 | 19 | } |
|
36 | 19 | } |
|
37 | } |
||
38 |