| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | class DbStringValidator extends Validator |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var null|int |
||
| 28 | */ |
||
| 29 | public ?int $max = null; |
||
| 30 | |||
| 31 | |||
| 32 | /** |
||
| 33 | * @inheritdoc |
||
| 34 | * @throws InvalidConfigException |
||
| 35 | */ |
||
| 36 | public function init(): void |
||
| 37 | { |
||
| 38 | parent::init(); |
||
| 39 | if ($this->max === null) { |
||
| 40 | throw new InvalidConfigException('The "max" property must be set.'); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @inheritdoc |
||
| 46 | */ |
||
| 47 | public function validateAttribute($model, $attribute): void |
||
| 54 | } |
||
| 55 | } |
||
| 56 |