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