Conditions | 6 |
Paths | 2 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
26 | 27 | protected function consumeQuote($lines, $current) |
|
27 | { |
||
28 | // consume until newline |
||
29 | 27 | $content = []; |
|
30 | 27 | for ($i = $current, $count = count($lines); $i < $count; $i++) { |
|
31 | 27 | $line = $lines[$i]; |
|
32 | 27 | if (ltrim($line) !== '') { |
|
33 | 27 | if ($line[0] == '>' && !isset($line[1])) { |
|
34 | 8 | $line = ''; |
|
35 | 27 | } elseif (strncmp($line, '> ', 2) === 0) { |
|
36 | 27 | $line = substr($line, 2); |
|
37 | } |
||
38 | 27 | $content[] = $line; |
|
39 | } else { |
||
40 | 24 | break; |
|
41 | } |
||
42 | } |
||
43 | |||
44 | $block = [ |
||
45 | 27 | 'quote', |
|
46 | 27 | 'content' => $this->parseBlocks($content), |
|
47 | 'simple' => true, |
||
48 | ]; |
||
49 | 27 | return [$block, $i]; |
|
50 | } |
||
51 | |||
64 |