| Conditions | 6 |
| Paths | 7 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function parse(InlineParserContext $inlineContext) |
||
| 27 | { |
||
| 28 | $cursor = $inlineContext->getCursor(); |
||
| 29 | if ($cursor->getNextNonSpaceCharacter() !== '{') { |
||
| 30 | return false; |
||
| 31 | } |
||
| 32 | |||
| 33 | $char = $cursor->getCharacter(); |
||
| 34 | if ('{' === $char) { |
||
| 35 | $char = (string) $cursor->getCharacter($cursor->getPosition() - 1); |
||
| 36 | } |
||
| 37 | |||
| 38 | $attributes = AttributesUtils::parse($cursor); |
||
| 39 | if (empty($attributes)) { |
||
| 40 | return false; |
||
| 41 | } |
||
| 42 | |||
| 43 | if ('' === $char) { |
||
| 44 | $cursor->advanceToNextNonSpaceOrNewline(); |
||
| 45 | } |
||
| 46 | |||
| 47 | $node = new InlineAttributes($attributes, ' ' === $char || '' === $char); |
||
| 48 | $inlineContext->getContainer()->appendChild($node); |
||
| 49 | $inlineContext->getDelimiterStack()->push(new Delimiter('attributes', 1, $node, false, false)); |
||
| 50 | |||
| 51 | return true; |
||
| 52 | } |
||
| 53 | } |
||
| 54 |