| Conditions | 4 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 120 | public function parse(string $match, InlineParserContext $inlineContext): bool |
|
| 34 | { |
||
| 35 | 120 | $cursor = $inlineContext->getCursor(); |
|
| 36 | 120 | $nextChar = $cursor->peek(); |
|
| 37 | |||
| 38 | 120 | if ($nextChar === "\n") { |
|
| 39 | 15 | $cursor->advanceBy(2); |
|
| 40 | 15 | $inlineContext->getContainer()->appendChild(new Newline(Newline::HARDBREAK)); |
|
| 41 | |||
| 42 | 15 | return true; |
|
| 43 | } |
||
| 44 | |||
| 45 | 105 | if ($nextChar !== null && RegexHelper::isEscapable($nextChar)) { |
|
| 46 | 84 | $cursor->advanceBy(2); |
|
| 47 | 84 | $inlineContext->getContainer()->appendChild(new Text($nextChar)); |
|
| 48 | |||
| 49 | 84 | return true; |
|
| 50 | } |
||
| 51 | |||
| 52 | 21 | $cursor->advanceBy(1); |
|
| 53 | 21 | $inlineContext->getContainer()->appendChild(new Text('\\')); |
|
| 54 | |||
| 55 | 21 | return true; |
|
| 56 | } |
||
| 58 |