Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function __construct(string $pattern, string $modifiers = '') |
||
25 | { |
||
26 | $regex = sprintf('/%s/%s', str_replace('/', '\/', $pattern), $modifiers); |
||
27 | |||
28 | if (false === preg_match($regex, '')) { |
||
29 | throw new InvalidRegexPatternException($pattern); |
||
30 | } |
||
31 | |||
32 | $this->regex = $regex; |
||
33 | $this->pattern = $pattern; |
||
34 | $this->modifiers = $modifiers; |
||
35 | } |
||
36 | |||
66 |