Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 0 |
1 | <?php |
||
30 | 31 | public function __construct($name, $regexp) { |
|
31 | 31 | assert('is_string($name)'); |
|
32 | 31 | if (!is_string($regexp) || @preg_match("%^$regexp\$%", "") === false) { |
|
33 | throw new \InvalidArgumentException("'%^$regexp\$%' is no valid regex."); |
||
34 | } |
||
35 | 31 | $this->name = $name; |
|
36 | 31 | $this->regexp = $regexp; |
|
37 | 31 | } |
|
38 | |||
72 |