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