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