| 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 | 30 | public function __construct($name, $regexp) { |
|
| 31 | 30 | assert('is_string($name)'); |
|
| 32 | 30 | if (!is_string($regexp) || @preg_match("%^$regexp\$%", "") === false) { |
|
| 33 | throw new \InvalidArgumentException("'%^$regexp\$%' is no valid regex."); |
||
| 34 | } |
||
| 35 | 30 | $this->name = $name; |
|
| 36 | 30 | $this->regexp = $regexp; |
|
| 37 | 30 | } |
|
| 38 | |||
| 60 |