Total Complexity | 4 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
22 | class ParsedUriValidator extends Validator |
||
23 | { |
||
24 | /** |
||
25 | * @var null|string The source field to parse from |
||
26 | */ |
||
27 | public ?string $source = null; |
||
28 | |||
29 | /** |
||
30 | * @var null|bool Whether or not to actually parse |
||
31 | */ |
||
32 | public ?bool $parse = false; |
||
33 | |||
34 | /** |
||
35 | * @var bool |
||
36 | */ |
||
37 | public $skipOnEmpty = false; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | public $skipOnError = false; |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | * @throws InvalidConfigException |
||
47 | */ |
||
48 | public function init(): void |
||
49 | { |
||
50 | parent::init(); |
||
51 | if ($this->source === null) { |
||
52 | throw new InvalidConfigException('The "source" property must be set.'); |
||
53 | } |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | public function validateAttribute($model, $attribute): void |
||
67 | } |
||
68 | } |
||
70 |