| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 59 | protected function match($string, &$value) |
|
| 23 | { |
||
| 24 | 59 | $maxLength = false; |
|
| 25 | 59 | $result = null; |
|
| 26 | 59 | $subValue = []; |
|
| 27 | 59 | foreach ($this->matchers as $matcher) |
|
| 28 | { |
||
| 29 | 59 | $length = $matcher->matches($string, $subValue); |
|
| 30 | 59 | if ($maxLength === false || $length > $maxLength) |
|
| 31 | { |
||
| 32 | 59 | $maxLength = $length; |
|
| 33 | 59 | $result = $subValue; |
|
| 34 | } |
||
| 35 | } |
||
| 36 | 59 | $value = $this->process($result); |
|
| 37 | 59 | return $maxLength; |
|
| 38 | } |
||
| 39 | |||
| 46 |