Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 1674 | public function parse(ContextInterface $context, Cursor $cursor) |
|
31 | { |
||
32 | 1674 | if ($cursor->isIndented()) { |
|
33 | 177 | return false; |
|
34 | } |
||
35 | |||
36 | 1620 | $match = RegexHelper::matchAt(RegexHelper::getInstance()->getThematicBreakRegex(), $cursor->getLine(), $cursor->getFirstNonSpacePosition()); |
|
37 | 1620 | if ($match === null) { |
|
38 | 1587 | return false; |
|
39 | } |
||
40 | |||
41 | // Advance to the end of the string, consuming the entire line (of the thematic break) |
||
42 | 78 | $cursor->advanceBy(mb_strlen($cursor->getRemainder())); |
|
43 | |||
44 | 78 | $context->addBlock(new ThematicBreak()); |
|
45 | 78 | $context->setBlocksParsed(true); |
|
46 | |||
47 | 78 | return true; |
|
48 | } |
||
49 | } |
||
50 |