| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4.016 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 1 | public function validate(FieldInterface $field, InputModel $model, InputValidation $validation) |
|
| 37 | { |
||
| 38 | 1 | $input = $model->getInput($field); |
|
| 39 | |||
| 40 | 1 | if ($input === null) { |
|
| 41 | 1 | return; // no input |
|
| 42 | } |
||
| 43 | |||
| 44 | 1 | $length = mb_strlen($input); |
|
| 45 | |||
| 46 | 1 | if ($length > $this->max) { |
|
| 47 | 1 | $model->setError( |
|
| 48 | $field, |
||
| 49 | 1 | $this->error ?: lang::text("mindplay/kissform", "maxLength", ["field" => $validation->getLabel($field), "max" => $this->max]) |
|
| 50 | ); |
||
| 51 | } |
||
| 52 | 1 | } |
|
| 53 | } |
||
| 54 |