Conditions | 6 |
Paths | 6 |
Total Lines | 20 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
35 | 176 | public function skipSpacing($in, $offset) |
|
36 | { |
||
37 | 176 | $spacer = end($this->spacers); |
|
38 | |||
39 | // If `true`; use top-most Parser instance in stack. |
||
40 | 176 | if ($spacer === true) { |
|
41 | do { |
||
42 | 6 | $spacer = prev($this->spacers); |
|
43 | 6 | } while ($spacer !== false && !($spacer instanceof Parser)); |
|
44 | } |
||
45 | |||
46 | 176 | if ($spacer instanceof Parser) { |
|
47 | 27 | $match = $spacer->match($in, $offset); |
|
48 | |||
49 | 27 | return ($match instanceof Success) |
|
50 | 26 | ? $match->length |
|
51 | 27 | : false; |
|
52 | } |
||
53 | |||
54 | 167 | return 0; |
|
55 | } |
||
57 |