| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 14 | protected function parse(&$input, $offset, Context $context) |
|
| 34 | { |
||
| 35 | 14 | $length = PHP_INT_MAX; |
|
| 36 | 14 | foreach ($this->parsers as $parser) { |
|
| 37 | 14 | $match = $parser->parse($input, $offset, $context); |
|
| 38 | 14 | $length = min($length, $match->length); |
|
| 39 | 14 | if (!($match instanceof Success)) { |
|
| 40 | 14 | return $this->failure($input, $offset, $length); |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 11 | return $this->success($input, $offset, $length); |
|
| 45 | } |
||
| 52 |