| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 1 | public function validate(FieldInterface $field, InputModel $model, InputValidation $validation) |
|
| 32 | { |
||
| 33 | 1 | parent::validate($field, $model, $validation); |
|
| 34 | |||
| 35 | 1 | if ($model->hasError($field)) { |
|
| 36 | return; // parent validation (IsNumber) failed |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | $input = $model->getInput($field); |
|
| 40 | |||
| 41 | 1 | if ($input > $this->max) { |
|
| 42 | 1 | $model->setError( |
|
| 43 | $field, |
||
| 44 | 1 | $this->error ?: lang::text("mindplay/kissform", "maxValue", ["field" => $validation->getLabel($field), "max" => $this->max]) |
|
| 45 | ); |
||
| 46 | } |
||
| 47 | 1 | } |
|
| 48 | } |
||
| 49 |