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