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