| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3.1406 |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | 51 | public function matches($string, &$value) |
|
| 32 | { |
||
| 33 | 51 | $matches = []; |
|
| 34 | 51 | $matched = preg_match("/^{$this->regex}/", $string, $matches); |
|
| 35 | 51 | if ($matched) |
|
| 36 | { |
||
| 37 | 51 | $value = $this->process($matches); |
|
| 38 | 51 | return strlen($matches[0]); |
|
| 39 | } |
||
| 40 | 51 | if (false === $matched) |
|
| 41 | { |
||
| 42 | $params = [ |
||
| 43 | $this->regex, |
||
| 44 | $string |
||
| 45 | ]; |
||
| 46 | throw new MatcherException(vsprintf('Could not interpret matcher regex: `%s`, When processing "%s". ', $params), preg_last_error()); |
||
| 47 | } |
||
| 48 | 51 | $value = false; |
|
| 49 | 51 | return false; |
|
| 50 | } |
||
| 51 | |||
| 58 |