Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function __construct( |
||
24 | string $label, |
||
25 | string $regexPattern, |
||
26 | string $modifiers = '', |
||
27 | Item $parent = null, |
||
28 | array $children = [] |
||
29 | ) { |
||
30 | $pattern = sprintf('/%s/%s', str_replace('/', '\/', $regexPattern), $modifiers); |
||
31 | |||
32 | if (false === preg_match($pattern, '')) { |
||
33 | throw new InvalidRegexPatternException($regexPattern); |
||
34 | } |
||
35 | |||
36 | parent::__construct($pattern, $label, $parent, $children); |
||
37 | |||
38 | $this->regexPattern = $regexPattern; |
||
39 | $this->regexModifiers = $modifiers; |
||
40 | } |
||
41 | |||
57 |