| Conditions | 4 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 26 | public function __construct($pattern) |
||
| 27 | { |
||
| 28 | if (!is_string($pattern)) { |
||
| 29 | throw new \InvalidArgumentException("Regex pattern must be a string."); |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!is_string($pattern) || @preg_match($pattern, '') === false) { |
||
| 33 | throw new \InvalidArgumentException("Regex pattern must be a valid one."); |
||
| 34 | } |
||
| 35 | |||
| 36 | $this->pattern = $pattern; |
||
| 37 | } |
||
| 38 | |||
| 69 |