| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| 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 $options = [], Model $model = null) |
||
| 14 | { |
||
| 15 | if (!is_string($value)) { |
||
| 16 | throw new ValidatorException('Expected a string.'); |
||
| 17 | } |
||
| 18 | $maxlength = $options['value']; |
||
| 19 | if (mb_strlen($text) > $maxlength) { |
||
|
|
|||
| 20 | throw new ValidatorException('String is too long.'); |
||
| 21 | } |
||
| 22 | return $value; |
||
| 23 | } |
||
| 40 |