| Conditions | 5 |
| Paths | 6 |
| Total Lines | 21 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 15 | public function parse(string $match, InlineParserContext $inlineContext): bool |
|
| 31 | { |
||
| 32 | 15 | $char = $match; |
|
| 33 | 15 | $cursor = $inlineContext->getCursor(); |
|
| 34 | 15 | if ($char === '{') { |
|
| 35 | 15 | $char = (string) $cursor->getCharacter($cursor->getPosition() - 1); |
|
| 36 | } |
||
| 37 | |||
| 38 | 15 | $attributes = AttributesHelper::parseAttributes($cursor); |
|
| 39 | 15 | if ($attributes === []) { |
|
| 40 | 12 | return false; |
|
| 41 | } |
||
| 42 | |||
| 43 | 15 | if ($char === '') { |
|
| 44 | 9 | $cursor->advanceToNextNonSpaceOrNewline(); |
|
| 45 | } |
||
| 46 | |||
| 47 | 15 | $node = new AttributesInline($attributes, $char === ' ' || $char === ''); |
|
| 48 | 15 | $inlineContext->getContainer()->appendChild($node); |
|
| 49 | |||
| 50 | 15 | return true; |
|
| 51 | } |
||
| 53 |