Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
24 | 1372 | public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart |
|
25 | { |
||
26 | 1372 | if ($cursor->isIndented()) { |
|
27 | 142 | return BlockStart::none(); |
|
28 | } |
||
29 | |||
30 | 1296 | $match = RegexHelper::matchAt(RegexHelper::REGEX_THEMATIC_BREAK, $cursor->getLine(), $cursor->getNextNonSpacePosition()); |
|
31 | 1296 | if ($match === null) { |
|
32 | 1244 | return BlockStart::none(); |
|
33 | } |
||
34 | |||
35 | // Advance to the end of the string, consuming the entire line (of the thematic break) |
||
36 | 74 | $cursor->advanceToEnd(); |
|
37 | |||
38 | 74 | return BlockStart::of(new ThematicBreakParser())->at($cursor); |
|
39 | } |
||
41 |