| Conditions | 3 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 15 | 3 | public function validate($value, Field $field, Model $model = null) |
|
| 16 | { |
||
| 17 | // must be filled? |
||
| 18 | 3 | if ($field->getValidators()[self::class] ?? false) { |
|
| 19 | 3 | if (empty($value)) { |
|
| 20 | 1 | throw new ValidatorException("Field {$field->getName()} must be filled"); |
|
| 21 | } |
||
| 22 | } |
||
| 23 | 3 | return $value; |
|
| 24 | } |
||
| 26 |