Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function __construct(string $key, $datum, array $options = []) |
||
31 | { |
||
32 | if (!isset($options['regex']) || empty($options['regex'])) { |
||
33 | throw new InvalidArgumentException('$options[regex] can\'t be empty and must be a valid regex'); |
||
34 | } |
||
35 | $this->key = $key; |
||
36 | $this->datum = $datum; |
||
37 | $this->regex = $options['regex']; |
||
38 | $this->sanitizeFlags = $options['sanitize_flag'] ?? null; |
||
39 | $this->checkValidOptions($options); |
||
40 | $this->options = array_merge(self::$defaults, $options); |
||
41 | } |
||
42 | } |
||
43 |