Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
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->min) { |
|
47 | 1 | $model->setError( |
|
48 | 1 | $field, |
|
49 | 1 | $this->error ?: lang::text("mindplay/kissform", "minLength", ["field" => $validation->getLabel($field), "min" => $this->min]) |
|
50 | ); |
||
51 | } |
||
52 | 1 | } |
|
53 | } |
||
54 |