Conditions | 4 |
Paths | 4 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4.0218 |
Changes | 0 |
1 | <?php |
||
22 | 1437 | public function tryStart(Cursor $cursor, MarkdownParserStateInterface $parserState): ?BlockStart |
|
23 | { |
||
24 | 1437 | if (!$cursor->isIndented()) { |
|
25 | 1263 | return BlockStart::none(); |
|
26 | } |
||
27 | |||
28 | 183 | if ($parserState->getActiveBlockParser()->getBlock() instanceof Paragraph) { |
|
29 | 33 | return BlockStart::none(); |
|
30 | } |
||
31 | |||
32 | 150 | if ($cursor->isBlank()) { |
|
33 | return BlockStart::none(); |
||
34 | } |
||
35 | |||
36 | 150 | $cursor->advanceBy(Cursor::INDENT_LEVEL, true); |
|
37 | |||
38 | 150 | return BlockStart::of(new IndentedCodeParser())->at($cursor); |
|
39 | } |
||
40 | } |
||
41 |