| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| 1 | <?php |
||
| 25 | 2 | public function match(Line $line): string |
|
| 26 | { |
||
| 27 | 2 | foreach ($this->matchers as $matcher) { |
|
| 28 | try { |
||
| 29 | 1 | return $matcher->match($line); |
|
| 30 | 1 | } catch (InvalidContentException $exception) { |
|
| 31 | // Skipping invalid matches in favour of first valid match |
||
| 32 | } |
||
| 33 | } |
||
| 34 | |||
| 35 | 1 | throw new InvalidContentException( |
|
| 36 | 1 | 'Unable to find a match using a set of matchers' |
|
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |