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