| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | public function validate($value, array $validators = [], Model $model = null) |
||
| 14 | { |
||
| 15 | if (!is_string($value)) { |
||
| 16 | throw new \Formularium\Exception\ValidatorException('Expected a string.'); |
||
| 17 | } |
||
| 18 | |||
| 19 | $maxlength = $options['value']; |
||
| 20 | if (mb_strlen($value) < $options[self::MIN_LENGTH]) { |
||
| 21 | throw new \Formularium\Exception\ValidatorException('String is too short.'); |
||
| 22 | } |
||
| 23 | return $value; |
||
| 24 | } |
||
| 41 |